feat: add BVK exchange library

This commit is contained in:
Георгий
2026-07-12 20:44:44 +03:00
parent 3a1c524eb2
commit 0ff0905a9c
15 changed files with 627 additions and 0 deletions

43
README.md Normal file
View File

@@ -0,0 +1,43 @@
# Mila
Mila is a small Go library for BVK media-complex content exchange.
It implements the HTTP protocol where BVK pushes the currently displayed
content state to the media complex:
```text
GET /set-content?route=<R>&str=<S>&tpl_name=<T>
GET /get-content
```
The library intentionally does not know anything about snapshots, route
progress, geolocation, frontend state, or media playback rules. It only parses,
validates, stores, logs, and returns BVK content state.
## Usage
```go
store := mila.NewFileStore("/srv/persistence/client_logs/bvk_content.json")
handler := mila.NewHandler(mila.DefaultConfig(), store,
mila.WithOnSet(func(state mila.ContentState) {
// Application-specific integration goes here.
}),
)
srv := &http.Server{
Addr: "0.0.0.0:13280",
Handler: handler,
}
```
## State
```json
{
"route": "3",
"str": "Гостиный двор - Gostiny dvor",
"tpl_name": "Гостиный двор",
"updated_at": "2026-07-12T12:00:00Z"
}
```