Documentation ¶
Index ¶
- Constants
- Variables
- func AddMacro(name string, description string, sequence ...string) error
- func AddSequence(sequence string, commands []string) error
- func CheckPasswordHash(password, hash string) bool
- func Close()
- func DelUser(username string) error
- func DeleteMacro(name string) error
- func FakeCycle()
- func HashPassword(password string) (string, error)
- func ParseRunSequence(input string) (sequence string, targets map[TargetType]map[int]string, err error)
- func RunSequence(sequence string, targets map[TargetType]map[int]string) ([]string, error)
- func Start()
- func StartTest()
- type AuthMethod
- type Macro
- type PubKey
- type Sequence
- type StringMapper
- type TargetType
- type Targets
- type User
- type UserPass
Constants ¶
View Source
const ( PlaceHolderGroup = "$g" PlaceHolderBridge = "$b" PlaceHolderLight = "$l" )
Variables ¶
View Source
var ErrAccessDenied = errors.New("access denied")
Functions ¶
func AddSequence ¶
func CheckPasswordHash ¶
func DeleteMacro ¶
func FakeCycle ¶
func FakeCycle()
FakeCycle chooses the first known user and cycles through all their auth methods to avoid time based user enumeration.
func HashPassword ¶
func ParseRunSequence ¶
func RunSequence ¶
Types ¶
type AuthMethod ¶
type AuthMethod interface { json.Marshaler StringMapper // Authenticate authenticates the user. Authenticate() error // Name returns the name of the authentication method. Name() string }
func AuthMethodFromMap ¶
func AuthMethodFromMap(m map[string]string) AuthMethod
type Macro ¶
type Sequence ¶
type Sequence struct { Lines []string `json:"lines"` TargetsNeeded map[TargetType]Targets `json:"targets_needed,omitempty"` }
type StringMapper ¶
type TargetType ¶
type TargetType uint16
const ( TargetTypeBridge TargetType = iota TargetTypeGroup TargetTypeLight )
type User ¶
type User struct { Username string `json:"username"` AuthMethods []map[string]string `json:"auth_methods"` *sync.Mutex }
func (*User) AddAuthMethod ¶
func (user *User) AddAuthMethod(method AuthMethod) (*User, error)
Click to show internal directories.
Click to hide internal directories.