fd3cae1866
feat: SpaceAPI v15 support
...
Delete types/v14.go, replace with v15.go.
Rename internal types to not include message version.
I don't currently see the need to support multiple message
versions that have incompatible layouts.
v15 is backwards compatible with v14, so the config example now
specifies both.
Rename the "response" field in the config file to "static" as
dynamic/static makes more sense from the user's perspective.
(Internally it's still SpaceapidConfig.{Dynamic,Response}
to align with type names and usage.)
2026-07-25 22:51:26 +02:00
b5a286a237
feat: Log that version is unknown if version == ""
2026-07-25 22:51:26 +02:00
34d05ffa49
feat(handlers): Handle DELETE for environment sensors
...
It now works as advertised in the README! *ahem*...
2026-07-25 22:51:26 +02:00
abde10bfc9
style: Add .editorconfig
2026-07-25 22:51:26 +02:00
b33c266fb5
docs: Add missing backticks in README
2026-07-25 22:49:58 +02:00
b54d4a39cd
fix(config): Mention what that list of paths in the log is
2026-07-25 22:49:58 +02:00
1d49948615
fix(config): Remove redundant space from log message
2026-07-25 21:16:49 +02:00
e714cca477
refactor(handlers): Use fmt.Errorf instead of errors.New(fmt.Sprintf())
2026-07-25 21:16:40 +02:00
74fbef4ae8
refactor(handlers): Use http.Header.Set instead of direct map access
2026-07-25 21:16:06 +02:00
ccf3981d8d
docs: Improve log output for missing config
v0.1.0
2024-08-03 22:18:47 +02:00
732045645a
refactor!: Change config path env var name
2024-08-03 22:18:41 +02:00
759787569d
docs: Add go build example for setting version
2024-08-03 21:55:05 +02:00
5dacfd0dfe
docs: Update README and code comments
2024-08-03 21:02:44 +02:00
68d0ec05db
feat: Add support for PUT/DELETE state.message
...
Fix #33
2024-08-03 19:50:19 +02:00
74a8db7d2b
refactor: Add Go 1.22 HTTP method matching
2024-08-03 17:55:28 +02:00
bd94b295ac
docs: Fix typos
2024-08-03 15:15:31 +02:00
b98174c7da
Update README.md with note about URL paths
2024-05-26 20:52:24 +02:00
7218177625
Refactor environment sensor URL path generation
2024-05-26 20:52:23 +02:00
8015ed2be5
Location is optional for beverage_supply so make it omitempty
2024-05-26 20:52:22 +02:00
72f5a67989
Move persistence stuff to own package
2024-05-26 20:52:21 +02:00
742fb2be58
util.go only contains persistent state handling so rename accordingly
2024-05-26 20:52:20 +02:00
c7c6086d11
Rename constant for persistent state file and fix it at compile-time
2024-05-26 20:52:19 +02:00
4840021b08
Rename config shards in .gitignore
2024-05-26 20:52:18 +02:00
2b6c9a4376
Prettify coordinates in template
2024-05-26 20:52:17 +02:00
905140c5ba
Adjust template with migrated website and wiki
2024-05-26 20:52:16 +02:00
8c1adae040
Rename module
2024-05-26 20:52:15 +02:00
17753f535c
Fix URLs in config template
2024-03-24 16:29:50 +01:00
d77ceaaa00
Actually use degree sign instead of masculine ordinal indicator
2024-01-21 03:47:25 +01:00
579e7138d5
Fix temperature sensor unit in template and edit Git info
2024-01-17 18:57:40 +01:00
bbeb0d0e2b
Print version on startup, set this via -ldflags "-X main.version=foo"
2024-01-16 02:23:39 +01:00
2fb2e5f151
We don't need to write anything on successful requests actually, 200 is the default
2024-01-16 01:48:48 +01:00
fa6e6bd142
Set WWW-Authenticate header directly and change realm to spaceapid for consistency
2024-01-16 01:37:54 +01:00
bc299d4c70
Set charset=utf-8 in Content-Type header
2024-01-16 01:24:19 +01:00
cf9678d712
Actually end the connection when request checks fail
2024-01-15 23:24:58 +01:00
7ac8e91cc2
Improve logging in handlers/util.go
2024-01-15 22:32:52 +01:00
cc9cb8888c
Improve logging in handlers/state.go
2024-01-15 22:32:51 +01:00
efbd55aac4
Improve logging in handlers/sensors.go
2024-01-15 22:32:50 +01:00
1d30c16e46
More readable return statement
2024-01-15 22:24:57 +01:00
2495ce5808
Remove superfluous WriteHeader calls
2024-01-15 22:20:53 +01:00
808482b370
Correct typos in README and config template
2024-01-15 15:27:08 +01:00
42a012239f
Update README.md to reflect new features
2024-01-14 23:19:45 +01:00
9166a78fb7
Add -c flag to specify list of config files
...
- Environment variable also accepts comma-separated list
- Overwrites cli arguments
2024-01-14 21:56:11 +01:00
0241a506d4
Handle sensors that don't have a name, just a location
2024-01-14 21:54:44 +01:00
04b7efd74a
Open the persistent file just for writing when saving
2024-01-14 21:54:43 +01:00
70b2e8069b
Only pass State struct pointer to StateOpen, not entire response
2024-01-14 02:02:58 +01:00
44143c0c2d
Save sensor values to persistent-state.json
2024-01-14 02:02:55 +01:00
42483df78c
Update config-template.json with placeholders for environment sensors
2024-01-14 01:10:39 +01:00
38710484f9
Generate HTTP endpoints for environment sensors
...
- Move update request sanity checks to new method in handlers/util.go
- Change EnvironmentSensor.Value type because ParseFloat returns float64
2024-01-14 01:10:38 +01:00
6e1a8ac0e6
Initialize sensors map with static parts when parsing config
2024-01-14 01:02:30 +01:00
daac0b3b9e
Change Sensors field type in config and response to map
2024-01-14 01:01:12 +01:00