Documentation ¶
Index ¶
- func CandidToEvent(e *Event) *event.T
- type Backend
- func (b *Backend) ClearEvents(c context.T) (result string, err error)
- func (b *Backend) CountEvents(c context.T, f *filter.T) (count int, err error)
- func (b *Backend) DeleteEvent(c context.T, ev *event.T) (err error)
- func (b *Backend) GetCandidEvent(c context.T, filter *Filter) ([]Event, error)
- func (b *Backend) QueryEvents(c context.T, f *filter.T) (ch event.C, err error)
- func (b *Backend) SaveCandidEvent(event Event) (result string, err error)
- func (b *Backend) SaveEvent(c context.T, e *event.T) (err error)
- type Event
- type Filter
- type KeyValuePair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CandidToEvent ¶
Types ¶
type Backend ¶
func (*Backend) CountEvents ¶
CountEvents counts how many events match the filter in the IC. todo: use the proper count events API call in the canister
func (*Backend) DeleteEvent ¶
DeleteEvent deletes an event matching the given event. todo: not yet implemented, but there is already a backend function for this
func (*Backend) GetCandidEvent ¶
func (*Backend) QueryEvents ¶
func (*Backend) SaveCandidEvent ¶
type Event ¶
type Event struct { ID string `ic:"id"` Pubkey string `ic:"pubkey"` CreatedAt int64 `ic:"created_at"` Kind uint16 `ic:"kind"` Tags [][]string `ic:"tags"` Content string `ic:"content"` Sig string `ic:"sig"` }
func EventToCandid ¶
type Filter ¶
type Filter struct { IDs []string `ic:"ids"` Kinds []uint16 `ic:"kinds"` Authors []string `ic:"authors"` Tags []KeyValuePair `ic:"tags"` Since int64 `ic:"since"` Until int64 `ic:"until"` Limit int64 `ic:"limit"` Search string `ic:"search"` }
func FilterToCandid ¶
type KeyValuePair ¶
func TagMapToKV ¶
func TagMapToKV(t filter.TagMap) (keys []KeyValuePair)
Click to show internal directories.
Click to hide internal directories.