store

package
v0.0.0-...-c97d4d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	Name        string    `json:"name"`
	Description string    `json:"description"`
	CoverURL    string    `json:"coverURL"`
	ProfileURL  string    `json:"profileURL"`
	Birthday    time.Time `json:"birthday"`
}

Character represents a chracter

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store wraps app database

func (*Store) ClearCharacters

func (s *Store) ClearCharacters()

ClearCharacters clears character bucket

func (*Store) ClearWishes

func (s *Store) ClearWishes()

ClearWishes clears wish bucket

func (*Store) Close

func (s *Store) Close()

Close closes db connection

func (*Store) GetBirthdays

func (s *Store) GetBirthdays() map[string]Character

GetBirthdays gets all characters with birthdays today

func (*Store) GetBirthdaysRecent

func (s *Store) GetBirthdaysRecent(scope time.Duration) map[string]Character

GetBirthdaysRecent gets all characters with birthdays today

func (*Store) GetBirthdaysUpcoming

func (s *Store) GetBirthdaysUpcoming(scope time.Duration) map[string]Character

GetBirthdaysUpcoming gets all characters with birthdays today

func (*Store) GetCharacters

func (s *Store) GetCharacters() map[string]Character

GetCharacters gets all characters

func (*Store) GetWishesToday

func (s *Store) GetWishesToday(characterID string) map[string]Wish

GetWishesToday gets all wishes for a character today

func (*Store) Open

func (s *Store) Open(name string)

Open opens db connection

func (*Store) PutWish

func (s *Store) PutWish(characterID string, data Wish)

PutWish inserts wish by timestamp

func (*Store) UpdateCharacter

func (s *Store) UpdateCharacter(key string, data Character)

UpdateCharacter updates character by name

type Wish

type Wish struct {
	ImgData string `json:"imgData"`
}

Wish represents an image wish

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL