Documentation
¶
Index ¶
- Variables
- type ClientParams
- type CommonGroupSettings
- type Duration
- type FleetLockBody
- type FleetLockConfig
- type FleetLockConfiger
- type FleetLockError
- type FleetLockHashedConfig
- type FleetLocker
- type GroupSettings
- type HashedGroupSettings
- type HashedPassword
- type Holder
- type LockStatus
- type RecursiveLockError
Constants ¶
This section is empty.
Variables ¶
var ValidGroup = regexp.MustCompile(`^[a-zA-Z0-9.-]+$`)
https://coreos.github.io/zincati/development/fleetlock/protocol/#body Client group is a mandatory textual label, conforming to the regexp ^[a-zA-Z0-9.-]+$
Functions ¶
This section is empty.
Types ¶
type ClientParams ¶ added in v0.0.2
https://coreos.github.io/zincati/development/fleetlock/protocol/#body
type CommonGroupSettings ¶ added in v0.0.2
type CommonGroupSettings struct {
TotalSlots int `json:"total_slots" example:"1"`
StaleAge Duration `json:"stale_age" swaggertype:"string" example:"1h"`
}
Settings that look the same before and after hashing
type Duration ¶
Create a custom time.Duration wrapping struct so we can get a more easily readable JSON field for the data. Standard time.Duration: "stale_age": 10000000000 With this Duration: "stale_age": "10s"
func (Duration) MarshalJSON ¶
Implement json.Marshaler interface
func (*Duration) UnmarshalJSON ¶
Implement json.Unmarshaler interface
type FleetLockBody ¶
type FleetLockBody struct {
ClientParams ClientParams `json:"client_params"`
}
The HTTP body format expected for FleetLock requests https://coreos.github.io/zincati/development/fleetlock/protocol/#body
type FleetLockConfig ¶ added in v0.0.2
type FleetLockConfig map[string]GroupSettings
type FleetLockConfiger ¶ added in v0.0.2
type FleetLockConfiger interface {
GetConfig(ctx context.Context) (FleetLockHashedConfig, error)
GetLockers(ctx context.Context) (map[string]FleetLocker, error)
GetNotifierChan(ctx context.Context) (interface{}, error)
AddGroup(ctx context.Context, group string, totalSlots int, staleAge Duration, permissions map[string]string) error
DelGroup(ctx context.Context, group string) error
}
type FleetLockError ¶
The error format expected for FleetLock requests https://coreos.github.io/zincati/development/fleetlock/protocol/#errors
type FleetLockHashedConfig ¶ added in v0.0.2
type FleetLockHashedConfig map[string]HashedGroupSettings
func NewHashedConfig ¶ added in v0.0.2
func NewHashedConfig(flc FleetLockConfig, argonSettings hashing.ArgonSettings) (FleetLockHashedConfig, error)
type FleetLocker ¶
type FleetLocker interface {
RecursiveLock(ctx context.Context, id string) error
UnlockIfHeld(ctx context.Context, id string) error
Group() string
LockStatus(ctx context.Context) (LockStatus, error)
}
The core operations implemented by a FleetLock backend https://coreos.github.io/zincati/development/fleetlock/protocol/#overview
type GroupSettings ¶ added in v0.0.2
type GroupSettings struct {
CommonGroupSettings
Permissions map[string]string `json:"permissions" example:"*:changeme"`
}
"example" and "swaggerype" tags are used by swaggo/swag for creating docs
type HashedGroupSettings ¶ added in v0.0.2
type HashedGroupSettings struct {
CommonGroupSettings
HashedPermissions map[string]hashing.HashedPassword `json:"permissions" example:"*:changeme"`
}
type HashedPassword ¶ added in v0.0.2
type LockStatus ¶
Returns status information regarding the lock. Useful for monitoring but is not part of the FleetLock protocol
type RecursiveLockError ¶ added in v0.0.2
Type that satisfies the "error" interface. If the caller gets this type of error it can trust the message in clientMsg is safe to send to the client as-is in a FleetLockError value.
func (*RecursiveLockError) Error ¶ added in v0.0.2
func (le *RecursiveLockError) Error() string