Documentation
¶
Index ¶
- Constants
- type AccessPrivateRequest
- type AccessRegistryEntry
- type Agent
- func (a *Agent) AccessPrivate(req *AccessPrivateRequest) (frontendToken string, err error)
- func (a *Agent) Config() *AgentConfig
- func (a *Agent) ReleaseAccess(frontendToken string) error
- func (a *Agent) ReleaseShare(shareToken string) error
- func (a *Agent) ReloadRegistry() error
- func (a *Agent) Run() error
- func (a *Agent) SaveRegistry() error
- func (a *Agent) ShareHttpHealthcheck(shareToken, endpoint, httpVerb string, expectedHttpResponse, timeoutMs int) error
- func (a *Agent) SharePrivate(req *SharePrivateRequest) (shareToken string, err error)
- func (a *Agent) SharePublic(req *SharePublicRequest) (shareToken string, frontendEndpoint []string, err error)
- func (a *Agent) Shutdown()
- type AgentConfig
- type BootHandlerConfig
- type CommandBuilder
- func (cb *CommandBuilder) AccessGrants(grants []string) *CommandBuilder
- func (cb *CommandBuilder) AddConditionalFlag(condition bool, flag string) *CommandBuilder
- func (cb *CommandBuilder) AddFlag(flag string) *CommandBuilder
- func (cb *CommandBuilder) AddMultipleOptions(option string, values []string) *CommandBuilder
- func (cb *CommandBuilder) AddOption(option, value string) *CommandBuilder
- func (cb *CommandBuilder) AutoMode(auto bool, address string, startPort, endPort int) *CommandBuilder
- func (cb *CommandBuilder) BackendMode(mode string) *CommandBuilder
- func (cb *CommandBuilder) BasicAuth(auths []string) *CommandBuilder
- func (cb *CommandBuilder) BindAddress(address string) *CommandBuilder
- func (cb *CommandBuilder) Build() []string
- func (cb *CommandBuilder) Insecure(insecure bool) *CommandBuilder
- func (cb *CommandBuilder) NameSelections(selections []NameSelection) *CommandBuilder
- func (cb *CommandBuilder) OauthEmailDomains(domains []string) *CommandBuilder
- func (cb *CommandBuilder) OauthProvider(provider string) *CommandBuilder
- func (cb *CommandBuilder) OauthRefreshInterval(interval string) *CommandBuilder
- func (cb *CommandBuilder) Open(open bool) *CommandBuilder
- func (cb *CommandBuilder) ShareToken(token string) *CommandBuilder
- func (cb *CommandBuilder) String() string
- func (cb *CommandBuilder) Target(target string) *CommandBuilder
- type Enrollment
- type FailureEntry
- type NameSelection
- type PrivateShareRegistryEntry
- type PublicShareRegistryEntry
- type Registry
- type SharePrivateRequest
- type SharePublicRequest
- type UnifiedBootHandler
Constants ¶
const EnrollmentV = "1"
const RegistryV = "2"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessPrivateRequest ¶
type AccessRegistryEntry ¶
type AccessRegistryEntry struct {
Request *AccessPrivateRequest `json:"request"`
Failure *FailureEntry `json:"failure,omitempty"`
}
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func (*Agent) AccessPrivate ¶
func (a *Agent) AccessPrivate(req *AccessPrivateRequest) (frontendToken string, err error)
func (*Agent) Config ¶
func (a *Agent) Config() *AgentConfig
func (*Agent) ReleaseAccess ¶
func (*Agent) ReleaseShare ¶
func (*Agent) ReloadRegistry ¶
func (*Agent) SaveRegistry ¶
func (*Agent) ShareHttpHealthcheck ¶
func (*Agent) SharePrivate ¶
func (a *Agent) SharePrivate(req *SharePrivateRequest) (shareToken string, err error)
func (*Agent) SharePublic ¶
func (a *Agent) SharePublic(req *SharePublicRequest) (shareToken string, frontendEndpoint []string, err error)
type AgentConfig ¶
type AgentConfig struct {
ConsoleAddress string `json:"console_address"`
ConsoleStartPort uint16 `json:"console_start_port"`
ConsoleEndPort uint16 `json:"console_end_port"`
ConsoleEnabled bool `json:"console_enabled"`
RequireRemoting bool `json:"require_remoting"`
MaxRetries int `json:"max_retries,omitempty"`
RetryInitialDelay time.Duration `json:"retry_initial_delay,omitempty"`
RetryMaxDelay time.Duration `json:"retry_max_delay,omitempty"`
RetryCheckInterval time.Duration `json:"retry_check_interval,omitempty"`
}
func DefaultConfig ¶
func DefaultConfig() *AgentConfig
type BootHandlerConfig ¶
type BootHandlerConfig struct {
// StringFields maps message keys to functions that set string values
StringFields map[string]func(string)
// ArrayFields maps message keys to functions that set string array values
ArrayFields map[string]func([]string)
// OperationType for logging and debugging purposes
OperationType string
}
BootHandlerConfig defines the field mappings for extracting values from boot messages
type CommandBuilder ¶
type CommandBuilder struct {
// contains filtered or unexported fields
}
CommandBuilder provides a fluent interface for building zrok commands eliminating repetitive command construction patterns across the agent
func NewAccessPrivateCommand ¶
func NewAccessPrivateCommand() *CommandBuilder
NewAccessPrivateCommand creates a command builder for private access commands
func NewSharePrivateCommand ¶
func NewSharePrivateCommand() *CommandBuilder
NewSharePrivateCommand creates a command builder for private share commands
func NewSharePublicCommand ¶
func NewSharePublicCommand() *CommandBuilder
NewSharePublicCommand creates a command builder for public share commands
func (*CommandBuilder) AccessGrants ¶
func (cb *CommandBuilder) AccessGrants(grants []string) *CommandBuilder
AccessGrants adds multiple --access-grant options
func (*CommandBuilder) AddConditionalFlag ¶
func (cb *CommandBuilder) AddConditionalFlag(condition bool, flag string) *CommandBuilder
AddConditionalFlag adds a flag only if the condition is true
func (*CommandBuilder) AddFlag ¶
func (cb *CommandBuilder) AddFlag(flag string) *CommandBuilder
AddFlag adds a simple flag (e.g., --insecure, --open)
func (*CommandBuilder) AddMultipleOptions ¶
func (cb *CommandBuilder) AddMultipleOptions(option string, values []string) *CommandBuilder
AddMultipleOptions adds multiple instances of the same option
func (*CommandBuilder) AddOption ¶
func (cb *CommandBuilder) AddOption(option, value string) *CommandBuilder
AddOption adds an option with a value (e.g., --option value)
func (*CommandBuilder) AutoMode ¶
func (cb *CommandBuilder) AutoMode(auto bool, address string, startPort, endPort int) *CommandBuilder
AutoMode adds auto mode options for access commands
func (*CommandBuilder) BackendMode ¶
func (cb *CommandBuilder) BackendMode(mode string) *CommandBuilder
BackendMode adds the backend mode option (-b)
func (*CommandBuilder) BasicAuth ¶
func (cb *CommandBuilder) BasicAuth(auths []string) *CommandBuilder
BasicAuth adds multiple --basic-auth options
func (*CommandBuilder) BindAddress ¶
func (cb *CommandBuilder) BindAddress(address string) *CommandBuilder
BindAddress adds the bind address as a positional argument for access commands
func (*CommandBuilder) Build ¶
func (cb *CommandBuilder) Build() []string
Build returns the final command as a string slice
func (*CommandBuilder) Insecure ¶
func (cb *CommandBuilder) Insecure(insecure bool) *CommandBuilder
Insecure adds the --insecure flag if true
func (*CommandBuilder) NameSelections ¶
func (cb *CommandBuilder) NameSelections(selections []NameSelection) *CommandBuilder
NameSelections adds multiple --name-selection options with namespace:name format
func (*CommandBuilder) OauthEmailDomains ¶
func (cb *CommandBuilder) OauthEmailDomains(domains []string) *CommandBuilder
OauthEmailDomains adds multiple --oauth-email-domain options
func (*CommandBuilder) OauthProvider ¶
func (cb *CommandBuilder) OauthProvider(provider string) *CommandBuilder
OauthProvider adds the --oauth-provider option
func (*CommandBuilder) OauthRefreshInterval ¶
func (cb *CommandBuilder) OauthRefreshInterval(interval string) *CommandBuilder
OauthRefreshInterval adds the --oauth-refresh-interval option
func (*CommandBuilder) Open ¶
func (cb *CommandBuilder) Open(open bool) *CommandBuilder
Open adds the --open flag if true (note: inverted logic from Closed)
func (*CommandBuilder) ShareToken ¶
func (cb *CommandBuilder) ShareToken(token string) *CommandBuilder
ShareToken adds the --share-token option for private shares
func (*CommandBuilder) String ¶
func (cb *CommandBuilder) String() string
String returns a string representation of the command for debugging
func (*CommandBuilder) Target ¶
func (cb *CommandBuilder) Target(target string) *CommandBuilder
Target adds the target as the final argument
type Enrollment ¶
func LoadEnrollment ¶
func LoadEnrollment(path string) (*Enrollment, error)
func NewEnrollment ¶
func NewEnrollment(token string) *Enrollment
func (*Enrollment) Save ¶
func (e *Enrollment) Save(path string) error
type FailureEntry ¶
type NameSelection ¶
type PrivateShareRegistryEntry ¶
type PrivateShareRegistryEntry struct {
}
type PublicShareRegistryEntry ¶
type PublicShareRegistryEntry struct {
}
type Registry ¶
type Registry struct {
V string `json:"v"`
PrivateAccesses []*AccessRegistryEntry `json:"private_accesses,omitempty"`
}
func LoadRegistry ¶
type SharePrivateRequest ¶
type SharePrivateRequest struct {
}
type SharePublicRequest ¶
type SharePublicRequest struct {
}
type UnifiedBootHandler ¶
type UnifiedBootHandler struct {
// contains filtered or unexported fields
}
UnifiedBootHandler provides centralized boot message processing eliminating duplication across share and access operations
func NewAccessBootHandler ¶
func NewAccessBootHandler(acc *access, bootErr *error) *UnifiedBootHandler
NewAccessBootHandler creates a boot handler configured for access operations
func NewBootHandler ¶
func NewBootHandler(config *BootHandlerConfig, bootErr *error) *UnifiedBootHandler
NewBootHandler creates a new unified boot handler with the specified configuration
func NewShareBootHandler ¶
func NewShareBootHandler(shr *share, bootErr *error) *UnifiedBootHandler
NewShareBootHandler creates a boot handler configured for share operations
func (*UnifiedBootHandler) HandleBoot ¶
func (ubh *UnifiedBootHandler) HandleBoot(msgType string, msg subordinate.Message)
HandleBoot processes boot and error messages from subordinate processes
func (*UnifiedBootHandler) HandleMalformed ¶
func (ubh *UnifiedBootHandler) HandleMalformed(msg subordinate.Message)
HandleMalformed processes malformed messages from subordinate processes
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agentGrpc is a reverse proxy.
|
Package agentGrpc is a reverse proxy. |