models

package
v0.0.0-...-80b2b3e Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const ClientMessageTypeSubscribe string = "subscribe"
View Source
const ClientMessageTypeUnsubscribe string = "unsubscribe"
View Source
const SysMessageHello sysMessage = "hello"
View Source
const SysMessageSubscribed sysMessage = "subscribed"
View Source
const SysMessageUnknownCommand sysMessage = "unknown_command"
View Source
const SysMessageUnsubscribed sysMessage = "unsubscribed"

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicMessage

type BasicMessage struct {
	Event EventType   `json:"event"`
	Data  interface{} `json:"data"`
}

func (BasicMessage) GetEvent

func (bm BasicMessage) GetEvent() EventType

type ClientMessage

type ClientMessage interface{}

type ClientMessageSubscribe

type ClientMessageSubscribe struct {
	Channels []string
}

type ClientMessageUnsubscribe

type ClientMessageUnsubscribe struct {
	Channels []string
}

type EventType

type EventType string
const (
	EventTypeBlock          EventType = "blocks"
	EventTypeOperation      EventType = "operations"
	EventTypeAccountCreated EventType = "account_created_at"
	EventTypeInfo           EventType = "info"
	EventTypeMempool        EventType = "mempool"
	EventTypeAssetOperation EventType = "asset_operations"
)

type MessageInterface

type MessageInterface interface {
	GetEvent() EventType
}

type PublicMessageInterface

type PublicMessageInterface interface {
	GetChannel() string
	GetEvent() EventType
}

type SystemMessage

type SystemMessage struct {
	Message     sysMessage `json:"msg"`
	Description string     `json:"description"`
}

func (SystemMessage) GetEvent

func (sm SystemMessage) GetEvent() EventType

Jump to

Keyboard shortcuts

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