Documentation ¶
Index ¶
- type CCU
- type Config
- type Endpoint
- type HTTP
- type Host
- type Logging
- type MQTT
- type PermKind
- type Permission
- type Store
- func (s *Store) Close()
- func (s *Store) Lock()
- func (s *Store) RLock()
- func (s *Store) RLocker() sync.Locker
- func (s *Store) RUnlock()
- func (s *Store) Read() error
- func (s *Store) Unlock()
- func (s *Store) Update(fn func(*Config) error) error
- func (s *Store) View(fn func(*Config) error) error
- func (s *Store) Write() error
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { CCU CCU Host Host Logging Logging HTTP HTTP MQTT MQTT Users map[string]*User /* Identifier is key. */ }
Config is the entry object of the runtime config.
type Permission ¶
type Permission struct { Identifier string Description string Endpoint Endpoint Kind PermKind // pattern syntax q.v. path.Match() PVFilter string }
Permission represents a allowance to access something.
type Store ¶
Store holds a runtime configuration.
func (*Store) Lock ¶
func (s *Store) Lock()
Lock locks the store for writing (q.v. Locker interface).
func (*Store) Update ¶
Update executes a function which updates the runtime config. If fn returns no error, a delayed save to file is triggered.
type User ¶
type User struct { Identifier string Active bool Description string Password string // unencrypted password (only temporary) EncryptedPassword string // bcrypt hash Permissions map[string]*Permission /* Identifier is key. */ }
User represents a user or a device.
func (*User) AddPermission ¶
func (u *User) AddPermission(per *Permission)
AddPermission adds a permission to a user.
func (*User) Authorized ¶
Authorized checks whether an authorization exists. The request must contain only a single endpoint and kind. pvPath is not yet checked.
func (*User) SetPassword ¶
SetPassword generates a new hash for the password.
Click to show internal directories.
Click to hide internal directories.