Documentation ¶
Index ¶
- func AuthUser(username string, password string) bool
- func DeleteByUUID(uuid uuid.UUID) bool
- func NotifyUser(name, email, subject, message string)
- func OLDcreateUUIDs(number int) []uuid.UUID
- func StartEventProcessor() error
- type Complaint
- type Debt
- type DummyPlayerStorage
- func (dps *DummyPlayerStorage) Delete(uuid uuid.UUID) error
- func (dps *DummyPlayerStorage) Load(uuid uuid.UUID) (*Player, error)
- func (dps *DummyPlayerStorage) LoadAll() ([]*Player, error)
- func (dps *DummyPlayerStorage) LoadUser(username string) (*User, error)
- func (dps *DummyPlayerStorage) Store(p *Player) error
- type Player
- func (p *Player) AddDebt(d Debt) error
- func (p *Player) AddQuote(q string) error
- func (creditor *Player) Credits() ([]Debt, error)
- func (p *Player) DebtByUUID(uuid uuid.UUID) (*Debt, error)
- func (p *Player) ResetDebt() error
- func (p *Player) ResetGossip() error
- func (p *Player) SetActive(active bool) error
- func (p *Player) SetGossip(g map[string]string) error
- func (p *Player) SetNick(nick string) error
- func (p *Player) SetProfile(profile Profile) error
- func (p *Player) SetUser(user User) error
- func (p *Player) SetUserAdmin(adminStatus bool) error
- func (p *Player) SetUserPassword(password string) error
- func (p *Player) SetUserSettings(settings UserSettings) error
- func (p *Player) SetVotes(v Votes) error
- func (p *Player) SettleDebt(debtuuid uuid.UUID) error
- type PlayerStorage
- type Profile
- type RedisPlayerStorage
- func (rps *RedisPlayerStorage) Delete(uuid uuid.UUID) error
- func (rps *RedisPlayerStorage) Load(uuid uuid.UUID) (*Player, error)
- func (rps *RedisPlayerStorage) LoadAll() ([]*Player, error)
- func (rps *RedisPlayerStorage) LoadUser(username string) (*User, error)
- func (rps *RedisPlayerStorage) Store(p *Player) error
- type User
- type UserSettings
- type Votes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteByUUID ¶
func NotifyUser ¶
func NotifyUser(name, email, subject, message string)
func OLDcreateUUIDs ¶
func StartEventProcessor ¶
func StartEventProcessor() error
Types ¶
type Debt ¶
type Debt struct { UUID uuid.UUID `json:"uuid"` Debitor uuid.UUID `json:"debitor"` Creditor uuid.UUID `json:"creditor"` Description string `json:"description"` Amount int `json:"amount"` Created time.Time `json:"created"` Settled time.Time `json:"settled"` }
A debt to another player (hte creditor)
type DummyPlayerStorage ¶
type DummyPlayerStorage struct {
// contains filtered or unexported fields
}
func NewDummyPlayerStorage ¶
func NewDummyPlayerStorage() *DummyPlayerStorage
func (*DummyPlayerStorage) Load ¶
func (dps *DummyPlayerStorage) Load(uuid uuid.UUID) (*Player, error)
func (*DummyPlayerStorage) LoadAll ¶
func (dps *DummyPlayerStorage) LoadAll() ([]*Player, error)
func (*DummyPlayerStorage) LoadUser ¶
func (dps *DummyPlayerStorage) LoadUser(username string) (*User, error)
func (*DummyPlayerStorage) Store ¶
func (dps *DummyPlayerStorage) Store(p *Player) error
type Player ¶
type Player struct { UUID uuid.UUID `json:"uuid"` Profile Profile `json:"profile"` Nick string `json:"nick"` User User `json:"user"` Active bool `json:"active"` // Quotes are just strings set by other players Quotes []string `json:"quotes"` // Gossip is one string from each // of the other players, indexed by uuid as string Gossip map[string]string `json:"gossip"` Complaints []Complaint `json:"complaints"` Votes Votes `json:"votes"` // Debts where this player is the debitor Debts []Debt `json:"debts"` }
A Player is a player in CKPT, current or former.o// It also contains a User.
func AllPlayers ¶
func PlayerByUserToken ¶
func (*Player) ResetGossip ¶
func (*Player) SetProfile ¶
func (*Player) SetUserAdmin ¶
func (*Player) SetUserPassword ¶
func (*Player) SetUserSettings ¶
func (p *Player) SetUserSettings(settings UserSettings) error
type PlayerStorage ¶
type PlayerStorage interface { Store(*Player) error Delete(uuid.UUID) error Load(uuid.UUID) (*Player, error) LoadAll() ([]*Player, error) LoadUser(username string) (*User, error) }
A storage interface for Players
type Profile ¶
type Profile struct { Name string `json:"name"` Picture []byte `json:"picture"` Birthday time.Time `json:"birthday"` Email string `json:"email"` Description string `json:"description"` Allergies string `json:"allergies"` }
The basic profile of the player
type RedisPlayerStorage ¶
type RedisPlayerStorage struct {
// contains filtered or unexported fields
}
func NewRedisPlayerStorage ¶
func NewRedisPlayerStorage() *RedisPlayerStorage
func (*RedisPlayerStorage) Load ¶
func (rps *RedisPlayerStorage) Load(uuid uuid.UUID) (*Player, error)
func (*RedisPlayerStorage) LoadAll ¶
func (rps *RedisPlayerStorage) LoadAll() ([]*Player, error)
func (*RedisPlayerStorage) LoadUser ¶
func (rps *RedisPlayerStorage) LoadUser(username string) (*User, error)
func (*RedisPlayerStorage) Store ¶
func (rps *RedisPlayerStorage) Store(p *Player) error
type User ¶
type User struct { Username string `json:"username"` Apikey string `json:"apikey"` Admin bool `json:"admin"` Locked bool `json:"locked"` Settings UserSettings `json:"settings"` // contains filtered or unexported fields }
The user associated with a player
func UserByName ¶
func (*User) SubscribedTo ¶
type UserSettings ¶
The user preferences/settings of the user
Click to show internal directories.
Click to hide internal directories.