44 lines
996 B
Markdown
44 lines
996 B
Markdown
# 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"
|
|
}
|
|
```
|