instance

package
v0.0.0-...-482b64a Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserOpener

type BrowserOpener interface {
	Open(url string) error
}

type BrowserOpenerFunc

type BrowserOpenerFunc func(url string) error

func (BrowserOpenerFunc) Open

func (f BrowserOpenerFunc) Open(url string) error

type DefaultFactory

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

func NewDefaultFactory

func NewDefaultFactory(
	sdk SDK,
	executor Executor,
	browserOpener BrowserOpener,
	imageReader ImageReader,
) *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,
	browserOpener BrowserOpener,
	imageReader ImageReader,
) *DefaultInstance

func (*DefaultInstance) BrowserOpener

func (i *DefaultInstance) BrowserOpener() BrowserOpener

func (*DefaultInstance) ContextID

func (i *DefaultInstance) ContextID() string

func (*DefaultInstance) ExecuteSingleRequest

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

func (*DefaultInstance) Executor

func (i *DefaultInstance) Executor() Executor

func (*DefaultInstance) HandleResponse

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

func (*DefaultInstance) ImageReader

func (i *DefaultInstance) ImageReader() ImageReader

func (*DefaultInstance) KeyPressed

func (i *DefaultInstance) KeyPressed(ctx context.Context) 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(parent context.Context)

func (*DefaultInstance) Stop

func (i *DefaultInstance) Stop()

type Executor

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

type Factory

type Factory interface {
	Create(ctxID string) Instance
}

type ImageReader

type ImageReader interface {
	ReadFile(filename string) ([]byte, error)
}

type ImageReaderFunc

type ImageReaderFunc func(filename string) ([]byte, error)

func (ImageReaderFunc) ReadFile

func (f ImageReaderFunc) ReadFile(filename string) ([]byte, error)

type Instance

type Instance interface {
	SetConfig(payload *fastjson.Value) error
	StartAsync(ctx context.Context)
	Stop()
	KeyPressed(ctx context.Context) 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(ctx context.Context, ctxId string) error

func (*Manager) SetInstanceConfig

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

func (*Manager) StartAsync

func (m *Manager) StartAsync(ctx context.Context, 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