runtime

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiDebugRoute     = common.ApiBase + "/debug"
	ApiDebugLogging   = common.ApiBase + "/logging"
	ApiDiscoveryRoute = common.ApiBase + "/device/discovery"

	ApiHookOnStreamNotFoundRoute   = common.ApiBase + "/hook/on_stream_not_found"
	ApiHookOnStreamNoneReaderRoute = common.ApiBase + "/hook/on_stream_none_reader"
)
View Source
const (
	CustomizedServerPort = ":9999"
)

Variables

This section is empty.

Functions

func GroupRequestByCategory added in v1.1.0

func GroupRequestByCategory(reqs []sdkmodels.CommandRequest) ([]contracts.ReadRequest, []contracts.CallRequest, error)

func Reporter added in v1.1.0

func Reporter() interfaces.Reporter

func Startup

func Startup(name string, version string, proto interface{}, opts ...Option)

func StatusManager

func StatusManager() interfaces.StatusManager

Types

type Agent

type Agent struct {

	// if the driver is in strict mode, any error in request will be returned, ignored otherwise.
	StrictMode bool
	// now only the decision of 'ConsecutiveErrorNum' can be used
	OfflineDecision status.OfflineDecision
	// if no StatusManager is specified, a default one will be initialized
	StatusManager interfaces.StatusManager
	// contains filtered or unexported fields
}

func (*Agent) AddDevice

func (a *Agent) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, _ models.AdminState) error

func (*Agent) HandleAsyncResults

func (a *Agent) HandleAsyncResults(ctx context.Context, wg *sync.WaitGroup)

func (*Agent) HandleReadCommands

func (a *Agent) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties,
	reqs []sdkmodels.CommandRequest) ([]*sdkmodels.CommandValue, error)

func (*Agent) HandleWriteCommands

func (a *Agent) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties,
	reqs []sdkmodels.CommandRequest, params []*sdkmodels.CommandValue) (err error)

func (*Agent) Initialize

func (a *Agent) Initialize(_ lc.LoggingClient, asyncCh chan<- *sdkmodels.AsyncValues,
	deviceCh chan<- []sdkmodels.DiscoveredDevice) error

func (*Agent) PostProcessDevice added in v1.1.0

func (a *Agent) PostProcessDevice(device *contracts.Device, err error)

func (*Agent) PostProcessRequests added in v1.1.1

func (a *Agent) PostProcessRequests(deviceName string, reqs interface{}, write bool, cvs *[]*sdkmodels.CommandValue) error

func (*Agent) RegisterRoutes added in v1.1.4

func (a *Agent) RegisterRoutes() error

func (*Agent) RemoveDevice

func (a *Agent) RemoveDevice(deviceName string, protocols map[string]models.ProtocolProperties) error

func (*Agent) ReportEvent

func (a *Agent) ReportEvent(event *contracts.AsyncValues) error

func (*Agent) Stop

func (a *Agent) Stop(force bool) error

func (*Agent) UpdateDevice

func (a *Agent) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, _ models.AdminState) error

type Option

type Option func(agent *Agent)

type Route

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

Jump to

Keyboard shortcuts

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