Documentation
¶
Index ¶
- Variables
- func CreateDeviceWithAccount(ctx context.Context, pool *pgxpool.Pool, account *model.Account, ...) error
- type ACMEStore
- func (s *ACMEStore) Create(ctx context.Context, c *model.ACMEChallenge) error
- func (s *ACMEStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *ACMEStore) GetByID(ctx context.Context, id uuid.UUID) (*model.ACMEChallenge, error)
- func (s *ACMEStore) GetExpired(ctx context.Context) ([]*model.ACMEChallenge, error)
- type AccountStore
- type AuditStore
- type DeviceStore
- func (s *DeviceStore) CleanupReleasedHostnames(ctx context.Context, maxAgeDays int) (int64, error)
- func (s *DeviceStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *DeviceStore) GetByEKFingerprint(ctx context.Context, fingerprint string) (*model.Device, error)
- func (s *DeviceStore) GetByID(ctx context.Context, id uuid.UUID) (*model.Device, error)
- func (s *DeviceStore) GetBySlug(ctx context.Context, slug string) (*model.Device, error)
- func (s *DeviceStore) IsHostnameReleased(ctx context.Context, label string, cooldownDays int) (bool, error)
- func (s *DeviceStore) IsLabelTaken(ctx context.Context, label string) (bool, error)
- func (s *DeviceStore) ReleaseHostname(ctx context.Context, label string, deviceID uuid.UUID) error
- func (s *DeviceStore) SetCustomHostname(ctx context.Context, p SetCustomHostnameParams) error
- func (s *DeviceStore) UpdateAKPublicKey(ctx context.Context, id uuid.UUID, akPub []byte) error
- func (s *DeviceStore) UpdateLastSeen(ctx context.Context, id uuid.UUID, ip net.IP) error
- func (s *DeviceStore) UpdateStatus(ctx context.Context, id uuid.UUID, status model.DeviceStatus) error
- type DomainStore
- func (s *DomainStore) AreDevicesInAccount(ctx context.Context, accountID uuid.UUID, deviceIDs []uuid.UUID) (bool, error)
- func (s *DomainStore) AssignDevice(ctx context.Context, domainID, deviceID uuid.UUID) error
- func (s *DomainStore) CountByAccountID(ctx context.Context, accountID uuid.UUID) (int, error)
- func (s *DomainStore) Create(ctx context.Context, d *model.AccountDomain) error
- func (s *DomainStore) Delete(ctx context.Context, id uuid.UUID) error
- func (s *DomainStore) DeleteExpiredPending(ctx context.Context) (int64, error)
- func (s *DomainStore) GetByDomain(ctx context.Context, domain string) (*model.AccountDomain, error)
- func (s *DomainStore) GetByID(ctx context.Context, id uuid.UUID) (*model.AccountDomain, error)
- func (s *DomainStore) GetDeviceAliasDomains(ctx context.Context, deviceID uuid.UUID) ([]string, error)
- func (s *DomainStore) HasConflictingDomain(ctx context.Context, accountID uuid.UUID, domain string) (bool, error)
- func (s *DomainStore) ListAssignments(ctx context.Context, domainID uuid.UUID) ([]*model.DomainAssignment, error)
- func (s *DomainStore) ListByAccountID(ctx context.Context, accountID uuid.UUID) ([]*model.AccountDomain, error)
- func (s *DomainStore) UnassignDevice(ctx context.Context, domainID, deviceID uuid.UUID) error
- func (s *DomainStore) UpdateVerified(ctx context.Context, id uuid.UUID, verifiedByDeviceID uuid.UUID) error
- type NexusStore
- func (s *NexusStore) GetByHostname(ctx context.Context, hostname string) (*model.NexusInstance, error)
- func (s *NexusStore) ListActive(ctx context.Context) ([]*model.NexusInstance, error)
- func (s *NexusStore) MarkInactive(ctx context.Context, thresholdSeconds int) ([]uuid.UUID, error)
- func (s *NexusStore) UpdateResolvedAddresses(ctx context.Context, id uuid.UUID, addrs []net.IP) error
- func (s *NexusStore) Upsert(ctx context.Context, n *model.NexusInstance) error
- type SetCustomHostnameParams
- type Stores
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDomainNotFound = errors.New("domain not found") ErrDuplicateDomain = errors.New("domain already registered") ErrAssignmentNotFound = errors.New("assignment not found") )
View Source
var ErrAccountNotFound = errors.New("account not found")
View Source
var ErrChallengeNotFound = errors.New("acme challenge not found")
View Source
var ErrDeviceNotFound = errors.New("device not found")
View Source
var ErrDuplicateEK = errors.New("duplicate ek fingerprint")
View Source
var ErrDuplicateHostname = errors.New("hostname already taken")
View Source
var ErrDuplicateSlug = errors.New("duplicate slug")
View Source
var ErrNexusNotFound = errors.New("nexus instance not found")
Functions ¶
Types ¶
type ACMEStore ¶
type ACMEStore struct {
// contains filtered or unexported fields
}
func NewACMEStore ¶
func (*ACMEStore) GetExpired ¶
type AccountStore ¶ added in v0.1.1
type AccountStore struct {
// contains filtered or unexported fields
}
func NewAccountStore ¶ added in v0.1.1
func NewAccountStore(pool *pgxpool.Pool) *AccountStore
type AuditStore ¶
type AuditStore struct {
// contains filtered or unexported fields
}
func NewAuditStore ¶
func NewAuditStore(pool *pgxpool.Pool) *AuditStore
func (*AuditStore) DeleteOlderThan ¶
func (*AuditStore) Log ¶
func (s *AuditStore) Log(ctx context.Context, entry *model.AuditEntry) error
type DeviceStore ¶
type DeviceStore struct {
// contains filtered or unexported fields
}
func NewDeviceStore ¶
func NewDeviceStore(pool *pgxpool.Pool) *DeviceStore
func (*DeviceStore) CleanupReleasedHostnames ¶
func (*DeviceStore) GetByEKFingerprint ¶
func (*DeviceStore) IsHostnameReleased ¶
func (*DeviceStore) IsLabelTaken ¶
func (*DeviceStore) ReleaseHostname ¶
func (*DeviceStore) SetCustomHostname ¶
func (s *DeviceStore) SetCustomHostname(ctx context.Context, p SetCustomHostnameParams) error
func (*DeviceStore) UpdateAKPublicKey ¶
func (*DeviceStore) UpdateLastSeen ¶
func (*DeviceStore) UpdateStatus ¶
func (s *DeviceStore) UpdateStatus(ctx context.Context, id uuid.UUID, status model.DeviceStatus) error
type DomainStore ¶ added in v0.1.1
type DomainStore struct {
// contains filtered or unexported fields
}
func NewDomainStore ¶ added in v0.1.1
func NewDomainStore(pool *pgxpool.Pool) *DomainStore
func (*DomainStore) AreDevicesInAccount ¶ added in v0.1.1
func (s *DomainStore) AreDevicesInAccount(ctx context.Context, accountID uuid.UUID, deviceIDs []uuid.UUID) (bool, error)
AreDevicesInAccount checks that all given device IDs belong to the specified account.
func (*DomainStore) AssignDevice ¶ added in v0.1.1
AssignDevice assigns a domain to a device.
func (*DomainStore) CountByAccountID ¶ added in v0.1.1
func (*DomainStore) Create ¶ added in v0.1.1
func (s *DomainStore) Create(ctx context.Context, d *model.AccountDomain) error
func (*DomainStore) DeleteExpiredPending ¶ added in v0.1.1
func (s *DomainStore) DeleteExpiredPending(ctx context.Context) (int64, error)
func (*DomainStore) GetByDomain ¶ added in v0.1.1
func (s *DomainStore) GetByDomain(ctx context.Context, domain string) (*model.AccountDomain, error)
func (*DomainStore) GetByID ¶ added in v0.1.1
func (s *DomainStore) GetByID(ctx context.Context, id uuid.UUID) (*model.AccountDomain, error)
func (*DomainStore) GetDeviceAliasDomains ¶ added in v0.1.1
func (s *DomainStore) GetDeviceAliasDomains(ctx context.Context, deviceID uuid.UUID) ([]string, error)
GetDeviceAliasDomains returns verified domain strings for a device.
func (*DomainStore) HasConflictingDomain ¶ added in v0.1.1
func (*DomainStore) ListAssignments ¶ added in v0.1.1
func (s *DomainStore) ListAssignments(ctx context.Context, domainID uuid.UUID) ([]*model.DomainAssignment, error)
ListAssignments returns all device assignments for a domain.
func (*DomainStore) ListByAccountID ¶ added in v0.1.1
func (s *DomainStore) ListByAccountID(ctx context.Context, accountID uuid.UUID) ([]*model.AccountDomain, error)
func (*DomainStore) UnassignDevice ¶ added in v0.1.1
UnassignDevice removes a device assignment from a domain.
func (*DomainStore) UpdateVerified ¶ added in v0.1.1
type NexusStore ¶
type NexusStore struct {
// contains filtered or unexported fields
}
func NewNexusStore ¶
func NewNexusStore(pool *pgxpool.Pool) *NexusStore
func (*NexusStore) GetByHostname ¶
func (s *NexusStore) GetByHostname(ctx context.Context, hostname string) (*model.NexusInstance, error)
func (*NexusStore) ListActive ¶
func (s *NexusStore) ListActive(ctx context.Context) ([]*model.NexusInstance, error)
func (*NexusStore) MarkInactive ¶
func (*NexusStore) UpdateResolvedAddresses ¶
func (*NexusStore) Upsert ¶
func (s *NexusStore) Upsert(ctx context.Context, n *model.NexusInstance) error
type SetCustomHostnameParams ¶
type Stores ¶
type Stores struct {
Device *DeviceStore
Nexus *NexusStore
ACME *ACMEStore
Audit *AuditStore
Account *AccountStore
Domain *DomainStore
}
Click to show internal directories.
Click to hide internal directories.