commands

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CompareACLCmd = CompareACL{
	// contains filtered or unexported fields
}

CompareACLCmd is an initialized CompareACL command for the main() command list

View Source
var DeleteAllCmd = DeleteAll{}
View Source
var DeleteCardCmd = DeleteCard{}
View Source
var GetACLCmd = GetACL{}
View Source
var GetCardCmd = GetCard{}
View Source
var GetCardsCmd = GetCards{}
View Source
var GetDeviceCmd = GetDevice{}
View Source
var GetDevicesCmd = GetDevices{}
View Source
var GetDoorControlCmd = GetDoorControl{}
View Source
var GetDoorDelayCmd = GetDoorDelay{}
View Source
var GetEventCmd = GetEvent{}
View Source
var GetEventIndexCmd = GetEventIndex{}
View Source
var GetEventsCmd = GetEvents{}
View Source
var GetListenerCmd = GetListener{}
View Source
var GetStatusCmd = GetStatus{}
View Source
var GetTimeCmd = GetTime{}
View Source
var GrantCmd = Grant{}
View Source
var ListenCmd = Listen{}
View Source
var LoadACLCmd = LoadACL{
	// contains filtered or unexported fields
}
View Source
var OpenDoorCmd = OpenDoor{}
View Source
var PutCardCmd = PutCard{}
View Source
var RecordSpecialEventsCmd = RecordSpecialEvents{}
View Source
var RevokeCmd = Revoke{}
View Source
var SetAddressCmd = SetAddress{}
View Source
var SetDoorControlCmd = SetDoorControl{}
View Source
var SetDoorDelayCmd = SetDoorDelay{}
View Source
var SetEventIndexCmd = SetEventIndex{}
View Source
var SetListenerCmd = SetListener{}
View Source
var SetTimeCmd = SetTime{}
View Source
var ShowCmd = Show{}
View Source
var VersionCmd = Version{}

VersionCmd is an initialized Version command for the main() command list

Functions

This section is empty.

Types

type Command

type Command interface {
	Execute(context Context) error
	CLI() string
	Description() string
	Usage() string
	Help()
	RequiresConfig() bool
}

Command defines the common functions for CLI command implementations. This will be replaced with the 'uhppoted-api' implementation in a future iteration.

type CompareACL

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

func (*CompareACL) CLI

func (c *CompareACL) CLI() string

func (*CompareACL) Description

func (c *CompareACL) Description() string

func (*CompareACL) Execute

func (c *CompareACL) Execute(ctx Context) error

func (*CompareACL) Help

func (c *CompareACL) Help()

func (*CompareACL) RequiresConfig

func (c *CompareACL) RequiresConfig() bool

Returns true - configuration is not optional for this command to return valid information.

func (*CompareACL) Usage

func (c *CompareACL) Usage() string

type Context

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

Context contains the environment and configuration information required for all commands

func NewContext

func NewContext(u *uhppote.UHPPOTE, c *config.Config) Context

NewContext returns a valid Context initialized with the supplied UHPPOTE and configuration.

type DeleteAll

type DeleteAll struct {
}

func (*DeleteAll) CLI

func (c *DeleteAll) CLI() string

func (*DeleteAll) Description

func (c *DeleteAll) Description() string

func (*DeleteAll) Execute

func (c *DeleteAll) Execute(ctx Context) error

func (*DeleteAll) Help

func (c *DeleteAll) Help()

func (*DeleteAll) RequiresConfig

func (c *DeleteAll) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*DeleteAll) Usage

func (c *DeleteAll) Usage() string

type DeleteCard

type DeleteCard struct {
}

func (*DeleteCard) CLI

func (c *DeleteCard) CLI() string

func (*DeleteCard) Description

func (c *DeleteCard) Description() string

func (*DeleteCard) Execute

func (c *DeleteCard) Execute(ctx Context) error

func (*DeleteCard) Help

func (c *DeleteCard) Help()

func (*DeleteCard) RequiresConfig

func (c *DeleteCard) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*DeleteCard) Usage

func (c *DeleteCard) Usage() string

type GetACL

type GetACL struct {
}

func (*GetACL) CLI

func (c *GetACL) CLI() string

func (*GetACL) Description

func (c *GetACL) Description() string

func (*GetACL) Execute

func (c *GetACL) Execute(ctx Context) error

func (*GetACL) Help

func (c *GetACL) Help()

func (*GetACL) RequiresConfig

func (c *GetACL) RequiresConfig() bool

Returns true - configuration is not optional for this command to return valid information.

func (*GetACL) Usage

func (c *GetACL) Usage() string

type GetCard

type GetCard struct {
}

func (*GetCard) CLI

func (c *GetCard) CLI() string

func (*GetCard) Description

func (c *GetCard) Description() string

func (*GetCard) Execute

func (c *GetCard) Execute(ctx Context) error

func (*GetCard) Help

func (c *GetCard) Help()

func (*GetCard) RequiresConfig

func (c *GetCard) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetCard) Usage

func (c *GetCard) Usage() string

type GetCards

type GetCards struct {
}

func (*GetCards) CLI

func (c *GetCards) CLI() string

func (*GetCards) Description

func (c *GetCards) Description() string

func (*GetCards) Execute

func (c *GetCards) Execute(ctx Context) error

func (*GetCards) Help

func (c *GetCards) Help()

func (*GetCards) RequiresConfig

func (c *GetCards) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetCards) Usage

func (c *GetCards) Usage() string

type GetDevice

type GetDevice struct {
}

func (*GetDevice) CLI

func (c *GetDevice) CLI() string

func (*GetDevice) Description

func (c *GetDevice) Description() string

func (*GetDevice) Execute

func (c *GetDevice) Execute(ctx Context) error

func (*GetDevice) Help

func (c *GetDevice) Help()

func (*GetDevice) RequiresConfig

func (c *GetDevice) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetDevice) Usage

func (c *GetDevice) Usage() string

type GetDevices

type GetDevices struct {
}

func (*GetDevices) CLI

func (c *GetDevices) CLI() string

func (*GetDevices) Description

func (c *GetDevices) Description() string

func (*GetDevices) Execute

func (c *GetDevices) Execute(ctx Context) error

func (*GetDevices) Help

func (c *GetDevices) Help()

func (*GetDevices) RequiresConfig

func (c *GetDevices) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetDevices) Usage

func (c *GetDevices) Usage() string

type GetDoorControl

type GetDoorControl struct {
}

func (*GetDoorControl) CLI

func (c *GetDoorControl) CLI() string

func (*GetDoorControl) Description

func (c *GetDoorControl) Description() string

func (*GetDoorControl) Execute

func (c *GetDoorControl) Execute(ctx Context) error

func (*GetDoorControl) Help

func (c *GetDoorControl) Help()

func (*GetDoorControl) RequiresConfig

func (c *GetDoorControl) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetDoorControl) Usage

func (c *GetDoorControl) Usage() string

type GetDoorDelay

type GetDoorDelay struct {
}

func (*GetDoorDelay) CLI

func (c *GetDoorDelay) CLI() string

func (*GetDoorDelay) Description

func (c *GetDoorDelay) Description() string

func (*GetDoorDelay) Execute

func (c *GetDoorDelay) Execute(ctx Context) error

func (*GetDoorDelay) Help

func (c *GetDoorDelay) Help()

func (*GetDoorDelay) RequiresConfig

func (c *GetDoorDelay) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetDoorDelay) Usage

func (c *GetDoorDelay) Usage() string

type GetEvent

type GetEvent struct {
}

func (*GetEvent) CLI

func (c *GetEvent) CLI() string

func (*GetEvent) Description

func (c *GetEvent) Description() string

func (*GetEvent) Execute

func (c *GetEvent) Execute(ctx Context) error

func (*GetEvent) Help

func (c *GetEvent) Help()

func (*GetEvent) RequiresConfig

func (c *GetEvent) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetEvent) Usage

func (c *GetEvent) Usage() string

type GetEventIndex

type GetEventIndex struct {
}

func (*GetEventIndex) CLI

func (c *GetEventIndex) CLI() string

func (*GetEventIndex) Description

func (c *GetEventIndex) Description() string

func (*GetEventIndex) Execute

func (c *GetEventIndex) Execute(ctx Context) error

func (*GetEventIndex) Help

func (c *GetEventIndex) Help()

func (*GetEventIndex) RequiresConfig

func (c *GetEventIndex) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetEventIndex) Usage

func (c *GetEventIndex) Usage() string

type GetEvents

type GetEvents struct {
}

func (*GetEvents) CLI

func (c *GetEvents) CLI() string

func (*GetEvents) Description

func (c *GetEvents) Description() string

func (*GetEvents) Execute

func (c *GetEvents) Execute(ctx Context) error

func (*GetEvents) Help

func (c *GetEvents) Help()

func (*GetEvents) RequiresConfig

func (c *GetEvents) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetEvents) Usage

func (c *GetEvents) Usage() string

type GetListener

type GetListener struct {
}

func (*GetListener) CLI

func (c *GetListener) CLI() string

func (*GetListener) Description

func (c *GetListener) Description() string

func (*GetListener) Execute

func (c *GetListener) Execute(ctx Context) error

func (*GetListener) Help

func (c *GetListener) Help()

func (*GetListener) RequiresConfig

func (c *GetListener) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetListener) Usage

func (c *GetListener) Usage() string

type GetStatus

type GetStatus struct {
}

func (*GetStatus) CLI

func (c *GetStatus) CLI() string

func (*GetStatus) Description

func (c *GetStatus) Description() string

func (*GetStatus) Execute

func (c *GetStatus) Execute(ctx Context) error

func (*GetStatus) Help

func (c *GetStatus) Help()

func (*GetStatus) RequiresConfig

func (c *GetStatus) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetStatus) Usage

func (c *GetStatus) Usage() string

type GetTime

type GetTime struct {
}

func (*GetTime) CLI

func (c *GetTime) CLI() string

func (*GetTime) Description

func (c *GetTime) Description() string

func (*GetTime) Execute

func (c *GetTime) Execute(ctx Context) error

func (*GetTime) Help

func (c *GetTime) Help()

func (*GetTime) RequiresConfig

func (c *GetTime) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*GetTime) Usage

func (c *GetTime) Usage() string

type Grant

type Grant struct {
}

func (*Grant) CLI

func (c *Grant) CLI() string

func (*Grant) Description

func (c *Grant) Description() string

func (*Grant) Execute

func (c *Grant) Execute(ctx Context) error

func (*Grant) Help

func (c *Grant) Help()

func (*Grant) RequiresConfig

func (c *Grant) RequiresConfig() bool

Returns true - configuration is not optional for this command to return valid information.

func (*Grant) Usage

func (c *Grant) Usage() string

type Listen

type Listen struct {
}

func (*Listen) CLI

func (c *Listen) CLI() string

func (*Listen) Description

func (c *Listen) Description() string

func (*Listen) Execute

func (c *Listen) Execute(ctx Context) error

func (*Listen) Help

func (c *Listen) Help()

func (*Listen) RequiresConfig

func (c *Listen) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*Listen) Usage

func (c *Listen) Usage() string

type LoadACL

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

func (*LoadACL) CLI

func (c *LoadACL) CLI() string

func (*LoadACL) Description

func (c *LoadACL) Description() string

func (*LoadACL) Execute

func (c *LoadACL) Execute(ctx Context) error

func (*LoadACL) Help

func (c *LoadACL) Help()

func (*LoadACL) RequiresConfig

func (c *LoadACL) RequiresConfig() bool

Returns true - configuration is not optional for this command to return valid information.

func (*LoadACL) Usage

func (c *LoadACL) Usage() string

type OpenDoor

type OpenDoor struct {
}

func (*OpenDoor) CLI

func (c *OpenDoor) CLI() string

func (*OpenDoor) Description

func (c *OpenDoor) Description() string

func (*OpenDoor) Execute

func (c *OpenDoor) Execute(ctx Context) error

func (*OpenDoor) Help

func (c *OpenDoor) Help()

func (*OpenDoor) RequiresConfig

func (c *OpenDoor) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*OpenDoor) Usage

func (c *OpenDoor) Usage() string

type PutCard

type PutCard struct {
}

func (*PutCard) CLI

func (c *PutCard) CLI() string

func (*PutCard) Description

func (c *PutCard) Description() string

func (*PutCard) Execute

func (c *PutCard) Execute(ctx Context) error

func (*PutCard) Help

func (c *PutCard) Help()

func (*PutCard) RequiresConfig

func (c *PutCard) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*PutCard) Usage

func (c *PutCard) Usage() string

type RecordSpecialEvents added in v0.6.7

type RecordSpecialEvents struct {
}

Command implementation for record-special-events to enable or disable events for door open, door closed and door button pressed.

func (*RecordSpecialEvents) CLI added in v0.6.7

func (c *RecordSpecialEvents) CLI() string

Returns the 'record-special-events' command string for the CLI interface.

func (*RecordSpecialEvents) Description added in v0.6.7

func (c *RecordSpecialEvents) Description() string

Returns the 'record-special-events' command summary for the CLI interface.

func (*RecordSpecialEvents) Execute added in v0.6.7

func (c *RecordSpecialEvents) Execute(ctx Context) error

Gets the device ID and enable/disable value from the command line and sends a record-special-events to the designated controller.

func (*RecordSpecialEvents) Help added in v0.6.7

func (c *RecordSpecialEvents) Help()

Outputs the 'record-special-events' command help for the CLI interface.

func (*RecordSpecialEvents) RequiresConfig added in v0.6.7

func (c *RecordSpecialEvents) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*RecordSpecialEvents) Usage added in v0.6.7

func (c *RecordSpecialEvents) Usage() string

Returns the 'record-special-events' command parameters for the CLI interface.

type Revoke

type Revoke struct {
}

func (*Revoke) CLI

func (c *Revoke) CLI() string

func (*Revoke) Description

func (c *Revoke) Description() string

func (*Revoke) Execute

func (c *Revoke) Execute(ctx Context) error

func (*Revoke) Help

func (c *Revoke) Help()

func (*Revoke) RequiresConfig

func (c *Revoke) RequiresConfig() bool

Returns true - configuration is not optional for this command to return valid information.

func (*Revoke) Usage

func (c *Revoke) Usage() string

type SetAddress

type SetAddress struct {
}

func (*SetAddress) CLI

func (c *SetAddress) CLI() string

func (*SetAddress) Description

func (c *SetAddress) Description() string

func (*SetAddress) Execute

func (c *SetAddress) Execute(ctx Context) error

func (*SetAddress) Help

func (c *SetAddress) Help()

func (*SetAddress) RequiresConfig

func (c *SetAddress) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*SetAddress) Usage

func (c *SetAddress) Usage() string

type SetDoorControl

type SetDoorControl struct {
}

func (*SetDoorControl) CLI

func (c *SetDoorControl) CLI() string

func (*SetDoorControl) Description

func (c *SetDoorControl) Description() string

func (*SetDoorControl) Execute

func (c *SetDoorControl) Execute(ctx Context) error

func (*SetDoorControl) Help

func (c *SetDoorControl) Help()

func (*SetDoorControl) RequiresConfig

func (c *SetDoorControl) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*SetDoorControl) Usage

func (c *SetDoorControl) Usage() string

type SetDoorDelay

type SetDoorDelay struct {
}

func (*SetDoorDelay) CLI

func (c *SetDoorDelay) CLI() string

func (*SetDoorDelay) Description

func (c *SetDoorDelay) Description() string

func (*SetDoorDelay) Execute

func (c *SetDoorDelay) Execute(ctx Context) error

func (*SetDoorDelay) Help

func (c *SetDoorDelay) Help()

func (*SetDoorDelay) RequiresConfig

func (c *SetDoorDelay) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*SetDoorDelay) Usage

func (c *SetDoorDelay) Usage() string

type SetEventIndex

type SetEventIndex struct {
}

func (*SetEventIndex) CLI

func (c *SetEventIndex) CLI() string

func (*SetEventIndex) Description

func (c *SetEventIndex) Description() string

func (*SetEventIndex) Execute

func (c *SetEventIndex) Execute(ctx Context) error

func (*SetEventIndex) Help

func (c *SetEventIndex) Help()

func (*SetEventIndex) RequiresConfig

func (c *SetEventIndex) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*SetEventIndex) Usage

func (c *SetEventIndex) Usage() string

type SetListener

type SetListener struct {
}

func (*SetListener) CLI

func (c *SetListener) CLI() string

func (*SetListener) Description

func (c *SetListener) Description() string

func (*SetListener) Execute

func (c *SetListener) Execute(ctx Context) error

func (*SetListener) Help

func (c *SetListener) Help()

func (*SetListener) RequiresConfig

func (c *SetListener) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*SetListener) Usage

func (c *SetListener) Usage() string

type SetTime

type SetTime struct {
}

func (*SetTime) CLI

func (c *SetTime) CLI() string

func (*SetTime) Description

func (c *SetTime) Description() string

func (*SetTime) Execute

func (c *SetTime) Execute(ctx Context) error

func (*SetTime) Help

func (c *SetTime) Help()

func (*SetTime) RequiresConfig

func (c *SetTime) RequiresConfig() bool

Returns false - configuration is useful but optional.

func (*SetTime) Usage

func (c *SetTime) Usage() string

type Show

type Show struct {
}

func (*Show) CLI

func (c *Show) CLI() string

func (*Show) Description

func (c *Show) Description() string

func (*Show) Execute

func (c *Show) Execute(ctx Context) error

func (*Show) Help

func (c *Show) Help()

func (*Show) RequiresConfig

func (c *Show) RequiresConfig() bool

Returns true - configuration is not optional for this command to return valid information.

func (*Show) Usage

func (c *Show) Usage() string

type Version

type Version struct {
}

Version is a CLI command implementation that displays the CLI version information.

func (*Version) CLI

func (c *Version) CLI() string

CLI returns the 'version' command line

func (*Version) Description

func (c *Version) Description() string

Description returns the 'version' command short form help

func (*Version) Execute

func (c *Version) Execute(ctx Context) error

Execute prints the current 'uhppote' version

func (*Version) Help

func (c *Version) Help()

Help returns the 'version' command long form help

func (*Version) RequiresConfig

func (c *Version) RequiresConfig() bool

Returns false - configuration is unused and optional.

func (*Version) Usage

func (c *Version) Usage() string

Usage returns the string describing the additional options for the 'version' command

Jump to

Keyboard shortcuts

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