command

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: EPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Command     string
	ContentType string
	Payload     *bytes.Buffer
}

type NoopReader

type NoopReader struct {
}

func (*NoopReader) Read

func (_ *NoopReader) Read(ctx context.Context, deviceId string) *Command

func (*NoopReader) Start

func (_ *NoopReader) Start() error

func (*NoopReader) Stop

func (_ *NoopReader) Stop() error

type OnDemandReader

type OnDemandReader struct {
	CommandName string
	Stream      io.Reader
	Prompt      io.Writer
	Encoder     encoding.PayloadEncoder
	// contains filtered or unexported fields
}

func (*OnDemandReader) Read

func (r *OnDemandReader) Read(ctx context.Context, _ string) *Command

func (*OnDemandReader) Start

func (r *OnDemandReader) Start() error

func (*OnDemandReader) Stop

func (r *OnDemandReader) Stop() error

type PreFillReader

type PreFillReader struct {
	CommandName string
	Stream      io.Reader
	Prompt      io.Writer
	Encoder     encoding.PayloadEncoder
	// contains filtered or unexported fields
}

func (*PreFillReader) Read

func (r *PreFillReader) Read(ctx context.Context, _ string) *Command

func (*PreFillReader) Start

func (r *PreFillReader) Start() error

func (*PreFillReader) Stop

func (r *PreFillReader) Stop() error

type Reader

type Reader interface {
	Start() error
	Stop() error

	Read(ctx context.Context, deviceId string) *Command
}

func GetReader

func GetReader() Reader

type StaticReader added in v0.5.0

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

func NewStatic added in v0.5.0

func NewStatic(commandName string, encoder encoding.PayloadEncoder, payload string) (*StaticReader, error)

func (*StaticReader) Read added in v0.5.0

func (s *StaticReader) Read(_ context.Context, _ string) *Command

func (*StaticReader) Start added in v0.5.0

func (_ *StaticReader) Start() error

func (*StaticReader) Stop added in v0.5.0

func (_ *StaticReader) Stop() error

Jump to

Keyboard shortcuts

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