device

package
v1.2.2-dev.41 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceAdder

type DeviceAdder interface {
	AddDevice(d contract.Device, commands []contract.Command) (string, error)
	DeviceProfileLoader
	DeviceServiceLoader
}

type DeviceAllExecutor

type DeviceAllExecutor interface {
	Execute() ([]contract.Device, error)
}

type DeviceCreator

type DeviceCreator interface {
	Execute() (id string, err error)
}

func NewAddDevice

func NewAddDevice(ch chan DeviceEvent, db DeviceAdder, new contract.Device) DeviceCreator

type DeviceEvent

type DeviceEvent struct {
	DeviceId           string
	DeviceName         string
	Error              error
	HttpMethod         string
	ServiceId          string
	SecondaryServiceId string
}

type DeviceLoader

type DeviceLoader interface {
	GetAllDevices() ([]contract.Device, error)
	GetDevicesByProfileId(pid string) ([]contract.Device, error)
}

type DeviceProfileLoader

type DeviceProfileLoader interface {
	GetDeviceProfileById(id string) (contract.DeviceProfile, error)
	GetDeviceProfileByName(n string) (contract.DeviceProfile, error)
}

type DeviceServiceLoader

type DeviceServiceLoader interface {
	GetDeviceServiceById(id string) (contract.DeviceService, error)
	GetDeviceServiceByName(n string) (contract.DeviceService, error)
}

type DeviceUpdateExecutor

type DeviceUpdateExecutor interface {
	Execute() (err error)
}

type DeviceUpdater

type DeviceUpdater interface {
	UpdateDevice(d contract.Device) error
	GetDeviceById(id string) (contract.Device, error)
	GetDeviceByName(name string) (contract.Device, error)
	DeviceProfileLoader
	DeviceServiceLoader
}

type Notifier

type Notifier interface {
	// Execute performs the main logic of the Notifier implementation.
	// This function is meant to be called from a goroutine, thus log eny errors and do not return them.
	Execute()
}

type ProfileIdExecutor

type ProfileIdExecutor interface {
	Execute() ([]contract.Device, error)
}

ProfileIdExecutor provides functionality for loading devices by way of the operator pattern.

func NewProfileIdExecutor

func NewProfileIdExecutor(cfg bootstrapConfig.ServiceInfo, db DeviceLoader, log logger.LoggingClient, profile string) ProfileIdExecutor

NewProfileIdExecutor creates a new ProfileIdExecutor

type RequestType

type RequestType int
const (
	Mock RequestType = 0
	Http RequestType = 1
)

type Requester

type Requester interface {
	// Execute will invoke the supplied request. I'm not thrilled about providing the extra parameter here, but it
	// follows from the net/http/Client.Do(req *Request) from the Go std lib. That is, I don't know the actual request
	// to be performed until runtime and if I am to mock this properly, I don't know the request at the time of
	// injection.
	Execute(req *http.Request)
}

func NewRequester

func NewRequester(key RequestType, logger logger.LoggingClient, ctx context.Context) (r Requester, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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