exosocket

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2017 License: MIT Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host string
	Port string
	Role string
}

Config contains the configuration values for ExoSocket instances

func NewConfigFromEnv

func NewConfigFromEnv() Config

NewConfigFromEnv returns a Config object based on environment variables

type ExoSocket

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

ExoSocket is the low level API to Exocom

func NewExoSocket

func NewExoSocket(config Config, messageBufferSize int) *ExoSocket

NewExoSocket returns an ExoSocket with the given config

func (*ExoSocket) Close

func (e *ExoSocket) Close() error

Close takes this ExoRelay instance offline

func (*ExoSocket) Connect

func (e *ExoSocket) Connect() error

Connect brings an ExoSocket instance online

func (*ExoSocket) GetMessageChannel

func (e *ExoSocket) GetMessageChannel() chan structs.Message

GetMessageChannel returns a channel which can be used read incoming messages

func (*ExoSocket) Send

func (e *ExoSocket) Send(options MessageOptions) (*structs.Message, error)

Send sends a message with the given options

type MessageOptions

type MessageOptions struct {
	Name       string
	Payload    structs.MessagePayload
	ActivityID string
	Auth       structs.MessageAuth
	IsSecurity bool
}

MessageOptions contains the user input values for a message

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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