Documentation ¶
Overview ¶
The Airdispatch Server framework provides a simple way to create an Airdispatch server.
It defines a common protocol that allows the common code to function without worrying about the storage mechanism of Airdispatch primatives.
Index ¶
Constants ¶
View Source
const ( Reset = "\x1b[0m" Bright = "\x1b[1m" Dim = "\x1b[2m" Underscore = "\x1b[4m" Blink = "\x1b[5m" Reverse = "\x1b[7m" Hidden = "\x1b[8m" FgBlack = "\x1b[30m" FgRed = "\x1b[31m" FgGreen = "\x1b[32m" FgYellow = "\x1b[33m" FgBlue = "\x1b[34m" FgMagenta = "\x1b[35m" FgCyan = "\x1b[36m" FgWhite = "\x1b[37m" BgBlack = "\x1b[40m" BgRed = "\x1b[41m" BgGreen = "\x1b[42m" BgYellow = "\x1b[43m" BgBlue = "\x1b[44m" BgMagenta = "\x1b[45m" BgCyan = "\x1b[46m" BgWhite = "\x1b[47m" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicServer ¶
type BasicServer struct {
ServerDelegate
}
func (BasicServer) HandleError ¶
func (BasicServer) HandleError(err *ServerError)
func (BasicServer) LogMessage ¶
func (BasicServer) LogMessage(toLog ...string)
type Handler ¶
type MessageDescription ¶
type MessageDescription struct { Name string Location string Nonce uint64 // contains filtered or unexported fields }
func CreateMessageDescription ¶
func CreateMessageDescriptionFromBytes ¶
func CreateMessageDescriptionFromBytes(by []byte, h message.Header) (*MessageDescription, error)
func (*MessageDescription) GenerateTransferRequest ¶
func (m *MessageDescription) GenerateTransferRequest() *TransferMessage
func (*MessageDescription) Header ¶
func (m *MessageDescription) Header() message.Header
func (*MessageDescription) ToBytes ¶
func (m *MessageDescription) ToBytes() []byte
func (*MessageDescription) Type ¶
func (m *MessageDescription) Type() string
type MessageList ¶
type MessageList struct { Length uint64 // contains filtered or unexported fields }
--- Multi-Messages ---
func CreateMessageList ¶
func CreateMessageList(from *identity.Address, to *identity.Address) *MessageList
func CreateMessageListFromBytes ¶
func CreateMessageListFromBytes(b []byte, h message.Header) (*MessageList, error)
func (*MessageList) Header ¶
func (m *MessageList) Header() message.Header
func (*MessageList) ToBytes ¶
func (m *MessageList) ToBytes() []byte
func (*MessageList) Type ¶
func (m *MessageList) Type() string
type Server ¶
type Server struct { LocationName string Key *identity.Identity Delegate ServerDelegate Handlers []Handler Router routing.Router // Control Channels Start chan bool Quit chan bool }
The server structure tahat holds all of the necessary instance variables
type ServerDelegate ¶
type ServerDelegate interface { HandleError(err *ServerError) LogMessage(toLog ...string) SaveMessageDescription(desc *message.EncryptedMessage) RetrieveDataForUser(id string, author *identity.Address, forAddr *identity.Address) (*message.EncryptedMessage, io.ReadCloser) RetrieveMessageForUser(id string, author *identity.Address, forAddr *identity.Address) *message.EncryptedMessage RetrieveMessageListForUser(since uint64, author *identity.Address, forAddr *identity.Address) []*message.EncryptedMessage }
This interface defines the functions that an Airdispatch server must respond to in order to properly function
type ServerError ¶
A structure that stores any errors generated by the Server framework
type TransferMessage ¶
type TransferMessage struct { Name string Author *identity.Address Data bool // contains filtered or unexported fields }
func CreateTransferMessage ¶
func CreateTransferMessageFromBytes ¶
func CreateTransferMessageFromBytes(by []byte, h message.Header) (*TransferMessage, error)
func (*TransferMessage) Header ¶
func (m *TransferMessage) Header() message.Header
func (*TransferMessage) ToBytes ¶
func (m *TransferMessage) ToBytes() []byte
func (*TransferMessage) Type ¶
func (m *TransferMessage) Type() string
type TransferMessageList ¶
type TransferMessageList struct { Author *identity.Address Since uint64 // contains filtered or unexported fields }
func CreateTransferMessageList ¶
func CreateTransferMessageListFromBytes ¶
func CreateTransferMessageListFromBytes(by []byte, h message.Header) (*TransferMessageList, error)
func (*TransferMessageList) Header ¶
func (m *TransferMessageList) Header() message.Header
func (*TransferMessageList) ToBytes ¶
func (m *TransferMessageList) ToBytes() []byte
func (*TransferMessageList) Type ¶
func (m *TransferMessageList) Type() string
Click to show internal directories.
Click to hide internal directories.