Documentation
¶
Overview ¶
Package relaysetup implements discover, approve and install for native applications.
Index ¶
- Variables
- func DefaultDeviceName(suggestion string) string
- func ValidateDeviceName(name string) error
- type Dependencies
- type FileStore
- type HTTPClient
- type Operation
- type PendingSetup
- type Progress
- type Recovery
- type RecoveryAction
- type Request
- type Result
- type Service
- type ServiceLogin
- type SetupError
- type Snapshot
- type Store
Constants ¶
This section is empty.
Variables ¶
var ( ErrDenied = errors.New("relay access was refused; approve this device or install a new access key") ErrExpired = errors.New("relay enrollment expired; start setup again") ErrPendingSetup = errors.New("another relay setup is pending; finish or cancel it first") ErrNoPendingSetup = errors.New("no relay setup is pending; nothing was cancelled") ErrSetupRunning = errors.New("relay setup is already running; finish or cancel it first") ErrSettingsChanged = errors.New("sharing settings changed during relay setup") ErrSetupSuperseded = errors.New("relay setup was completed, cancelled or replaced") )
var ErrInvalidDeviceName = fmt.Errorf("device name must be valid UTF-8, 1 to %d bytes, not blank, and free of control characters", maximumDeviceNameBytes)
ErrInvalidDeviceName identifies input that cannot be preserved by enrollment and checkpoint serialization.
var ErrLocalCredentialRequired = errors.New("this node requires an access key from its owner")
Functions ¶
func DefaultDeviceName ¶
DefaultDeviceName makes an environment-provided display label usable without user intervention. Explicit names must be validated without rewriting them.
func ValidateDeviceName ¶
ValidateDeviceName shares the enrollment rule with callers that can reject input before starting setup or contacting a relay.
Types ¶
type Dependencies ¶
type FileStore ¶
type FileStore struct{ Settings relayconfig.FileStore }
type PendingSetup ¶
type PendingSetup struct {
// contains filtered or unexported fields
}
func (*PendingSetup) MarshalJSON ¶
func (pending *PendingSetup) MarshalJSON() ([]byte, error)
func (*PendingSetup) UnmarshalJSON ¶
func (pending *PendingSetup) UnmarshalJSON(data []byte) error
type Progress ¶
type Progress struct {
Stage, OperationID, EnrollmentID, VerificationURL, UserCode string
ServiceLogin *ServiceLogin
RetryAfter time.Duration
}
func (Progress) EngineEvent ¶
func (Progress) EngineEvent()
type Recovery ¶
type Recovery struct {
Action RecoveryAction
RelayURL, OperationID string
}
type RecoveryAction ¶
type RecoveryAction string
RecoveryAction describes what the last observed transaction permits, rather than equating every persisted checkpoint with a resumable installation.
const ( RecoveryUnknown RecoveryAction = "unknown" RecoveryRestart RecoveryAction = "restart" RecoveryContinue RecoveryAction = "continue" RecoveryCancel RecoveryAction = "cancel" RecoveryRetryCancel RecoveryAction = "retry_cancel" RecoveryBlocked RecoveryAction = "blocked" )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(dependencies Dependencies) *Service
type ServiceLogin ¶ added in v0.1.4
ServiceLogin is a browser destination derived from discovery. The enrollment response supplies only the opaque invitation, never a replacement origin.
type SetupError ¶
type SetupError struct {
Recovery Recovery
// contains filtered or unexported fields
}
SetupError carries the workflow's last transaction outcome to its caller. Reading storage again to explain an interruption could block shutdown and describe a different operation started after this one finished.
func (*SetupError) Error ¶
func (failure *SetupError) Error() string
func (*SetupError) Unwrap ¶
func (failure *SetupError) Unwrap() error
type Snapshot ¶
type Snapshot struct {
relayconfig.Config
Pending *PendingSetup
}
Snapshot is a setup transaction's view, never a configuration document.