Documentation ¶
Index ¶
- func ChannelString(channels []int) string
- func CreateTable()
- func EncodeChannels(channels []int) string
- func InCache(key string, cType EntityType) (string, bool)
- func ParseChannels(s string) (c []int)
- func Start()
- func Sync()
- type Entity
- func (entity *Entity) CanReceive(channels []int) bool
- func (entity *Entity) CreateEntity() (sql.Result, error)
- func (entity *Entity) Embed() *discordgo.MessageEmbed
- func (entity *Entity) GetDisplayName() string
- func (entity *Entity) GetIDTitle() string
- func (entity *Entity) Insert() error
- func (entity *Entity) Propagate() error
- func (entity *Entity) SetDisplayName(name string) error
- func (entity *Entity) SetReceiveChannels(channels []int) error
- func (entity *Entity) SetSendChannels(channels []int) error
- func (entity *Entity) UpdateEntity() (sql.Result, error)
- type EntityCache
- type EntityType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChannelString ¶
func CreateTable ¶ added in v0.0.2
func CreateTable()
func EncodeChannels ¶
func ParseChannels ¶
Types ¶
type Entity ¶
type Entity struct { ID string DisplayName string Type EntityType ReceiveChannels []int SendChannels []int CreatedAt time.Time }
func FetchEntities ¶
func FetchEntities(eType EntityType) ([]*Entity, error)
func FetchEntity ¶
func FetchEntity(id string, eType EntityType) (*Entity, error)
func GetEntities ¶
func GetEntities(eType EntityType) (entities []*Entity)
func (*Entity) CanReceive ¶
func (*Entity) Embed ¶
func (entity *Entity) Embed() *discordgo.MessageEmbed
func (*Entity) GetDisplayName ¶ added in v0.0.8
func (*Entity) GetIDTitle ¶ added in v0.0.8
func (*Entity) SetDisplayName ¶ added in v0.0.8
func (*Entity) SetReceiveChannels ¶
func (*Entity) SetSendChannels ¶
type EntityCache ¶
var Cache *EntityCache
type EntityType ¶
type EntityType int
const ( Server EntityType = iota Channel All )
func EntityTypeFromString ¶
func EntityTypeFromString(t string) EntityType
func (EntityType) Polarize ¶
func (eType EntityType) Polarize() EntityType
func (EntityType) String ¶
func (eType EntityType) String() string
Click to show internal directories.
Click to hide internal directories.