entity

package
v0.0.0-...-7077e90 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeliverableSendChannels

func DeliverableSendChannels(d protocol.Deliverable) []int

func EncodeDelimitedChannels

func EncodeDelimitedChannels(channels []int) string

func HumanizeChannelString

func HumanizeChannelString(channels []int) string

func Initialize

func Initialize()

func ParseDelimitedChannels

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

func WriteCache

func WriteCache(e *Entity)

Types

type Entity

type Entity struct {
	ID                   string
	DisplayName          string
	ReceiveChannels      []int
	SendChannels         []int
	DisabledReceiveTypes []int
	DisabledSendTypes    []int
	CreatedAt            time.Time
}

func Entities

func Entities() (entities []*Entity)

func FetchEntities

func FetchEntities() ([]*Entity, error)

func FetchEntity

func FetchEntity(id string) (*Entity, error)

func GetEntity

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

func (*Entity) CanReceiveType

func (e *Entity) CanReceiveType(t protocol.MessageType) bool

func (*Entity) CanSendType

func (e *Entity) CanSendType(t protocol.MessageType) bool

func (*Entity) CreateEntity

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

func (*Entity) Delete

func (entity *Entity) Delete() error

func (*Entity) Embed

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

func (*Entity) GetDisplayName

func (entity *Entity) GetDisplayName() string

func (*Entity) Insert

func (entity *Entity) Insert() error

func (*Entity) Propagate

func (entity *Entity) Propagate() error

func (*Entity) QDelete

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

func (*Entity) ReceiveIntersectsWith

func (e *Entity) ReceiveIntersectsWith(chans []int) bool

func (*Entity) SendIntersectsWith

func (e *Entity) SendIntersectsWith(chans []int) bool

func (*Entity) SetDisplayName

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

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

type EntityCache

type EntityCache struct {
	sync.RWMutex

	Entities map[string]*Entity
}
var Cache *EntityCache

Jump to

Keyboard shortcuts

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