Documentation ¶
Index ¶
- Variables
- type Account
- type Accounts
- type BaseAccount
- type BaseDevice
- type BaseMetadata
- type Device
- type DeviceID
- type Devices
- type Health
- type HealthAggregation
- type HealthAggregationComponent
- type HealthCheck
- type HealthResult
- type Metadata
- type MetadataID
- type MetadataProvider
- type ModifiedAt
- type Module
- type Modules
- type ShareCode
- type Sharing
- type UsernameGenerationStrategy
- type UsernameGenerator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccountAlreadyExists = errors.New("account already exists") ErrAccountNotFound = errors.New("account not found") )
View Source
var ( ErrWritingModuleFailed = errors.New("module write failed") ErrReadingModule = errors.New("module read failed") )
View Source
var ErrDeviceNotFound = errors.New("device not found")
View Source
var ErrNoMetadata = errors.New("no metadata found")
Functions ¶
This section is empty.
Types ¶
type BaseAccount ¶ added in v0.1.7
type BaseAccount struct {
// contains filtered or unexported fields
}
func NewBaseAccount ¶ added in v0.1.7
func NewBaseAccount(username string, createdAt time.Time) *BaseAccount
func (*BaseAccount) CreatedAt ¶ added in v0.2.1
func (r *BaseAccount) CreatedAt() time.Time
func (*BaseAccount) Username ¶ added in v0.1.7
func (r *BaseAccount) Username() string
type BaseDevice ¶ added in v0.1.7
type BaseDevice struct {
// contains filtered or unexported fields
}
func NewBaseDevice ¶ added in v0.2.0
func NewBaseDevice(deviceId DeviceID, hashedPass string) *BaseDevice
func (*BaseDevice) HashedPass ¶ added in v0.2.1
func (r *BaseDevice) HashedPass() string
func (*BaseDevice) ID ¶ added in v0.1.7
func (r *BaseDevice) ID() DeviceID
func (*BaseDevice) Verify ¶ added in v0.2.1
func (r *BaseDevice) Verify(password string) bool
type BaseMetadata ¶ added in v0.4.0
type BaseMetadata struct { ID MetadataID `json:"id" yaml:"id"` ModifiedAt time.Time `json:"modifiedAt" yaml:"modifiedAt"` }
func NewBaseMetadata ¶ added in v0.4.0
func NewBaseMetadata(id string, modifiedAt time.Time) *BaseMetadata
func (*BaseMetadata) GetID ¶ added in v0.4.0
func (r *BaseMetadata) GetID() MetadataID
func (*BaseMetadata) GetModifiedAt ¶ added in v0.4.0
func (r *BaseMetadata) GetModifiedAt() ModifiedAt
type Devices ¶
type Devices interface { AddDevice(ctx context.Context, account Account, id DeviceID, password string) (Device, error) GetDevices(ctx context.Context, account Account) (map[DeviceID]Device, error) GetDevice(ctx context.Context, account Account, id DeviceID) (Device, error) DeleteDevice(ctx context.Context, account Account, id DeviceID) error HealthCheck() HealthCheck }
type Health ¶
type Health interface {
Check(ctx context.Context) HealthAggregation
}
func HealthAggregator ¶
func HealthAggregator(healthChecks []HealthCheck) Health
type HealthAggregation ¶
type HealthAggregation struct { Health HealthResult `yaml:"health"` Components []HealthAggregationComponent `yaml:"components"` }
type HealthAggregationComponent ¶
type HealthAggregationComponent struct { Name string `yaml:"name"` Health HealthResult `yaml:"health"` }
type HealthResult ¶
type HealthResult string
const ( HealthUp HealthResult = "Up" HealthDown HealthResult = "Down" )
func HealthResultFromBool ¶
func HealthResultFromBool(healthUp bool) HealthResult
func (HealthResult) ToHTTPStatusCode ¶
func (r HealthResult) ToHTTPStatusCode() int
type Metadata ¶ added in v0.4.0
type Metadata interface { GetID() MetadataID GetModifiedAt() ModifiedAt }
type MetadataID ¶ added in v0.4.0
type MetadataID string
type MetadataProvider ¶ added in v0.4.0
type ModifiedAt ¶ added in v0.4.0
type UsernameGenerationStrategy ¶ added in v0.2.0
type UsernameGenerationStrategy string
const UUIDUsernameGeneration UsernameGenerationStrategy = "uuid"
type UsernameGenerator ¶ added in v0.2.0
func NewUsernameGenerator ¶ added in v0.2.0
func NewUsernameGenerator(_ UsernameGenerationStrategy) (UsernameGenerator, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.