Documentation
¶
Index ¶
- type Emoji
- type EmojiClient
- func (ec *EmojiClient) Delete(all []EmojiPair) (int, error)
- func (ec *EmojiClient) ForAdmin(by string, limit int) ([]*Emoji, error)
- func (ec *EmojiClient) Import(all []*Emoji) (int, error)
- func (ec *EmojiClient) Name(pair EmojiPair, source string) error
- func (ec *EmojiClient) Popular(limit int) ([]EmojiPair, error)
- func (ec *EmojiClient) Query(query string, prefix bool, limit int) ([]EmojiPair, error)
- func (ec *EmojiClient) Ref(p *EmojiPair) *firestore.DocumentRef
- func (ec *EmojiClient) Select(all []EmojiPair) error
- func (ec *EmojiClient) Touch(all []*Emoji) (int, error)
- type EmojiPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Emoji ¶
type Emoji struct { EmojiPair Created time.Time `firestore:"created"` Uses int `firestore:"uses"` // total use count Last time.Time `firestore:"last,omitempty"` // last use at Recent float64 `firestore:"recent"` // recent use count RecentAt time.Time `firestore:"recentAt,omitempty"` // recent use adjusted at Duration time.Duration `firestore:"duration"` // drifted time between use Source string `firestore:"source,omitempty"` // original import source Length int `firestore:"len,omitempty"` // emoji visible length Version int `firestore:"v,omitempty"` // revision in db Index map[string]float64 `firestore:"i,omitempty"` // all index components by prefix }
Emoji is an Emoji stored in Firestore.
func (*Emoji) DurationAt ¶
DurationAt returns the drifted duration assuming a new use right now.
type EmojiClient ¶
EmojiClient is an interface to Firestore to retrieve and update Emoji.
func (*EmojiClient) ForAdmin ¶
func (ec *EmojiClient) ForAdmin(by string, limit int) ([]*Emoji, error)
func (*EmojiClient) Ref ¶
func (ec *EmojiClient) Ref(p *EmojiPair) *firestore.DocumentRef
Ref returns the firestore.DocumentRef for this EmojiPair, or nil if invalid.
func (*EmojiClient) Select ¶
func (ec *EmojiClient) Select(all []EmojiPair) error
type EmojiPair ¶
type EmojiPair struct { Name string `firestore:"name" json:"name"` Emoji string `firestore:"emoji" json:"emoji"` }
EmojiPair is an emoji and its name.
Click to show internal directories.
Click to hide internal directories.