pgdiscordstore

package
v0.0.0-...-6ac3518 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements discord.Store interface backed by postgresql and sqlx.

func New

func New(db *sqlx.DB) *Store

New creates a new Store.

func (*Store) ActiveUsersCharIDs

func (s *Store) ActiveUsersCharIDs() []int32

ActiveUsersCharIDs returns EveCharIDs of users with `Active` set to true.

func (*Store) CreateUser

func (s *Store) CreateUser(u *discord.User)

CreateUser stores a discord.User record.

func (*Store) DiscordIDExists

func (s *Store) DiscordIDExists(did string) bool

DiscordIDExists checks if record with provided did exists.

func (*Store) Drop

func (s *Store) Drop()

Drop placeholder.

func (*Store) Init

func (s *Store) Init()

Init prepares db for usage.

func (*Store) SetUserInactiveByDiscordID

func (s *Store) SetUserInactiveByDiscordID(did string)

SetUserInactiveByDiscordID sets `active` to false for provided did.

func (*Store) UpdateUser

func (s *Store) UpdateUser(u *discord.User)

UpdateUser updates a discord.User record.

func (*Store) Users

func (s *Store) Users() []*discord.User

Users returns all discord.User records.

func (*Store) UsersWithValidToken

func (s *Store) UsersWithValidToken() []*discord.User

UsersWithValidToken returns user records with `discord_token_is_valid` set to true.

Jump to

Keyboard shortcuts

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