cmd

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

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

func New

func New() (*Cmd, error)

func (*Cmd) AddChannel

func (c *Cmd) AddChannel(sessionID string) (chan *protos.Command, bool)

AddChannel will either add a new channel or return an existing channel; bool indicates if new channel was created.

func (*Cmd) GetChannel

func (c *Cmd) GetChannel(sessionID string) chan *protos.Command

Returns channel or nil if channel not found

func (*Cmd) HaveChannel

func (c *Cmd) HaveChannel(sessionId string) bool

func (*Cmd) RemoveChannel

func (c *Cmd) RemoveChannel(sessionID string) bool

Bool indicates if channel with sessionID exists

type ICmd

type ICmd interface {
	AddChannel(sessionID string) (chan *protos.Command, bool)
	RemoveChannel(sessionID string) bool
	GetChannel(sessionID string) chan *protos.Command
	HaveChannel(sessionID string) bool
}

Jump to

Keyboard shortcuts

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