Documentation ¶
Index ¶
- Constants
- Variables
- type DB
- func (d *DB) DeleteEvent(e Event)
- func (d *DB) DeleteEventMemberByID(u uint)
- func (d *DB) DeleteLoginForCode(code string)
- func (d *DB) EventByID(id int) (*Event, error)
- func (d *DB) EventChannelByChannelID(chID string) (*EventChannel, error)
- func (d *DB) EventChannelByID(id int) (*EventChannel, error)
- func (d *DB) EventChannels() ([]EventChannel, error)
- func (d *DB) EventMemberByID(id uint) (*EventMember, error)
- func (d *DB) EventMembers(event *Event) ([]*EventMember, error)
- func (d *DB) Events() ([]*Event, error)
- func (d *DB) EventsUpdated() ([]*Event, error)
- func (d *DB) GetLoginForCode(code string) (Logins, error)
- func (d *DB) MemberByAny(some string) (*Member, error)
- func (d *DB) MemberByDiscordID(id string) (*Member, error)
- func (d *DB) MemberByID(id int) (*Member, error)
- func (d *DB) MemberByName(name string) (*Member, error)
- func (d *DB) MemberBySlackID(id string) (*Member, error)
- func (d *DB) Members() ([]*Member, error)
- func (d *DB) MembersActive(since time.Time) ([]*Member, error)
- func (d *DB) NewEvent() *Event
- func (d *DB) PurgeOldEventChannels(t time.Duration)
- func (d *DB) SaveEventChannel(e *EventChannel) error
- func (d *DB) StreamByID(id int) (*Stream, error)
- func (d *DB) StreamByMemberID(memberID int) (*Stream, error)
- func (d *DB) Streams() ([]*Stream, error)
- type Event
- type EventChannel
- type EventMember
- type Logins
- type Member
- type MemberMeta
- type Stream
Constants ¶
View Source
const ( // EventMemberTypeHost is the person who created the event EventMemberTypeHost int = iota // EventMemberTypeMember is a member who is joining the event EventMemberTypeMember // EventMemberTypeAlt is someone who is joining as a backup or tentatively avaialble EventMemberTypeAlt )
Variables ¶
View Source
var Logger *zap.Logger
Functions ¶
This section is empty.
Types ¶
type DB ¶
func (*DB) DeleteEventMemberByID ¶
func (*DB) DeleteLoginForCode ¶
DeleteLoginForCode deletes login rows with the matching code
func (*DB) EventChannelByChannelID ¶
func (d *DB) EventChannelByChannelID(chID string) (*EventChannel, error)
EventChanneByChannelID returns an event channel the by discord channel id (snowflake)
func (*DB) EventChannelByID ¶
func (d *DB) EventChannelByID(id int) (*EventChannel, error)
EventChannelByID returns an EventChannel found by the DB ID
func (*DB) EventChannels ¶
func (d *DB) EventChannels() ([]EventChannel, error)
EventChannels gets all event channels in the DB, or an error
func (*DB) EventMemberByID ¶
func (d *DB) EventMemberByID(id uint) (*EventMember, error)
func (*DB) EventMembers ¶
func (d *DB) EventMembers(event *Event) ([]*EventMember, error)
func (*DB) EventsUpdated ¶
func (*DB) GetLoginForCode ¶
GetLoginForCode returns a Logins{} where the code matches and an error if any
func (*DB) PurgeOldEventChannels ¶
PurgeOldEventChannels purge event channels that have not been updated in the given amount of time
func (*DB) SaveEventChannel ¶
func (d *DB) SaveEventChannel(e *EventChannel) error
SaveEventChannel creates or saves an EventChannel
type Event ¶
type Event struct { gorm.Model When *time.Time `gorm:"index"` Where string `gorm:"index"` Title string `gorm:"type:varchar(191);not null;default:''"` Description string `gorm:"type:varchar(256);"` EventChannel EventChannel `gorm:"foreignkey:ChannelID"` EventChannelID string `gorm:"type:varchar(191);not null"` GUID string `gorm:"type:varchar(191);not null;default:'';unique_index"` Need int Members []*EventMember // contains filtered or unexported fields }
func (*Event) BeforeCreate ¶
type EventChannel ¶
type EventChannel struct { ID string `gorm:"type:varchar(191);not null;default:'';primary_key" json:"channelID"` CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` ChannelCategoryName string `json:"categoryName"` ChannelCategoryID string `json:"categoryID"` ChannelName string `json:"name"` // contains filtered or unexported fields }
type Member ¶
type Member struct { ID int `sql:"bigint(20) NOT NULL AUTO_INCREMENT" json:"id"` CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` Slack string `gorm:"type:varchar(191);null;unique_index" json:"slack_id"` Discord string `gorm:"type:varchar(191);null;unique_index" json:"discord"` Xbl string `gorm:"type:varchar(191);not null;default:'';index" json:"-"` Psn string `gorm:"type:varchar(191);not null;default:''" json:"-"` Destiny string `gorm:"type:varchar(191);not null;default:''" json:"-"` Seen int `gorm:"type:bigint;not null;index;default:0" json:"-"` Name string `gorm:"type:varchar(191);not null;default:''" json:"name"` TZ string `gorm:"type:varchar(191);not null;default:''" json:"-"` // contains filtered or unexported fields }
type MemberMeta ¶
type MemberMeta struct { ID int `sql:"bigint(20) NOT NULL AUTO_INCREMENT"` MemberID int `sql:"bigint(20) NOT NULL" gorm:"unique_index:user_meta_key"` MetaKey string `gorm:"type:varchar(191);not null;unique_index:user_meta_key;index:meta_key"` MetaJSON []byte CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time // contains filtered or unexported fields }
func (*MemberMeta) Save ¶
func (m *MemberMeta) Save() error
type Stream ¶
type Stream struct { ID int `sql:"bigint(20) NOT NULL AUTO_INCREMENT"` MemberID int `gorm:"type:bigint;not null;default:0;unique_index"` Twitch string `gorm:"type:varchar(191);not null;default:'';index"` TwitchStreamID string `gorm:"type:varchar(191);not null;default:''"` TwitchGame string `form:"type:varchar(191);not null;default:''"` TwitchStart int64 `gorm:"type:bigint;not null;default:0"` TwitchStop int64 `gorm:"type:bigint;not null;default:0"` YoutubeStreamID string `gorm:"type:varchar(64);not null;default:''"` Youtube string `gorm:"type:varchar(191);not null;default:'';index"` YoutubeStart int64 `gorm:"type:bigint;not null;default:0"` YoutubeStop int64 `gorm:"type:bigint;not null;default:0"` CreatedAt time.Time `sql:"DEFAULT:current_timestamp"` UpdatedAt time.Time `` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.