feat: add BVK exchange library
This commit is contained in:
43
README.md
Normal file
43
README.md
Normal 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"
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user