Documentation ¶
Index ¶
- Variables
- type AppV1
- func (v *AppV1) Broadcast(key string, eid event.Id, m interface{})
- func (v *AppV1) Down() error
- func (v *AppV1) KVDelV1(ctx *Props) error
- func (v *AppV1) KVGetV1(ctx *Props) error
- func (v *AppV1) KVListV1(ctx *Props) error
- func (v *AppV1) KVSearchV1(ctx *Props) error
- func (v *AppV1) KVSetV1(ctx *Props) error
- func (v *AppV1) KVWatchV1(w server.Response, r server.Request, m server.Meta) error
- func (v *AppV1) ProxyRest(call func(p *Props) error) func(ctx web.Context)
- func (v *AppV1) ProxyWS(call func(p *Props) error) func(server.Response, server.Request, server.Meta) error
- func (v *AppV1) SetBroadcastHandler(call func(eid event.Id, m interface{}, cids ...string))
- func (v *AppV1) Up(ctx xc.Context) error
- type EntitiesKV
- type EntitiesService
- type EntityKV
- func (v *EntityKV) FromDB(item db.EntityKV)
- func (v EntityKV) MarshalEasyJSON(w *jwriter.Writer)
- func (v EntityKV) MarshalJSON() ([]byte, error)
- func (v EntityKV) ToDB() db.EntityKV
- func (v *EntityKV) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *EntityKV) UnmarshalJSON(data []byte) error
- func (v *EntityKV) UseEmptyValue()
- type EntityService
- type Props
Constants ¶
This section is empty.
Variables ¶
var Plugin = plugins.Plugin{ Inject: New, Resolve: func(r web.RouterPool, c *AppV1, ws ws.WebsocketServer) { router := r.Main() c.SetBroadcastHandler(ws.SendEvent) ws.SetHandler(c.ProxyWS(c.KVGetV1), api.EventKVGet) ws.SetHandler(c.ProxyWS(c.KVSetV1), api.EventKVSet) ws.SetHandler(c.ProxyWS(c.KVDelV1), api.EventKVDel) ws.SetHandler(c.KVWatchV1, api.EventKVWatch) router.Get(api.PathApiV1Watch, func(ctx web.Context) { ws.Handling(ctx.Response(), ctx.Request()) }) router.Get(api.PathApiV1KV, c.ProxyRest(c.KVGetV1)) router.Put(api.PathApiV1KV, c.ProxyRest(c.KVSetV1)) router.Delete(api.PathApiV1KV, c.ProxyRest(c.KVDelV1)) router.Get(api.PathApiV1KVSearch, c.ProxyRest(c.KVSearchV1)) router.Get(api.PathApiV1KVList, c.ProxyRest(c.KVListV1)) }, }
Functions ¶
This section is empty.
Types ¶
type AppV1 ¶
type AppV1 struct {
// contains filtered or unexported fields
}
func (*AppV1) KVSearchV1 ¶
func (*AppV1) SetBroadcastHandler ¶
type EntitiesKV ¶
type EntitiesKV []EntityKV
func (EntitiesKV) MarshalEasyJSON ¶
func (v EntitiesKV) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (EntitiesKV) MarshalJSON ¶
func (v EntitiesKV) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*EntitiesKV) UnmarshalEasyJSON ¶
func (v *EntitiesKV) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EntitiesKV) UnmarshalJSON ¶
func (v *EntitiesKV) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type EntitiesService ¶ added in v0.1.1
type EntitiesService []EntityService
func (EntitiesService) MarshalEasyJSON ¶ added in v0.1.1
func (v EntitiesService) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (EntitiesService) MarshalJSON ¶ added in v0.1.1
func (v EntitiesService) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*EntitiesService) UnmarshalEasyJSON ¶ added in v0.1.1
func (v *EntitiesService) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EntitiesService) UnmarshalJSON ¶ added in v0.1.1
func (v *EntitiesService) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type EntityKV ¶
func (EntityKV) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (EntityKV) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*EntityKV) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EntityKV) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
func (*EntityKV) UseEmptyValue ¶
func (v *EntityKV) UseEmptyValue()
type EntityService ¶ added in v0.1.1
type EntityService struct { Name string `json:"n"` Address string `json:"a,omitempty"` Tags []string `json:"t,omitempty"` Health string `json:"h,omitempty"` }
func (EntityService) MarshalEasyJSON ¶ added in v0.1.1
func (v EntityService) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (EntityService) MarshalJSON ¶ added in v0.1.1
func (v EntityService) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*EntityService) UnmarshalEasyJSON ¶ added in v0.1.1
func (v *EntityService) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EntityService) UnmarshalJSON ¶ added in v0.1.1
func (v *EntityService) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface