channel

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel interface {
	GetChannel(ctx context.Context, id int64) (model.Channel, error)
	GetChannelsBulk(ctx context.Context, ids []int64) ([]model.Channel, error)
	GetChannelThreads(ctx context.Context, channelId int64) ([]model.Channel, error)
	GetChannelMessagePosition(ctx context.Context, id int64) (int64, error)
	CreateChannel(ctx context.Context, id int64, name string, channelType model.ChannelType, parent *int64, permissions *int64, private bool) error
	DeleteChannel(ctx context.Context, id int64) error
	RenameChannel(ctx context.Context, id int64, newName string) error
	SetChannelPermissions(ctx context.Context, id int64, permissions int) error
	SetChannelPrivate(ctx context.Context, id int64, private bool) error
	SetChannelTopic(ctx context.Context, id int64, topic *string) error
	SetChannelParent(ctx context.Context, id int64, parent *int64) error
	SetChannelParentBulk(ctx context.Context, id []int64, parent *int64) error
	SetLastMessage(ctx context.Context, id, lastMessage int64) error
	AdjustMessageCount(ctx context.Context, id, delta int64) error
	ReserveMessagePositions(ctx context.Context, id, count int64) (int64, error)
	UpdateChannel(ctx context.Context, id int64, parent *int64, private *bool, name, topic *string, closed *bool) (model.Channel, error)
	SetChannelVoiceRegion(ctx context.Context, id int64, region *string) error
	GetChannelVoiceRegion(ctx context.Context, id int64) (*string, error)
}

func New

func New(c *sqlx.DB) Channel

type Entity

type Entity struct {
	// contains filtered or unexported fields
}

func (*Entity) AdjustMessageCount added in v1.8.0

func (e *Entity) AdjustMessageCount(ctx context.Context, id, delta int64) error

func (*Entity) CreateChannel

func (e *Entity) CreateChannel(ctx context.Context, id int64, name string, channelType model.ChannelType, parent *int64, permissions *int64, private bool) error

func (*Entity) DeleteChannel

func (e *Entity) DeleteChannel(ctx context.Context, id int64) error

func (*Entity) GetChannel

func (e *Entity) GetChannel(ctx context.Context, id int64) (model.Channel, error)

func (*Entity) GetChannelMessagePosition added in v1.8.0

func (e *Entity) GetChannelMessagePosition(ctx context.Context, id int64) (int64, error)

func (*Entity) GetChannelThreads

func (e *Entity) GetChannelThreads(ctx context.Context, channelId int64) ([]model.Channel, error)

func (*Entity) GetChannelVoiceRegion added in v1.5.0

func (e *Entity) GetChannelVoiceRegion(ctx context.Context, id int64) (*string, error)

GetChannelVoiceRegion returns preferred SFU region if set

func (*Entity) GetChannelsBulk

func (e *Entity) GetChannelsBulk(ctx context.Context, ids []int64) ([]model.Channel, error)

func (*Entity) RenameChannel

func (e *Entity) RenameChannel(ctx context.Context, id int64, newName string) error

func (*Entity) ReserveMessagePositions added in v1.8.0

func (e *Entity) ReserveMessagePositions(ctx context.Context, id, count int64) (int64, error)

func (*Entity) SetChannelParent

func (e *Entity) SetChannelParent(ctx context.Context, id int64, parent *int64) error

func (*Entity) SetChannelParentBulk

func (e *Entity) SetChannelParentBulk(ctx context.Context, id []int64, parent *int64) error

func (*Entity) SetChannelPermissions

func (e *Entity) SetChannelPermissions(ctx context.Context, id int64, permissions int) error

func (*Entity) SetChannelPrivate

func (e *Entity) SetChannelPrivate(ctx context.Context, id int64, private bool) error

func (*Entity) SetChannelTopic

func (e *Entity) SetChannelTopic(ctx context.Context, id int64, topic *string) error

func (*Entity) SetChannelVoiceRegion added in v1.5.0

func (e *Entity) SetChannelVoiceRegion(ctx context.Context, id int64, region *string) error

SetChannelVoiceRegion sets preferred SFU region for a voice channel (nullable)

func (*Entity) SetLastMessage

func (e *Entity) SetLastMessage(ctx context.Context, id, lastMessage int64) error

func (*Entity) UpdateChannel

func (e *Entity) UpdateChannel(ctx context.Context, id int64, parent *int64, private *bool, name, topic *string, closed *bool) (model.Channel, error)

Jump to

Keyboard shortcuts

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