Documentation
¶
Index ¶
- Variables
- func AddGroup(system *System, group *Group) error
- func AddMember(system *System, member *Member) error
- func AddSystem(system *System) error
- func BytesEqual(a []byte, b []byte) bool
- func ConnectDiscord(system *System, discordID uint64) error
- func DeleteGroup(id []byte) error
- func DeleteMember(id []byte) error
- func DeleteSystem(id []byte) error
- func EditSwitch(pswitch *PluralSwitch) error
- func ExportJSON(system System) string
- func Find(object interface{}, array []interface{}) int
- func FindInt(object int, array []int) int
- func FindInt64(object int64, array []int64) int
- func FindStr(object string, array []string) int
- func FindUInt64(object uint64, array []uint64) int
- func GetDateString(t time.Time) string
- func GetFronters(at time.Time) (*[]*Member, error)
- func GetGroupMembers(id []byte) (*[]*Member, error)
- func GetMembers(id []byte) (*[]*Member, error)
- func GetMembersFromRows(rows *sql.Rows) (*[]*Member, error)
- func GetSwitchesBetween(from *time.Time, to *time.Time) (*[]*PluralSwitch, error)
- func GetSystemMembers(id []byte) (*[]*Member, error)
- func HasBit(n uint16, pos uint) bool
- func InitialiseDatabase(config JSONConfig) error
- func ParsePluralKitBirthday(timeString string) (*time.Time, error)
- func ParsePluralKitTime(timeString string) (*time.Time, error)
- func ParseTupperTime(timeString string) (*time.Time, error)
- func SaveSwitch(pswitch *PluralSwitch) error
- func SaveSwitchOut(memberID []byte, at time.Time) error
- func UpdateGroup(group *Group) error
- func UpdateMember(member *Member) error
- func UpdateSystem(system *System) error
- type Group
- type GroupPrivacy
- type JSONConfig
- type JSONMemberSettings
- type JSONSystemSettings
- type JSONUInt
- type Member
- type MemberPrivacy
- type PKMemberData
- type PKProxyData
- type PKSwitchData
- type PKSystemData
- type PluralBase
- type PluralSwitch
- type ServerMember
- type System
- type SystemPrivacy
- type TupperGroupData
- type TupperMemberData
- type TupperSystemData
Constants ¶
This section is empty.
Variables ¶
View Source
var CONFIG_FILE_NAME string = "config.json"
Functions ¶
func BytesEqual ¶
func ConnectDiscord ¶
func DeleteGroup ¶
func DeleteMember ¶
func DeleteSystem ¶
func EditSwitch ¶
func EditSwitch(pswitch *PluralSwitch) error
func FindUInt64 ¶
func GetDateString ¶
func GetGroupMembers ¶
func GetSwitchesBetween ¶
func GetSystemMembers ¶
func InitialiseDatabase ¶
func InitialiseDatabase(config JSONConfig) error
func SaveSwitch ¶
func SaveSwitch(pswitch *PluralSwitch) error
func UpdateGroup ¶
func UpdateMember ¶
func UpdateSystem ¶
Types ¶
type Group ¶
type Group struct {
PluralBase
Tag *string
Members []*Member
Privacy GroupPrivacy
}
type GroupPrivacy ¶
func GetGroupPrivacy ¶
func GetGroupPrivacy(number uint16) GroupPrivacy
func (*GroupPrivacy) ToInt ¶
func (p *GroupPrivacy) ToInt() uint16
type JSONConfig ¶
type JSONConfig struct {
Database struct {
Address string `json:"address"`
Name string `json:"database"`
Username string `json:"username"`
Password string `json:"password"`
} `json:"db"`
}
func GetJSONConfig ¶
func GetJSONConfig() (*JSONConfig, error)
type JSONMemberSettings ¶
type JSONMemberSettings struct {
}
type JSONSystemSettings ¶
type JSONSystemSettings struct {
}
type JSONUInt ¶
func (*JSONUInt) UnmarshalJSON ¶
type Member ¶
type Member struct {
PluralBase
Proxies [][]string
Birthday *time.Time
ServerMembers []*ServerMember
Groups []*Group
KeepProxy bool
Pronouns string
MessageCount int
Settings *JSONMemberSettings
PluralKitID *string
Privacy MemberPrivacy
// contains filtered or unexported fields
}
type MemberPrivacy ¶
type MemberPrivacy struct {
Visible bool
Name bool
Description bool
Icon bool
Birthday bool
Pronouns bool
Metadata bool
Front bool
FrontHistory bool
}
func GetMemberPrivacy ¶
func GetMemberPrivacy(number uint16) MemberPrivacy
func (*MemberPrivacy) ToInt ¶
func (p *MemberPrivacy) ToInt() uint16
type PKMemberData ¶
type PKMemberData struct {
Id string `json:"id"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
Birthday string `json:"birthday"`
Pronouns string `json:"pronouns"`
Colour string `json:"colour"`
AvatarURL string `json:"avatar_url"`
ProxyTags []PKProxyData `json:"proxy_tags"`
KeepProxy bool `json:"keep_proxy"`
MessageCount JSONUInt `json:"message_count"`
Created string `json:"created"`
}
type PKProxyData ¶
type PKSwitchData ¶
type PKSystemData ¶
type PKSystemData struct {
Version JSONUInt `json:"version"`
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Tag string `json:"tag"`
AvatarURL string `json:"avatar_url"`
Timezone string `json:"timezone"`
Members []PKMemberData `json:"members"`
Switches []PKSwitchData `json:"switches"`
Accounts []JSONUInt `json:"accounts"`
Created string `json:"created"`
}
type PluralBase ¶
type PluralSwitch ¶
type ServerMember ¶
type System ¶
type System struct {
PluralBase
Email *string
Password *string
Tag *string
Groups []*Group
Members []*Member
Switches []*PluralSwitch
Discords []uint64
KeepProxy bool
Singlet bool
Settings *JSONSystemSettings
PluralKitToken *string
PluralKitID *string
Privacy SystemPrivacy
// contains filtered or unexported fields
}
func FromPluralKitJSON ¶
func FromTupperBoxJSON ¶
func GetSystemByDiscord ¶
func NewAccount ¶
type SystemPrivacy ¶
func GetSystemPrivacy ¶
func GetSystemPrivacy(number uint16) SystemPrivacy
func (*SystemPrivacy) ToInt ¶
func (p *SystemPrivacy) ToInt() uint16
type TupperGroupData ¶
type TupperMemberData ¶
type TupperMemberData struct {
Id JSONUInt `json:"id"`
UserId string `json:"user_id"`
Name string `json:"name"`
Position JSONUInt `json:"position"`
AvatarURL string `json:"avatar_url"`
Brackets []string `json:"brackets"`
Posts JSONUInt `json:"posts"`
ShowBrackets bool `json:"show_brackets"`
Birthday string `json:"birthday"`
Description string `json:"description"`
Tag string `json:"tag"`
GroupId JSONUInt `json:"group_id"`
GroupPos JSONUInt `json:"group_pos"`
CreatedAt string `json:"created_at"`
Nick string `json:"nick"`
}
type TupperSystemData ¶
type TupperSystemData struct {
Tuppers []TupperMemberData `json:"tuppers"`
Groups []TupperGroupData `json:"groups"`
}
Click to show internal directories.
Click to hide internal directories.