types

package
v0.0.0-...-ad7117f Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: Apache-2.0 Imports: 1 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	String() string
	Setup() error
	Listen() error
	ReplyTo(string, *Message) error
	HandleCommand(*Message) error
	GetUser(string) *User
	GetChannel(string) *Channel
	GetServer(string) *Server
}

type Channel

type Channel struct {
	Key       uint `gorm:"primary_key;AUTO_INCREMENT"`
	ID        string
	Server    *Server `gorm:"ForeignKey:ServerKey;save_associations:false"`
	ServerKey uint
	Active    bool
	APIID     string
}

type Message

type Message struct {
	Key        uint `gorm:"primary_key"`
	ID         string
	Author     *User `gorm:"ForeignKey:UserKey;save_associations:false"`
	UserKey    uint
	Content    string
	Channel    *Channel `gorm:"ForeignKey:ChannelKey;save_associations:false"`
	ChannelKey uint
	Mentions   []*User `gorm:"-"` // This doesn't need to be stored in the database
	Time       time.Time
	APIID      string
}

type Pair

type Pair struct {
	Key   string
	Value int
}

type PairList

type PairList []Pair

func (PairList) Len

func (p PairList) Len() int

func (PairList) Less

func (p PairList) Less(i, j int) bool

func (PairList) Swap

func (p PairList) Swap(i, j int)

type Respec

type Respec struct {
	Key        uint `gorm:"primary_key"`
	Respec     int
	User       *User `gorm:"ForeignKey:UserKey;save_associations:false"`
	UserKey    uint
	Channel    *Channel `gorm:"ForeignKey:ChannelKey;save_associations:false"`
	ChannelKey uint
	UpdatedAt  time.Time
}

type RespecList

type RespecList []*Respec

func (RespecList) Len

func (p RespecList) Len() int

func (RespecList) Less

func (p RespecList) Less(i, j int) bool

func (RespecList) Swap

func (p RespecList) Swap(i, j int)

type Scope

type Scope uint
const (
	Local  Scope = iota
	Guild  Scope = iota
	Global Scope = iota
)

type Server

type Server struct {
	Key   uint `gorm:"primary_key;AUTO_INCREMENT"`
	ID    string
	APIID string
}

type User

type User struct {
	Key   uint `gorm:"primary_key;AUTO_INCREMENT"`
	ID    string
	Name  string
	APIID string
	Bot   bool `gorm:"-"` // This doesn't need to be stored in the database
}

func (*User) UserIn

func (user *User) UserIn(users []*User) bool

Jump to

Keyboard shortcuts

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