Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientInterface ¶
type ClientInterface interface {
SendMessage(msg interface{})
GetWS() *websocket.Conn
GetSubscriptions() map[string][]Filter
CloseClient()
}
ClientInterface abstracts WebSocket clients
type Event ¶
type Event struct {
ID string `json:"id" bson:"id"`
PubKey string `json:"pubkey" bson:"pubkey"`
CreatedAt int64 `json:"created_at" bson:"created_at"`
Kind int `json:"kind" bson:"kind"`
Tags [][]string `json:"tags" bson:"tags"`
Content string `json:"content" bson:"content"`
Sig string `json:"sig" bson:"sig"`
}
type Filter ¶
type Filter struct {
IDs []string `json:"ids"`
Authors []string `json:"authors"`
Kinds []int `json:"kinds"`
Tags map[string][]string `json:"tags"`
Since *time.Time `json:"since"`
Until *time.Time `json:"until"`
Limit *int `json:"limit"`
}
Filter represents the criteria used to query events
type Subscription ¶
Click to show internal directories.
Click to hide internal directories.