comm

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagerSocket

func GetSwagerSocket() (string, error)

Types

type BlockInitializationError

type BlockInitializationError struct {
	Name string
	// contains filtered or unexported fields
}

func (*BlockInitializationError) Error

func (e *BlockInitializationError) Error() string

func (*BlockInitializationError) Unwrap

func (e *BlockInitializationError) Unwrap() error

type BlockNotFoundError

type BlockNotFoundError struct {
	Name string
}

func (*BlockNotFoundError) Error

func (e *BlockNotFoundError) Error() string

type ControlArgs

type ControlArgs struct {
	Command ServerControl
	Args    []string
}

type InitBlockArgs

type InitBlockArgs struct {
	Tag   string
	Block string
	Args  []string
}

type Reply

type Reply struct {
	Args    SwagerArgs
	Success bool
}

type SendToTagArgs

type SendToTagArgs struct {
	Tag  string
	Args []string
}

type ServerConfig

type ServerConfig struct {
	Blocks core.BlockRegistry
	Ctrl   chan<- *ControlArgs
	Log    core.LogChannel
}

type ServerControl

type ServerControl int8
const (
	PingServer  ServerControl = 0
	RunServer   ServerControl = 1
	ResetServer ServerControl = 2
	ExitServer  ServerControl = math.MaxInt8
)

type SetTagLogArgs

type SetTagLogArgs struct {
	Tag   string
	Level core.LogLevel
}

type Swager

type Swager struct {
	Client *ipc.Client
	Sub    *ipc.Subscription
	// contains filtered or unexported fields
}

func CreateServer

func CreateServer(cfg *ServerConfig, opts *core.Options) (*Swager, error)

func (*Swager) Control

func (s *Swager) Control(args *ControlArgs, reply *Reply) error

func (*Swager) InitBlock

func (s *Swager) InitBlock(args *InitBlockArgs, reply *Reply) error

func (*Swager) SendToTag

func (s *Swager) SendToTag(args *SendToTagArgs, reply *Reply) error

func (*Swager) SetTagLog

func (s *Swager) SetTagLog(args *SetTagLogArgs, reply *Reply) error

type SwagerArgs

type SwagerArgs interface {
}

func ToInitBlockArgs

func ToInitBlockArgs(tl stoker.TokenList) (SwagerArgs, error)

func ToSendToTagArgs

func ToSendToTagArgs(tl stoker.TokenList) (SwagerArgs, error)

func ToServerArgs

func ToServerArgs(tl stoker.TokenList) (SwagerArgs, error)

func ToSetTagLogArgs

func ToSetTagLogArgs(tl stoker.TokenList) (SwagerArgs, error)

type SwagerMethod

type SwagerMethod string
const (
	InitBlock SwagerMethod = "Swager.InitBlock"
	SendToTag SwagerMethod = "Swager.SendToTag"
	SetTagLog SwagerMethod = "Swager.SetTagLog"
	Control   SwagerMethod = "Swager.Control"
)

func (SwagerMethod) String

func (sm SwagerMethod) String() string

type TagCannotReceiveError

type TagCannotReceiveError struct {
	Tag string
}

func (*TagCannotReceiveError) Error

func (e *TagCannotReceiveError) Error() string

type TagNotFoundError

type TagNotFoundError struct {
	Tag string
}

func (*TagNotFoundError) Error

func (e *TagNotFoundError) Error() string

type TagReceiveError

type TagReceiveError struct {
	Tag string
	// contains filtered or unexported fields
}

func (*TagReceiveError) Error

func (e *TagReceiveError) Error() string

func (*TagReceiveError) Unwrap

func (e *TagReceiveError) Unwrap() error

Jump to

Keyboard shortcuts

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