Documentation ¶
Index ¶
- Constants
- func NewClientWithRegularPing(ctx context.Context, config *config.Config) (*redis.Client, error)
- func VerifyConnection(ctx context.Context, client *redis.Client, timeout time.Duration) error
- type Account
- type Accounts
- func (r *Accounts) ActiveShares(ctx context.Context, username string) ([]string, error)
- func (r *Accounts) Find(ctx context.Context, username string) (service.Account, error)
- func (r *Accounts) HealthCheck() service.HealthCheck
- func (r *Accounts) IsShared(ctx context.Context, username string, share string) (bool, error)
- func (r *Accounts) Register(ctx context.Context, username string) (service.Account, string, error)
- func (r *Accounts) Revoke(ctx context.Context, username string, shareCode string) error
- func (r *Accounts) Share(ctx context.Context, username string) (string, error)
- type Device
- type Devices
- func (r *Devices) FindByAccount(ctx context.Context, acc service.Account) ([]service.Device, error)
- func (r *Devices) FindByDeviceID(ctx context.Context, acc service.Account, deviceID string) (service.Device, error)
- func (r *Devices) HealthCheck() service.HealthCheck
- func (r *Devices) Register(ctx context.Context, acc service.Account, deviceID string) (service.Device, error)
- type Module
- type Modules
Constants ¶
View Source
const ( EnvRedisAddr = "REDIS_ADDR" EnvRedisUsername = "REDIS_USERNAME" EnvRedisPassword = "REDIS_PASSWORD" DefaultIntervalSeconds = 5 DefaultTimeoutSeconds = 5 )
View Source
const ( AccountKeySpace = "octi:accounts" )
View Source
const DeviceKeySpace = "octi:devices"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func AccountFromUsername ¶
func (*Account) HashedPass ¶
type Accounts ¶
type Accounts struct {
// contains filtered or unexported fields
}
func NewAccounts ¶
func NewAccounts(client *redis.Client) *Accounts
func (*Accounts) ActiveShares ¶
func (*Accounts) HealthCheck ¶
func (r *Accounts) HealthCheck() service.HealthCheck
type Devices ¶
type Devices struct {
// contains filtered or unexported fields
}
func NewDevices ¶
func NewDevices(client *redis.Client) *Devices
func (*Devices) FindByAccount ¶
func (*Devices) FindByDeviceID ¶
func (*Devices) HealthCheck ¶
func (r *Devices) HealthCheck() service.HealthCheck
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func ModuleFromBytes ¶
type Modules ¶
type Modules struct {
// contains filtered or unexported fields
}
func NewModules ¶
func NewModules(client *redis.Client) *Modules
func (*Modules) HealthCheck ¶
func (r *Modules) HealthCheck() service.HealthCheck
Click to show internal directories.
Click to hide internal directories.