client

package
v0.0.0-...-d942e53 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const WS_CLOSED = "WS_CLOSED"

Variables

This section is empty.

Functions

func HasStatus

func HasStatus(results []Result, status Status) bool

func Init

func Init(handle_command CommandHandler, progress_chan chan string)

func OpenWebsocket

func OpenWebsocket(store2 Store, port string)

func PrintResults

func PrintResults(results []Result, err error)

PrintResults prints the results to the console

Types

type CommandHandler

type CommandHandler func(command string) string

type Response

type Response struct {
	Results *[]Result
	Error   *string
}

type Result

type Result struct {
	Status  Status
	Message *string
}

type Status

type Status int
const (
	Unknown Status = iota
	Error
	Warning
	Success
	Info
	Confirmation
)

func (Status) MarshalJSON

func (s Status) MarshalJSON() ([]byte, error)

MarshalJSON must be a *value receiver* to ensure that a Suit on a parent object does not have to be a pointer in order to have it correctly marshaled.

func (Status) String

func (s Status) String() string

String allows Suit to implement fmt.Stringer

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON must be a *pointer receiver* to ensure that the indirect from the parsed value can be set on the unmarshaling object. This means that the ParseSuit function must return a *value* and not a pointer.

type Store

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

Store is

func New

func New(source *string, driver *string, verbose *bool, debug *bool) *Store

New is

func (Store) Connect

func (store Store) Connect() error

Connect is

func (Store) Handle

func (store Store) Handle(parameters map[string]interface{}, command string, subcommands ...string) ([]Result, error)

Handle is

func (Store) Label

func (store Store) Label() string

Label is

func (Store) Request

func (store Store) Request(request []byte) (response []byte)

Jump to

Keyboard shortcuts

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