gmclient

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InsertOperation is the insert value
	InsertOperation = "insert"
	// DeleteOperation is the delete value
	DeleteOperation = "delete"
	// StatusOperation is the status value
	StatusOperation = "status"
)
View Source
const (
	// RetryCount is count of retrying to connecting to global manager
	RetryCount = 5
	// RetryConnectIntervalSeconds is interval time of retrying to connecting to global manager
	RetryConnectIntervalSeconds = 5
	// MessageChannelCacheSize is size of channel cache
	MessageChannelCacheSize = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientI

type ClientI interface {
	Start() error
	WriteMessage(messageBody interface{}, messageHeader MessageHeader) error
	Subscribe(m MessageResourceHandler) error
}

func NewWebSocketClient

func NewWebSocketClient(options *options.LocalControllerOptions) ClientI

NewWebSocketClient creates client

type Input added in v0.3.1

type Input struct {
	Models       []Model `json:"models,omitempty"`
	DataURL      string  `json:"dataURL,omitempty"`
	DataIndexURL string  `json:"dataIndexURL,omitempty"`
	OutputDir    string  `json:"outputDir,omitempty"`
}

type Message

type Message struct {
	Header  MessageHeader `json:"header"`
	Content []byte        `json:"content"`
}

Message defines message between LC and GM

type MessageHeader

type MessageHeader = messagetypes.MessageHeader

MessageHeader defines the header between LC and GM

type MessageResourceHandler

type MessageResourceHandler interface {
	GetName() string
	Insert(*Message) error
	Delete(*Message) error
}

type Model added in v0.3.1

type Model = runtime.Model

type Output added in v0.3.1

type Output struct {
	// All the TaskInfo has been written to "Model"
	Models    []map[string]interface{} `json:"models"`
	OwnerInfo map[string]interface{}   `json:"ownerInfo"`
}

type UpstreamMessage added in v0.3.1

type UpstreamMessage struct {
	Phase  string  `json:"phase"`
	Status string  `json:"status"`
	Input  *Input  `json:"input,omitempty"`
	Output *Output `json:"output"`
}

UpstreamMessage defines send message content to GM

type WSConnection

type WSConnection struct {
	WSConn *websocket.Conn
}

WSConnection defines conn

Jump to

Keyboard shortcuts

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