entity

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChannelString

func ChannelString(channels []int) string

func CreateTable added in v0.0.2

func CreateTable()

func EncodeChannels

func EncodeChannels(channels []int) string

func InCache

func InCache(key string, cType EntityType) (string, bool)

func ParseChannels

func ParseChannels(s string) (c []int)

func Start

func Start()

func Sync

func Sync()

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 GetEntity

func GetEntity(id string, eType EntityType) (*Entity, error)

func (*Entity) CanReceive

func (entity *Entity) CanReceive(channels []int) bool

func (*Entity) CreateEntity

func (entity *Entity) CreateEntity() (sql.Result, error)

func (*Entity) Embed

func (entity *Entity) Embed() *discordgo.MessageEmbed

func (*Entity) GetDisplayName added in v0.0.8

func (entity *Entity) GetDisplayName() string

func (*Entity) GetIDTitle added in v0.0.8

func (entity *Entity) GetIDTitle() string

func (*Entity) Insert

func (entity *Entity) Insert() error

func (*Entity) Propagate added in v0.0.8

func (entity *Entity) Propagate() error

func (*Entity) SetDisplayName added in v0.0.8

func (entity *Entity) SetDisplayName(name string) error

func (*Entity) SetReceiveChannels

func (entity *Entity) SetReceiveChannels(channels []int) error

func (*Entity) SetSendChannels

func (entity *Entity) SetSendChannels(channels []int) error

func (*Entity) UpdateEntity added in v0.0.8

func (entity *Entity) UpdateEntity() (sql.Result, error)

type EntityCache

type EntityCache struct {
	Entities   map[string]*Entity
	Controller chan *Entity
}
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

Jump to

Keyboard shortcuts

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