Documentation ¶
Index ¶
- Constants
- func PrepareMessageForSendingViaSocket(msg *IoMessage) ([]byte, error)
- type IoFogClient
- func (client *IoFogClient) EstablishControlWsConnection(signalBufSize int) <-chan byte
- func (client *IoFogClient) EstablishMessageWsConnection(msgBufSize, receiptBufSize int) (<-chan interface{}, <-chan interface{})
- func (client *IoFogClient) GetConfig() (map[string]interface{}, error)
- func (client *IoFogClient) GetConfigIntoStruct(config interface{}) error
- func (client *IoFogClient) GetMessagesFromPublishersWithinTimeFrame(query *MessagesQueryParameters) (*TimeFrameMessages, error)
- func (client *IoFogClient) GetNextMessages() ([]IoMessage, error)
- func (client *IoFogClient) PostMessage(msg *IoMessage) (*PostMessageResponse, error)
- func (client *IoFogClient) SendMessageViaSocket(msg *IoMessage) error
- type IoMessage
- type MessagesQueryParameters
- type PostMessageResponse
- type TimeFrameMessages
Constants ¶
View Source
const ( IOFOG = "iofog" ID = "id" PORT_IOFOG = 54321 SELFNAME = "SELFNAME" SSL = "SSL" SSL_DEFAULT = false HOST_DEFAULT = "127.0.0.1" URL_GET_CONFIG = "/v2/config/get" URL_GET_NEXT_MESSAGES = "/v2/messages/next" URL_GET_PUBLISHERS_MESSAGES = "/v2/messages/query" URL_POST_MESSAGE = "/v2/messages/new" URL_GET_CONTROL_WS = "/v2/control/socket/id/" URL_GET_MESSAGE_WS = "/v2/message/socket/id/" APPLICATION_JSON = "application/json" HTTP = "http" HTTPS = "https" WS = "ws" WSS = "wss" CODE_ACK = 0xB CODE_CONTROL_SIGNAL = 0xC CODE_MSG = 0xD CODE_RECEIPT = 0xE WS_ATTEMPT_LIMIT = 10 WS_CONNECT_TIMEOUT = time.Second DEFAULT_SIGNAL_BUFFER_SIZE = 5 DEFAULT_MESSAGE_BUFFER_SIZE = 200 DEFAULT_RECEIPT_BUFFER_SIZE = 200 )
View Source
const IOMESSAGE_VERSION = 4
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IoFogClient ¶
type IoFogClient struct {
// contains filtered or unexported fields
}
func NewDefaultIoFogClient ¶
func NewDefaultIoFogClient() (*IoFogClient, error)
func NewIoFogClient ¶
func (*IoFogClient) EstablishControlWsConnection ¶
func (client *IoFogClient) EstablishControlWsConnection(signalBufSize int) <-chan byte
func (*IoFogClient) EstablishMessageWsConnection ¶
func (client *IoFogClient) EstablishMessageWsConnection(msgBufSize, receiptBufSize int) (<-chan interface{}, <-chan interface{})
func (*IoFogClient) GetConfig ¶
func (client *IoFogClient) GetConfig() (map[string]interface{}, error)
func (*IoFogClient) GetConfigIntoStruct ¶
func (client *IoFogClient) GetConfigIntoStruct(config interface{}) error
func (*IoFogClient) GetMessagesFromPublishersWithinTimeFrame ¶
func (client *IoFogClient) GetMessagesFromPublishersWithinTimeFrame(query *MessagesQueryParameters) (*TimeFrameMessages, error)
func (*IoFogClient) GetNextMessages ¶
func (client *IoFogClient) GetNextMessages() ([]IoMessage, error)
func (*IoFogClient) PostMessage ¶
func (client *IoFogClient) PostMessage(msg *IoMessage) (*PostMessageResponse, error)
func (*IoFogClient) SendMessageViaSocket ¶
func (client *IoFogClient) SendMessageViaSocket(msg *IoMessage) error
type IoMessage ¶
type IoMessage struct { ID string `json:"id"` Tag string `json:"tag"` GroupId string `json:"groupid"` SequenceNumber int `json:"sequencenumber"` SequenceTotal int `json:"sequencetotal"` Priority int `json:"priority"` Timestamp int64 `json:"timestamp"` Publisher string `json:"publisher"` AuthID string `json:"authid"` AuthGroup string `json:"authgroup"` Version int `json:"version"` ChainPosition int64 `json:"chainposition"` Hash string `json:"hash"` PreviousHash string `json:"previoushash"` Nonce string `json:"nonce"` DifficultyTarget int `json:"difficultytarget"` InfoType string `json:"infotype"` InfoFormat string `json:"infoformat"` ContextData []byte `json:"contextdata"` ContentData []byte `json:"contentdata"` }
func (*IoMessage) DecodeBinary ¶
func (*IoMessage) EncodeBinary ¶
type MessagesQueryParameters ¶
type PostMessageResponse ¶
type TimeFrameMessages ¶
type TimeFrameMessages getNextMessagesResponse
Click to show internal directories.
Click to hide internal directories.