common

package
v0.0.0-...-0ed3018 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: GPL-2.0, GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode int
const (
	Unavailable ErrorCode = iota
	Timeout
	InternalError
)

type MessageType

type MessageType int
const (
	Request MessageType = iota
	ResponseData
	ResponseError
	Unknown
)

type RequestMessage

type RequestMessage struct {
	WSMessage
	Data string `json:"data"`
}

func NewRequestMessage

func NewRequestMessage(data string) *RequestMessage

type ResponseDataMessage

type ResponseDataMessage struct {
	WSMessage
	Response string `json:"response"`
}

func NewResponseDataMessage

func NewResponseDataMessage(data string) *ResponseDataMessage

func (*ResponseDataMessage) DecodeResponse

func (rm *ResponseDataMessage) DecodeResponse() ([]byte, error)

type ResponseErrorMessage

type ResponseErrorMessage struct {
	WSMessage
	Code ErrorCode `json:"code"`
}

func NewResponseErrorMessage

func NewResponseErrorMessage(code ErrorCode) *ResponseErrorMessage

type SubdomainRequest

type SubdomainRequest struct {
	Subdomain string `json:"subdomain"`
}

type TokenResponse

type TokenResponse struct {
	Subdomain string `json:"subdomain"`
	Token     string `json:"token"`
}

type WSMessage

type WSMessage struct {
	Type string `json:"type"`
}

func (*WSMessage) MessageType

func (w *WSMessage) MessageType() MessageType

Jump to

Keyboard shortcuts

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