cliapp

package
v0.0.0-...-35f1774 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListThings

func ListThings(tdList []*td.TD)

Show a list of Thing TDs

func NewCliAppFactory

func NewCliAppFactory(f api.IModuleFactory, modDef *api.ModuleDefinition) (api.IHiveModule, error)

Factory function for the cli app

Types

type CliApp

type CliApp struct {
	// this is a consumer for chaining modules. Don't use it directly.
	*consumer.Consumer
	// contains filtered or unexported fields
}

The CLI App has a module wrapper so it can be used as part of the module chain

func NewCliApp

func NewCliApp(config CliAppConfig, discoClient discovery.IDiscoveryClient,
	dirClient directory.IDirectoryClient, caCert *x509.Certificate) *CliApp

Create a new instance of the CLI app FIXME: where does it get discoClient and dirClient?

option1: use the chain, eg send request
option2: use parameters, pass directly

func (*CliApp) ListDir

func (app *CliApp) ListDir()

Show the content of a remote directory This first discovers the directory then attempts to read it.

func (*CliApp) ShowDiscovery

func (app *CliApp) ShowDiscovery()

discover things and directories on the network

if readDir is true then try to read the directory content/hivekit/go/examples/wotco"

func (*CliApp) ShowStatus

func (app *CliApp) ShowStatus(thingID string, subscribe bool)

Show the status of a Thing

The thing must have published its TD using discovery.

thingID whose status to show
subscribe to property updates and events

func (*CliApp) ShowTD

func (app *CliApp) ShowTD(thingID string)

Display the TD of a discovered Thing

func (*CliApp) Subscribe

func (app *CliApp) Subscribe(thingID string)

subscribe to events and observe properties

type CliAppConfig

type CliAppConfig struct {
	// Do not start with discovery
	NoDisco bool
	// Subscribe to events or property
	Subscribe bool
	// Show more detailed output
	Verbose bool
}

Jump to

Keyboard shortcuts

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