instance

package
v0.0.0-...-2465acf Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultFactory

type DefaultFactory struct {
	Executor Executor
	// contains filtered or unexported fields
}

func NewDefaultFactory

func NewDefaultFactory(
	sdk SDK,
	executor Executor,
) *DefaultFactory

func (*DefaultFactory) Create

func (f *DefaultFactory) Create(ctxID string) Instance

type DefaultInstance

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

func NewInstance

func NewInstance(
	ctxID string,
	executor Executor,
	sdk SDK,
) *DefaultInstance

func (*DefaultInstance) ContextID

func (i *DefaultInstance) ContextID() string

func (*DefaultInstance) ExecuteSingleRequest

func (i *DefaultInstance) ExecuteSingleRequest(
	ctx context.Context,
)

func (*DefaultInstance) Executor

func (i *DefaultInstance) Executor() Executor

func (*DefaultInstance) HandleResponse

func (i *DefaultInstance) HandleResponse(
	ctx context.Context,
	response *executor.ExecuteResponse,
) error

func (*DefaultInstance) KeyPressed

func (i *DefaultInstance) KeyPressed() error

func (*DefaultInstance) SDK

func (i *DefaultInstance) SDK() SDK

func (*DefaultInstance) SetConfig

func (i *DefaultInstance) SetConfig(payload *fastjson.Value) error

func (*DefaultInstance) ShowAlert

func (i *DefaultInstance) ShowAlert()

func (*DefaultInstance) ShowOk

func (i *DefaultInstance) ShowOk()

func (*DefaultInstance) StartAsync

func (i *DefaultInstance) StartAsync()

func (*DefaultInstance) Stop

func (i *DefaultInstance) Stop()

type Executor

type Executor interface {
	Execute(
		ctx context.Context,
		executeReq executor.ExecuteRequest,
	) (*executor.ExecuteResponse, error)
}

type Factory

type Factory interface {
	Create(ctxID string) Instance
}

type Instance

type Instance interface {
	SetConfig(payload *fastjson.Value) error
	StartAsync()
	Stop()
	KeyPressed() error
}

type Manager

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

func NewManager

func NewManager(
	factory Factory,
) *Manager

func (*Manager) InitInstance

func (m *Manager) InitInstance(ctxId string) (Instance, error)

func (*Manager) KeyPressed

func (m *Manager) KeyPressed(ctxId string) error

func (*Manager) SetInstanceConfig

func (m *Manager) SetInstanceConfig(
	ctxId string,
	payload *fastjson.Value,
) error

func (*Manager) StartAsync

func (m *Manager) StartAsync(ctxId string) error

func (*Manager) Stop

func (m *Manager) Stop(ctxId string) error

type SDK

type SDK interface {
	ShowAlert(ctxID string)
	ShowOk(ctxID string)
	SetTitle(ctxID string, title string, target int)
	SetImage(ctxID string, imageData string, target int)
}

Jump to

Keyboard shortcuts

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