Documentation ¶
Overview ¶
Package types contains the interface and concrete types used for interoperability within all of the modules of muscadine. Wherever possible, we do not rely on a specific implementation of functionality, but rather an interface. Having a separate package that defines those interfaces makes importing them anywhere within the codebase simpler (avoids weird circular imports).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive interface { Last(n int) []*arbor.ChatMessage Needed(n int) []string Has(id string) bool Get(id string) *arbor.ChatMessage Root() (string, error) Add(message *arbor.ChatMessage) error Persist(storage io.Writer) error Load(storage io.Reader) error }
Archive stores and retrieves messages
type Client ¶
type Client interface { Composer Archive Connection }
Client manages the connection between a TUI and a specific server
type Connection ¶
type Connection interface { OnDisconnect(handler func(Connection)) OnReceive(handler func(*arbor.ChatMessage)) Connect() error Disconnect() error }
Connection models a live connection to a server
type UI ¶
type UI interface { Display(*arbor.ChatMessage) // adds a chat message to the UI AwaitExit() // blocks until UI exit }
UI is all of the operations that an Arbor client front-end needs to support in order to be a drop-in replacement for the default.