extperipheral

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package extperipheral provides helper functions for creating peripheral extensions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(logger log.Interface, unmarshal types.UnmarshalFunc, impl PeripheralConnector) *Handler

func (*Handler) HandleCmd

func (c *Handler) HandleCmd(
	id uint64, kind arhatgopb.CmdType, payload []byte,
) (interface{}, error)

type Peripheral

type Peripheral interface {
	Operate(params map[string]string, data []byte) ([][]byte, error)
	CollectMetrics(params map[string]string) ([]*arhatgopb.PeripheralMetricsMsg_Value, error)
	Close()
}

type PeripheralConnector

type PeripheralConnector interface {
	Connect(target string, params map[string]string, tlsConfig *arhatgopb.TLSConfig) (Peripheral, error)
}

Jump to

Keyboard shortcuts

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