Documentation ¶
Index ¶
- Constants
- Variables
- func BreatheCmd(ctx Context) (int, error)
- func ColorizeIndicator(s string) string
- func ColorizePower(s string) string
- func ColorizeStatus(s lifx.Status) string
- func Debugf(format string, a ...interface{})
- func ExitWithCode(code int, err error)
- func FprintfWithIndent(w io.Writer, indent int, format string, a ...interface{}) (n int, err error)
- func HelpCmd(ctx Context) (int, error)
- func LsCmd(ctx Context) (int, error)
- func Main(args []string) (int, error)
- func PoweroffCmd(ctx Context) (int, error)
- func PoweronCmd(ctx Context) (int, error)
- func PrintWithIndent(indent int, s string)
- func PrintfWithIndent(indent int, format string, a ...interface{}) (n int, err error)
- func RegisterCommand(cmd Command) error
- func SetColorCmd(ctx Context) (int, error)
- func SetStateCmd(ctx Context) (int, error)
- func SetWhiteCmd(ctx Context) (int, error)
- func ShowCmd(ctx Context) (int, error)
- func ToggleCmd(ctx Context) (int, error)
- func ValidateCmd(ctx Context) (int, error)
- func VersionCmd(ctx Context) (int, error)
- func YesNo(v bool) string
- type Command
- func GetCommand(name string) (Command, bool)
- func NewCmdBreathe() Command
- func NewCmdHelp() Command
- func NewCmdLs() Command
- func NewCmdPoweroff() Command
- func NewCmdPoweron() Command
- func NewCmdSetColor() Command
- func NewCmdSetState() Command
- func NewCmdSetWhite() Command
- func NewCmdShow() Command
- func NewCmdToggle() Command
- func NewCmdValidate() Command
- func NewCmdVersion() Command
- type Config
- type Context
- type Flags
- type Printer
Constants ¶
View Source
const ( ExitSuccess = iota ExitFailure )
View Source
const Tabstop int = 2
Variables ¶
View Source
var BuildDate string
View Source
var ( DefaultConfig = Config{ // contains filtered or unexported fields } )
View Source
var GitCommit string
View Source
var Version string
Functions ¶
func BreatheCmd ¶
func ColorizeIndicator ¶
func ColorizePower ¶
func ColorizeStatus ¶
func ColorizeStatus(s lifx.Status) string
func ExitWithCode ¶
func FprintfWithIndent ¶
func PoweroffCmd ¶
func PoweronCmd ¶
func PrintWithIndent ¶
func PrintfWithIndent ¶
func RegisterCommand ¶
func SetColorCmd ¶
func SetStateCmd ¶
func SetWhiteCmd ¶
func ValidateCmd ¶
func VersionCmd ¶
Types ¶
type Command ¶
type Command struct { Name string Func func(Context) (int, error) Flags *flag.FlagSet Use string Short string Long string }
func GetCommand ¶
func NewCmdBreathe ¶
func NewCmdBreathe() Command
func NewCmdHelp ¶
func NewCmdHelp() Command
func NewCmdPoweroff ¶
func NewCmdPoweroff() Command
func NewCmdPoweron ¶
func NewCmdPoweron() Command
func NewCmdSetColor ¶
func NewCmdSetColor() Command
func NewCmdSetState ¶
func NewCmdSetState() Command
func NewCmdSetWhite ¶
func NewCmdSetWhite() Command
func NewCmdShow ¶
func NewCmdShow() Command
func NewCmdToggle ¶
func NewCmdToggle() Command
func NewCmdValidate ¶
func NewCmdValidate() Command
func NewCmdVersion ¶
func NewCmdVersion() Command
type Config ¶
type Config struct { AccessToken string `toml:"access_token"` OutputFormat string `toml:"output_format"` Colors map[string][]float32 `toml:"colors"` Debug bool `toml:"debug"` Indicator string `toml:"indicator"` // contains filtered or unexported fields }
func LoadConfig ¶
func LoadConfigFile ¶
func (*Config) MergeWithEnv ¶
func (c *Config) MergeWithEnv()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.