kit

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const IotEndpoint = "iot.farmhub.ag"

Variables

This section is empty.

Functions

func GetKitNames

func GetKitNames() []string

GetKitNames returns a list of available kit names to be used in lists and interactive menus

Types

type AquaponicsKitV1 added in v1.3.0

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

func (*AquaponicsKitV1) GenerateCode added in v1.5.0

func (e *AquaponicsKitV1) GenerateCode(project *model.Project, sensor *model.Sensor) (string, error)

func (*AquaponicsKitV1) Init added in v1.3.0

func (e *AquaponicsKitV1) Init() error

func (*AquaponicsKitV1) Monitor added in v1.3.0

func (e *AquaponicsKitV1) Monitor(ctx context.Context) error

func (*AquaponicsKitV1) Name added in v1.5.0

func (e *AquaponicsKitV1) Name() string

func (*AquaponicsKitV1) SetPath added in v1.3.0

func (e *AquaponicsKitV1) SetPath(path string) error

func (*AquaponicsKitV1) SetPort added in v1.3.0

func (e *AquaponicsKitV1) SetPort(port string)

func (*AquaponicsKitV1) Upload added in v1.3.0

func (e *AquaponicsKitV1) Upload() error

type HydroponicsKitV2 added in v1.3.0

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

func (*HydroponicsKitV2) GenerateCode added in v1.5.0

func (e *HydroponicsKitV2) GenerateCode(project *model.Project, sensor *model.Sensor) (string, error)

func (*HydroponicsKitV2) Init added in v1.3.0

func (e *HydroponicsKitV2) Init() error

func (*HydroponicsKitV2) Monitor added in v1.3.0

func (e *HydroponicsKitV2) Monitor(ctx context.Context) error

func (*HydroponicsKitV2) Name added in v1.5.0

func (e *HydroponicsKitV2) Name() string

func (*HydroponicsKitV2) SetPath added in v1.3.0

func (e *HydroponicsKitV2) SetPath(path string) error

func (*HydroponicsKitV2) SetPort added in v1.3.0

func (e *HydroponicsKitV2) SetPort(port string)

func (*HydroponicsKitV2) Upload added in v1.3.0

func (e *HydroponicsKitV2) Upload() error

type Kit

type Kit interface {
	// The name of the kit, used to create one if doesnt exist
	Name() string

	// SetPort specifies where it should be operating when flashing and monitoring
	SetPort(port string)

	// SetPath specifies the path to the sketch to be flashed
	SetPath(path string) error

	// Init initializes the kit, installing libraries and other dependencies
	Init() error

	// Upload flashes the sketch to the specified port
	Upload() error

	// GenerateCode generates the code necessary for this kit
	GenerateCode(project *model.Project, sensor *model.Sensor) (string, error)

	// Monitor starts monitoring the specified port
	Monitor(ctx context.Context) error
}

func GetKitByName

func GetKitByName(name string) Kit

GetKitByName returns a new kit instance by its name

func NewAquaponicsKitV1 added in v1.3.0

func NewAquaponicsKitV1() Kit

func NewHydroponicsKitV2 added in v1.3.0

func NewHydroponicsKitV2() Kit

type KitConstructor

type KitConstructor func() Kit

KitConstructor is a function that returns a new Kit and allows them to be registered in the map below without initializing them immediately

Jump to

Keyboard shortcuts

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