dispenser

package
v0.0.0-...-765903b Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const BufSz = 25
View Source
const PoolBuf = 5
View Source
const TypingTimeout = 10 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	MessagePool templates.Messages
	MessageMu   sync.Mutex
	LastAuthor  *discord.User

	Typers   *templates.Typing
	Typing   chan *gateway.TypingStartEvent
	StopType chan discord.User // userID

	Session   *state.State
	ChannelID discord.ChannelID
	GuildID   discord.GuildID

	ClientPool map[uint64]chan<- templates.Renderer
	ClientMu   sync.RWMutex
	Counter    uint64
	// contains filtered or unexported fields
}

func Initialize

func Initialize(s *state.State, channelID discord.ChannelID) (*State, error)

func (*State) AddMessage

func (s *State) AddMessage(m discord.Message)

func (*State) Broadcast

func (s *State) Broadcast(r templates.Renderer)

func (*State) Close

func (s *State) Close() error

func (*State) CopyPool

func (s *State) CopyPool() templates.Messages

func (*State) DeleteMessage

func (s *State) DeleteMessage(id discord.MessageID)

func (*State) EditMessage

func (s *State) EditMessage(m discord.Message)

func (*State) Handler

func (s *State) Handler(w http.ResponseWriter, r *http.Request) (int, error)

func (*State) RegisterWriter

func (s *State) RegisterWriter(w io.Writer, ctx context.Context) (int, error)

func (*State) StopTyping

func (s *State) StopTyping(user discord.User)

Jump to

Keyboard shortcuts

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