service

package
v0.1.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemberStatusActive   = "ACTIVE"
	MemberStatusDisabled = "DISABLED"
)
View Source
const (
	FailurePolicyKeepEnabled               = "KEEP_ENABLED"
	FailurePolicyDisableWhenAllNodesFailed = "DISABLE_WHEN_ALL_NODES_FAILED"
	RuleDeploymentAggregateDisabled        = "DISABLED"
	RuleDeploymentStatusPending            = "PENDING"
	RuleDeploymentStatusApplied            = "APPLIED"
	RuleDeploymentStatusFailed             = "FAILED"
	RuleDeploymentAggregateNoNodes         = "NO_NODES"
	RuleDeploymentAggregateDeployFailed    = "DEPLOY_FAILED"
)

Variables

View Source
var ErrConflict = errors.New("conflict")
View Source
var ErrForbidden = errors.New("forbidden")
View Source
var ErrInvalidInput = errors.New("invalid input")
View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrQuotaExceeded = errors.New("quota exceeded")

Functions

This section is empty.

Types

type AgentAuthResult

type AgentAuthResult struct {
	OrganizationID          string
	AgentType               string
	AgentID                 string
	RegisteredWithToken     bool
	RegistrationTokenID     string
	AgentCredentialID       string
	AgentCredential         string
	AgentCredentialFileHint string
}

type AgentConfig

type AgentConfig = agent.ConfigSnapshot

func EmptyNodeAgentConfig

func EmptyNodeAgentConfig(nodeID string) AgentConfig

type AgentConfigCompiler

type AgentConfigCompiler interface {
	Compile(ctx context.Context, input AgentConfigInput) (AgentConfig, error)
}

type AgentConfigInput

type AgentConfigInput struct {
	NodeID     string
	NodeGroups []string
	Rules      []RuleConfig
}

type AgentHelloInput

type AgentHelloInput struct {
	Version    string
	Commit     string
	BuildTime  string
	RemoteAddr string
}

type AgentRuntimeMetricsInput

type AgentRuntimeMetricsInput struct {
	AgentID    string
	Status     string
	LastSeenAt string
	Metrics    agent.MetricsPayload
}

type AgentTrafficReportInput added in v0.1.18

type AgentTrafficReportInput struct {
	ReportID string
	Deltas   []agent.RuleTrafficDelta
}

type AgentUpdatePolicyInput

type AgentUpdatePolicyInput struct {
	Enabled bool `json:"enabled"`
}

type AgentUpgradeBatchInput

type AgentUpgradeBatchInput struct {
	NodeIDs []string `json:"node_ids"`
}

type Authorizer added in v0.1.11

type Authorizer interface {
	HasPermission(identity InternalIdentity, permission string) bool
	AllowedNodeGroupIDs(identity InternalIdentity, requestedAccess string) map[string]bool
	EnsureCanDelegateRoleScopes(ctx context.Context, repositories repo.Repositories, identity InternalIdentity, scopes []repo.ResourceScopeRecord) error
}

type BasicAgentConfigCompiler

type BasicAgentConfigCompiler struct{}

func (BasicAgentConfigCompiler) Compile

type BootstrapInput

type BootstrapInput struct {
	OrganizationName string
	OrganizationSlug string
	SourceIP         string
}

type ConfigApplyErrorInput added in v0.1.19

type ConfigApplyErrorInput struct {
	Code     string
	RuleIDs  []string
	Protocol domain.Protocol
	ListenIP string
	Port     int
	Message  string
}

type ControlService

type ControlService struct {
	// contains filtered or unexported fields
}

func NewControlService

func NewControlService(store repo.UnitOfWork) *ControlService

func NewControlServiceWithOptions

func NewControlServiceWithOptions(store repo.UnitOfWork, options ControlServiceOptions) *ControlService

func (*ControlService) AcknowledgeMonitorAgentConfig added in v0.1.19

func (service *ControlService) AcknowledgeMonitorAgentConfig(ctx context.Context, organizationID string, monitorID string, configVersion int) error

func (*ControlService) AcknowledgeNodeAgentConfig

func (service *ControlService) AcknowledgeNodeAgentConfig(ctx context.Context, organizationID string, nodeID string, configVersion int, status string, errorMessage string, applyErrors []ConfigApplyErrorInput) error

func (*ControlService) AddMember added in v0.1.11

func (service *ControlService) AddMember(ctx context.Context, identity InternalIdentity, input MemberMutationInput) (MemberPayload, error)

func (*ControlService) AgentReleaseVersion

func (service *ControlService) AgentReleaseVersion() string

func (*ControlService) AuthenticateAgentToken

func (service *ControlService) AuthenticateAgentToken(ctx context.Context, agentType string, token string) (AgentAuthResult, error)

func (*ControlService) AuthorizeNodeMetricsStream

func (service *ControlService) AuthorizeNodeMetricsStream(ctx context.Context, identity InternalIdentity, nodeID string) error

func (*ControlService) BatchRules

func (service *ControlService) BatchRules(ctx context.Context, identity InternalIdentity, input RuleBatchInput) (RuleBatchResult, error)

func (*ControlService) Bootstrap

func (service *ControlService) Bootstrap(ctx context.Context, identity WebUserIdentity, input BootstrapInput) (SessionResult, error)

func (*ControlService) CompileMonitorAgentConfig added in v0.1.19

func (service *ControlService) CompileMonitorAgentConfig(ctx context.Context, organizationID string, monitorID string) (agent.MonitorConfigSnapshot, error)

func (*ControlService) CompileNodeAgentConfig

func (service *ControlService) CompileNodeAgentConfig(ctx context.Context, organizationID string, nodeID string) (AgentConfig, error)

func (*ControlService) CopyRule

func (service *ControlService) CopyRule(ctx context.Context, identity InternalIdentity, ruleID string, input RuleCopyInput) (RulePayload, error)

func (*ControlService) CreateDNSCredential added in v0.1.19

func (service *ControlService) CreateDNSCredential(ctx context.Context, identity InternalIdentity, input DNSCredentialMutationInput) (DNSCredentialPayload, error)

func (*ControlService) CreateDNSInstance added in v0.1.20

func (service *ControlService) CreateDNSInstance(ctx context.Context, identity InternalIdentity, input DNSInstanceMutationInput) (DNSInstancePayload, error)

func (*ControlService) CreateDNSManagedRecord added in v0.1.20

func (service *ControlService) CreateDNSManagedRecord(ctx context.Context, identity InternalIdentity, input DNSManagedRecordMutationInput) (DNSManagedRecordPayload, error)

func (*ControlService) CreateHealthCheck added in v0.1.19

func (service *ControlService) CreateHealthCheck(ctx context.Context, identity InternalIdentity, input HealthCheckMutationInput) (HealthCheckPayload, error)

func (*ControlService) CreateHealthEvaluationRule added in v0.1.19

func (service *ControlService) CreateHealthEvaluationRule(ctx context.Context, identity InternalIdentity, input HealthEvaluationRuleMutationInput) (HealthEvaluationRulePayload, error)

func (*ControlService) CreateMonitor

func (service *ControlService) CreateMonitor(ctx context.Context, identity InternalIdentity, input MonitorMutationInput) (MonitorPayload, error)

func (*ControlService) CreateMonitorGroup

func (service *ControlService) CreateMonitorGroup(ctx context.Context, identity InternalIdentity, input GroupMutationInput) (MonitorGroupPayload, error)

func (*ControlService) CreateNode

func (service *ControlService) CreateNode(ctx context.Context, identity InternalIdentity, input NodeMutationInput) (NodePayload, error)

func (*ControlService) CreateNodeGroup

func (service *ControlService) CreateNodeGroup(ctx context.Context, identity InternalIdentity, input GroupMutationInput) (NodeGroupPayload, error)

func (*ControlService) CreateNotificationChannel added in v0.1.20

func (service *ControlService) CreateNotificationChannel(ctx context.Context, identity InternalIdentity, input NotificationChannelMutationInput) (NotificationChannelPayload, error)

func (*ControlService) CreateRegistrationToken

func (service *ControlService) CreateRegistrationToken(ctx context.Context, identity InternalIdentity, agentType string, agentID string, input RegistrationTokenInput) (RegistrationTokenPayload, error)

func (*ControlService) CreateRole added in v0.1.11

func (service *ControlService) CreateRole(ctx context.Context, identity InternalIdentity, input RoleMutationInput) (RolePayload, error)

func (*ControlService) CreateRule

func (service *ControlService) CreateRule(ctx context.Context, identity InternalIdentity, input RuleMutationInput) (RulePayload, error)

func (*ControlService) CreateTarget

func (service *ControlService) CreateTarget(ctx context.Context, identity InternalIdentity, input TargetMutationInput) (TargetPayload, error)

func (*ControlService) CreateTargetGroup

func (service *ControlService) CreateTargetGroup(ctx context.Context, identity InternalIdentity, input TargetGroupMutationInput) (TargetGroupPayload, error)

func (*ControlService) DeleteDNSCredential added in v0.1.19

func (service *ControlService) DeleteDNSCredential(ctx context.Context, identity InternalIdentity, credentialID string) error

func (*ControlService) DeleteDNSInstance added in v0.1.20

func (service *ControlService) DeleteDNSInstance(ctx context.Context, identity InternalIdentity, instanceID string) error

func (*ControlService) DeleteDNSManagedRecord added in v0.1.20

func (service *ControlService) DeleteDNSManagedRecord(ctx context.Context, identity InternalIdentity, recordID string) error

func (*ControlService) DeleteHealthCheck added in v0.1.19

func (service *ControlService) DeleteHealthCheck(ctx context.Context, identity InternalIdentity, healthCheckID string) error

func (*ControlService) DeleteMember added in v0.1.11

func (service *ControlService) DeleteMember(ctx context.Context, identity InternalIdentity, memberID string) error

func (*ControlService) DeleteMonitor

func (service *ControlService) DeleteMonitor(ctx context.Context, identity InternalIdentity, monitorID string) error

func (*ControlService) DeleteMonitorGroup

func (service *ControlService) DeleteMonitorGroup(ctx context.Context, identity InternalIdentity, monitorGroupID string) error

func (*ControlService) DeleteNode

func (service *ControlService) DeleteNode(ctx context.Context, identity InternalIdentity, nodeID string) error

func (*ControlService) DeleteNodeGroup

func (service *ControlService) DeleteNodeGroup(ctx context.Context, identity InternalIdentity, nodeGroupID string) error

func (*ControlService) DeleteNotificationChannel added in v0.1.20

func (service *ControlService) DeleteNotificationChannel(ctx context.Context, identity InternalIdentity, channelID string) error

func (*ControlService) DeleteRole added in v0.1.11

func (service *ControlService) DeleteRole(ctx context.Context, identity InternalIdentity, roleID string) error

func (*ControlService) DeleteRule

func (service *ControlService) DeleteRule(ctx context.Context, identity InternalIdentity, ruleID string) error

func (*ControlService) DeleteTarget

func (service *ControlService) DeleteTarget(ctx context.Context, identity InternalIdentity, targetID string) error

func (*ControlService) DeleteTargetGroup

func (service *ControlService) DeleteTargetGroup(ctx context.Context, identity InternalIdentity, targetGroupID string) error

func (*ControlService) DisableRule

func (service *ControlService) DisableRule(ctx context.Context, identity InternalIdentity, ruleID string) (RulePayload, error)

func (*ControlService) EnableRule

func (service *ControlService) EnableRule(ctx context.Context, identity InternalIdentity, ruleID string) (RulePayload, error)

func (*ControlService) EvaluateDNSManagedRecord added in v0.1.20

func (service *ControlService) EvaluateDNSManagedRecord(ctx context.Context, identity InternalIdentity, recordID string) (DNSManagedRecordPayload, error)

func (*ControlService) ExportRules

func (service *ControlService) ExportRules(ctx context.Context, identity InternalIdentity, ruleIDs []string) (RulesExportPayload, error)

func (*ControlService) FinalizeAgentRegistrationDelivery

func (service *ControlService) FinalizeAgentRegistrationDelivery(ctx context.Context, authResult AgentAuthResult) error

func (*ControlService) GetMonitor

func (service *ControlService) GetMonitor(ctx context.Context, identity InternalIdentity, monitorID string) (MonitorPayload, error)

func (*ControlService) GetNode

func (service *ControlService) GetNode(ctx context.Context, identity InternalIdentity, nodeID string) (NodePayload, error)

func (*ControlService) GetRule

func (service *ControlService) GetRule(ctx context.Context, identity InternalIdentity, ruleID string) (RulePayload, error)

func (*ControlService) ImportRules

func (service *ControlService) ImportRules(ctx context.Context, identity InternalIdentity, input RuleImportInput) (RulesImportResult, error)

func (*ControlService) ListDNSCredentials added in v0.1.19

func (service *ControlService) ListDNSCredentials(ctx context.Context, identity InternalIdentity) ([]DNSCredentialPayload, error)

func (*ControlService) ListDNSInstances added in v0.1.20

func (service *ControlService) ListDNSInstances(ctx context.Context, identity InternalIdentity) ([]DNSInstancePayload, error)

func (*ControlService) ListDNSManagedRecords added in v0.1.20

func (service *ControlService) ListDNSManagedRecords(ctx context.Context, identity InternalIdentity) ([]DNSManagedRecordPayload, error)

func (*ControlService) ListHealthChecks added in v0.1.19

func (service *ControlService) ListHealthChecks(ctx context.Context, identity InternalIdentity) ([]HealthCheckPayload, error)

func (*ControlService) ListHealthResults added in v0.1.19

func (service *ControlService) ListHealthResults(ctx context.Context, identity InternalIdentity, healthCheckID string) ([]HealthResultPayload, error)

func (*ControlService) ListMembers added in v0.1.11

func (service *ControlService) ListMembers(ctx context.Context, identity InternalIdentity) ([]MemberPayload, error)

func (*ControlService) ListMonitorGroups

func (service *ControlService) ListMonitorGroups(ctx context.Context, identity InternalIdentity) ([]MonitorGroupPayload, error)

func (*ControlService) ListMonitors

func (service *ControlService) ListMonitors(ctx context.Context, identity InternalIdentity) ([]MonitorPayload, error)

func (*ControlService) ListNodeGroupOptions

func (service *ControlService) ListNodeGroupOptions(ctx context.Context, identity InternalIdentity, accessLevel string) ([]ResourceOption, error)

func (*ControlService) ListNodeGroups

func (service *ControlService) ListNodeGroups(ctx context.Context, identity InternalIdentity) ([]NodeGroupPayload, error)

func (*ControlService) ListNodes

func (service *ControlService) ListNodes(ctx context.Context, identity InternalIdentity) ([]NodePayload, error)

func (*ControlService) ListNotificationChannels added in v0.1.20

func (service *ControlService) ListNotificationChannels(ctx context.Context, identity InternalIdentity) ([]NotificationChannelPayload, error)

func (*ControlService) ListRegistrationTokens

func (service *ControlService) ListRegistrationTokens(ctx context.Context, identity InternalIdentity, agentType string, agentID string) ([]RegistrationTokenPayload, error)

func (*ControlService) ListRoles added in v0.1.11

func (service *ControlService) ListRoles(ctx context.Context, identity InternalIdentity) ([]RolePayload, error)

func (*ControlService) ListRules

func (service *ControlService) ListRules(ctx context.Context, identity InternalIdentity) ([]RulePayload, error)

func (*ControlService) ListTargetGroups

func (service *ControlService) ListTargetGroups(ctx context.Context, identity InternalIdentity) ([]TargetGroupPayload, error)

func (*ControlService) ListTargets

func (service *ControlService) ListTargets(ctx context.Context, identity InternalIdentity) ([]TargetPayload, error)

func (*ControlService) MarkMonitorAgentConnected

func (service *ControlService) MarkMonitorAgentConnected(ctx context.Context, organizationID string, monitorID string) error

func (*ControlService) MarkMonitorAgentDisconnected

func (service *ControlService) MarkMonitorAgentDisconnected(ctx context.Context, organizationID string, monitorID string) error

func (*ControlService) MarkNodeAgentConnected

func (service *ControlService) MarkNodeAgentConnected(ctx context.Context, organizationID string, nodeID string) error

func (*ControlService) MarkNodeAgentConnectedFromRemote added in v0.1.20

func (service *ControlService) MarkNodeAgentConnectedFromRemote(ctx context.Context, organizationID string, nodeID string, remoteAddr string) error

func (*ControlService) MarkNodeAgentDisconnected

func (service *ControlService) MarkNodeAgentDisconnected(ctx context.Context, organizationID string, nodeID string) error

func (*ControlService) NodeAgentConfigBehind

func (service *ControlService) NodeAgentConfigBehind(ctx context.Context, organizationID string, nodeID string, appliedConfigVersion int) (bool, error)

func (*ControlService) NodeGroupListenIPOptions

func (service *ControlService) NodeGroupListenIPOptions(ctx context.Context, identity InternalIdentity, nodeGroupID string, protocol string, port int) ([]ResourceOption, error)

func (*ControlService) PendingNodeAgentUpdate

func (service *ControlService) PendingNodeAgentUpdate(ctx context.Context, organizationID string, nodeID string) (string, bool, error)

func (*ControlService) RecordMonitorHealthResults added in v0.1.19

func (service *ControlService) RecordMonitorHealthResults(ctx context.Context, organizationID string, monitorID string, results []HealthResultInput) error

func (*ControlService) RecordNodeAgentHello

func (service *ControlService) RecordNodeAgentHello(ctx context.Context, organizationID string, nodeID string, input AgentHelloInput) (NodePayload, bool, error)

func (*ControlService) RecordNodeAgentUpdateResult

func (service *ControlService) RecordNodeAgentUpdateResult(ctx context.Context, organizationID string, nodeID string, status string, errorMessage string) error

func (*ControlService) RecordNodeTrafficReport added in v0.1.18

func (service *ControlService) RecordNodeTrafficReport(ctx context.Context, organizationID string, nodeID string, input AgentTrafficReportInput) (bool, error)

func (*ControlService) RefreshDNSCredentialZones added in v0.1.20

func (service *ControlService) RefreshDNSCredentialZones(ctx context.Context, identity InternalIdentity, credentialID string) (DNSCredentialPayload, error)

func (*ControlService) ReleaseAgentRegistrationCredential

func (service *ControlService) ReleaseAgentRegistrationCredential(ctx context.Context, authResult AgentAuthResult) error

func (*ControlService) RequestNodeAgentUpgrade

func (service *ControlService) RequestNodeAgentUpgrade(ctx context.Context, identity InternalIdentity, nodeID string) (NodePayload, error)

func (*ControlService) RequestNodeAgentUpgrades

func (service *ControlService) RequestNodeAgentUpgrades(ctx context.Context, identity InternalIdentity, input AgentUpgradeBatchInput) ([]NodePayload, error)

func (*ControlService) RevokeRegistrationToken

func (service *ControlService) RevokeRegistrationToken(ctx context.Context, identity InternalIdentity, agentType string, agentID string, tokenID string) error

func (*ControlService) RuleDiagnostics

func (service *ControlService) RuleDiagnostics(ctx context.Context, identity InternalIdentity, ruleID string, runtimeStates []AgentRuntimeMetricsInput) (RuleDiagnosticsPayload, error)

func (*ControlService) RuleTraffic

func (service *ControlService) RuleTraffic(ctx context.Context, identity InternalIdentity, ruleID string) (RuleTrafficPayload, error)

func (*ControlService) SessionForInternalIdentity

func (service *ControlService) SessionForInternalIdentity(ctx context.Context, identity InternalIdentity) (SessionResult, error)

func (*ControlService) SessionForWebUser

func (service *ControlService) SessionForWebUser(ctx context.Context, identity WebUserIdentity) (SessionResult, error)

func (*ControlService) SupportedHealthActionTypes added in v0.1.19

func (service *ControlService) SupportedHealthActionTypes() []string

SupportedHealthActionTypes reports health action types available in this control service.

func (*ControlService) TargetGroupOptions

func (service *ControlService) TargetGroupOptions(ctx context.Context, identity InternalIdentity, protocol string) ([]ResourceOption, error)

func (*ControlService) TargetOptions

func (service *ControlService) TargetOptions(ctx context.Context, identity InternalIdentity, protocol string) ([]ResourceOption, error)

func (*ControlService) UpdateDNSCredential added in v0.1.19

func (service *ControlService) UpdateDNSCredential(ctx context.Context, identity InternalIdentity, credentialID string, input DNSCredentialMutationInput) (DNSCredentialPayload, error)

func (*ControlService) UpdateDNSInstance added in v0.1.20

func (service *ControlService) UpdateDNSInstance(ctx context.Context, identity InternalIdentity, instanceID string, input DNSInstanceMutationInput) (DNSInstancePayload, error)

func (*ControlService) UpdateDNSManagedRecord added in v0.1.20

func (service *ControlService) UpdateDNSManagedRecord(ctx context.Context, identity InternalIdentity, recordID string, input DNSManagedRecordMutationInput) (DNSManagedRecordPayload, error)

func (*ControlService) UpdateHealthCheck added in v0.1.19

func (service *ControlService) UpdateHealthCheck(ctx context.Context, identity InternalIdentity, healthCheckID string, input HealthCheckMutationInput) (HealthCheckPayload, error)

func (*ControlService) UpdateMember added in v0.1.11

func (service *ControlService) UpdateMember(ctx context.Context, identity InternalIdentity, memberID string, input MemberMutationInput) (MemberPayload, error)

func (*ControlService) UpdateMonitor

func (service *ControlService) UpdateMonitor(ctx context.Context, identity InternalIdentity, monitorID string, input MonitorMutationInput) (MonitorPayload, error)

func (*ControlService) UpdateMonitorGroup

func (service *ControlService) UpdateMonitorGroup(ctx context.Context, identity InternalIdentity, monitorGroupID string, input GroupMutationInput) (MonitorGroupPayload, error)

func (*ControlService) UpdateNode

func (service *ControlService) UpdateNode(ctx context.Context, identity InternalIdentity, nodeID string, input NodeMutationInput) (NodePayload, error)

func (*ControlService) UpdateNodeAgentUpdatePolicy

func (service *ControlService) UpdateNodeAgentUpdatePolicy(ctx context.Context, identity InternalIdentity, nodeID string, input AgentUpdatePolicyInput) (NodePayload, error)

func (*ControlService) UpdateNodeGroup

func (service *ControlService) UpdateNodeGroup(ctx context.Context, identity InternalIdentity, nodeGroupID string, input GroupMutationInput) (NodeGroupPayload, error)

func (*ControlService) UpdateNotificationChannel added in v0.1.20

func (service *ControlService) UpdateNotificationChannel(ctx context.Context, identity InternalIdentity, channelID string, input NotificationChannelMutationInput) (NotificationChannelPayload, error)

func (*ControlService) UpdateOrganization

func (service *ControlService) UpdateOrganization(ctx context.Context, identity InternalIdentity, input OrganizationUpdateInput) (OrganizationPayload, error)

func (*ControlService) UpdateRole added in v0.1.11

func (service *ControlService) UpdateRole(ctx context.Context, identity InternalIdentity, roleID string, input RoleMutationInput) (RolePayload, error)

func (*ControlService) UpdateRule

func (service *ControlService) UpdateRule(ctx context.Context, identity InternalIdentity, ruleID string, input RuleMutationInput) (RulePayload, error)

func (*ControlService) UpdateTarget

func (service *ControlService) UpdateTarget(ctx context.Context, identity InternalIdentity, targetID string, input TargetMutationInput) (TargetPayload, error)

func (*ControlService) UpdateTargetGroup

func (service *ControlService) UpdateTargetGroup(ctx context.Context, identity InternalIdentity, targetGroupID string, input TargetGroupMutationInput) (TargetGroupPayload, error)

func (*ControlService) ValidateAgentToken

func (service *ControlService) ValidateAgentToken(ctx context.Context, agentType string, token string) (AgentAuthResult, error)

type ControlServiceOptions

type ControlServiceOptions struct {
	AppName                 string
	ControlPlaneURL         string
	AgentReleaseVersion     string
	AgentTokenSigningSecret []byte
	Edition                 edition.Provider
	Authorizer              Authorizer
	SessionBackend          SessionBackend
	RBACBackend             RBACBackend
	TargetGroupSchedulers   TargetGroupSchedulerSupportFunc
	DNSSecretEncryptionKey  string
	DNSProviders            dns.ProviderRegistry
	HealthActionExecutors   []HealthActionExecutor
	HealthEventExecutors    []HealthEventExecutor
}

type DNSCredentialMutationInput added in v0.1.19

type DNSCredentialMutationInput struct {
	Name     string
	Provider string
	Secret   string
}

type DNSCredentialPayload added in v0.1.19

type DNSCredentialPayload struct {
	ID       string                     `json:"id"`
	Name     string                     `json:"name"`
	Provider string                     `json:"provider"`
	Zones    []DNSCredentialZonePayload `json:"zones"`
}

type DNSCredentialZonePayload added in v0.1.20

type DNSCredentialZonePayload struct {
	ID           string `json:"id"`
	ZoneID       string `json:"zone_id"`
	ZoneName     string `json:"zone_name"`
	Status       string `json:"status"`
	LastSyncedAt string `json:"last_synced_at"`
}

type DNSDiagnosticPayload added in v0.1.20

type DNSDiagnosticPayload struct {
	Code    string         `json:"code"`
	Message string         `json:"message"`
	Details map[string]any `json:"details,omitempty"`
}

type DNSInstanceMutationInput added in v0.1.20

type DNSInstanceMutationInput struct {
	ManagedRecordID        string
	Name                   string
	Priority               int
	Enabled                bool
	NodeGroupIDs           []string
	AnswerCount            int
	Condition              map[string]any
	Action                 map[string]any
	NotificationChannelIDs []string
}

type DNSInstancePayload added in v0.1.20

type DNSInstancePayload struct {
	ID                     string                 `json:"id"`
	ManagedRecordID        string                 `json:"managed_record_id"`
	Name                   string                 `json:"name"`
	Priority               int                    `json:"priority"`
	Enabled                bool                   `json:"enabled"`
	NodeGroupIDs           []string               `json:"node_group_ids"`
	AnswerCount            int                    `json:"answer_count"`
	Condition              map[string]any         `json:"condition"`
	Action                 map[string]any         `json:"action"`
	NotificationChannelIDs []string               `json:"notification_channel_ids"`
	LastOutputValues       []string               `json:"last_output_values"`
	LastStatus             string                 `json:"last_status"`
	LastDiagnostics        []DNSDiagnosticPayload `json:"last_diagnostics"`
	LastEvaluatedAt        string                 `json:"last_evaluated_at,omitempty"`
}

type DNSManagedRecordMutationInput added in v0.1.20

type DNSManagedRecordMutationInput struct {
	DNSCredentialID  string
	CredentialZoneID string
	RecordHost       string
	RecordName       string
	RecordType       string
	TTL              int
	Proxied          bool
}

type DNSManagedRecordPayload added in v0.1.20

type DNSManagedRecordPayload struct {
	ID                   string                 `json:"id"`
	DNSCredentialID      string                 `json:"dns_credential_id"`
	CredentialZoneID     string                 `json:"credential_zone_id"`
	ZoneID               string                 `json:"zone_id"`
	ZoneName             string                 `json:"zone_name"`
	RecordHost           string                 `json:"record_host"`
	RecordName           string                 `json:"record_name"`
	RecordType           string                 `json:"record_type"`
	TTL                  int                    `json:"ttl"`
	Proxied              bool                   `json:"proxied"`
	ActiveInstanceID     string                 `json:"active_instance_id,omitempty"`
	LastAppliedValues    []string               `json:"last_applied_values"`
	LastEvaluationStatus string                 `json:"last_evaluation_status"`
	LastEvaluationError  string                 `json:"last_evaluation_error,omitempty"`
	LastDiagnostics      []DNSDiagnosticPayload `json:"last_diagnostics"`
	LastEvaluatedAt      string                 `json:"last_evaluated_at,omitempty"`
	LastAppliedAt        string                 `json:"last_applied_at,omitempty"`
	Instances            []DNSInstancePayload   `json:"instances"`
}

type ErrorPayload

type ErrorPayload struct {
	Code    string         `json:"code"`
	Message string         `json:"message"`
	Details map[string]any `json:"details,omitempty"`
}

func ErrorPayloadForError

func ErrorPayloadForError(err error) ErrorPayload

type GroupMutationInput

type GroupMutationInput struct {
	Name        string
	Description string
}

type HealthActionExecutionInput added in v0.1.19

type HealthActionExecutionInput struct {
	OrganizationID string
	HealthCheck    repo.HealthCheckRecord
	Rule           repo.HealthEvaluationRuleRecord
	Event          repo.HealthEventRecord
	Result         repo.HealthResultRecord
	Results        []repo.HealthResultRecord
}

HealthActionExecutor is the extension point for side effects triggered by health evaluation rules. DNS failover is the OSS default action; webhook, email, and other action types can register here without changing monitor result ingestion.

type HealthActionExecutor added in v0.1.19

type HealthActionExecutor interface {
	Supports(eventType string) bool
	BuildAction(ctx context.Context, repositories repo.Repositories, input HealthActionExecutionInput) (any, bool, error)
	Execute(ctx context.Context, action any) error
}

type HealthActionRegistry added in v0.1.19

type HealthActionRegistry struct {
	// contains filtered or unexported fields
}

HealthActionRegistry owns the extension boundary between health evaluation and action side effects.

func NewHealthActionRegistry added in v0.1.19

func NewHealthActionRegistry(executors ...HealthActionExecutor) HealthActionRegistry

NewHealthActionRegistry builds an ordered health action registry.

func (HealthActionRegistry) ExecutorForType added in v0.1.19

func (registry HealthActionRegistry) ExecutorForType(eventType string) HealthActionExecutor

ExecutorForType returns the first executor that supports the normalized event type.

func (*HealthActionRegistry) Register added in v0.1.19

func (registry *HealthActionRegistry) Register(executor HealthActionExecutor)

Register appends an executor to the registry. Earlier executors win when multiple support a type.

func (HealthActionRegistry) SupportedHealthActionTypes added in v0.1.19

func (registry HealthActionRegistry) SupportedHealthActionTypes() []string

SupportedHealthActionTypes reports the stable set of advertised action types.

type HealthActionTypesProvider added in v0.1.19

type HealthActionTypesProvider interface {
	HealthActionTypes() []string
}

HealthActionTypesProvider lets action executors advertise concrete event types for API/UI capability discovery without coupling health evaluation to the event implementation.

type HealthCheckMutationInput added in v0.1.19

type HealthCheckMutationInput struct {
	Name            string
	ProbeType       string
	IntervalSeconds int
	TimeoutSeconds  int
	Enabled         bool
	TargetScope     HealthTargetScopeInput
	MonitorScope    HealthMonitorScopeInput
	ConfigJSON      string
}

type HealthCheckPayload added in v0.1.19

type HealthCheckPayload struct {
	ID              string                      `json:"id"`
	Name            string                      `json:"name"`
	ProbeType       string                      `json:"probe_type"`
	IntervalSeconds int                         `json:"interval_seconds"`
	TimeoutSeconds  int                         `json:"timeout_seconds"`
	Config          map[string]any              `json:"config"`
	Enabled         bool                        `json:"enabled"`
	TargetScope     HealthTargetScopePayload    `json:"target_scope"`
	Targets         []HealthCheckTargetPayload  `json:"targets"`
	MonitorScopes   []HealthMonitorScopePayload `json:"monitor_scopes"`
	LatestResults   []HealthResultPayload       `json:"latest_results"`
}

type HealthCheckTargetPayload added in v0.1.19

type HealthCheckTargetPayload struct {
	ID            string `json:"id"`
	ScopeType     string `json:"scope_type"`
	TargetID      string `json:"target_id"`
	TargetGroupID string `json:"target_group_id,omitempty"`
	TargetName    string `json:"target_name"`
	TargetHost    string `json:"target_host"`
	TargetPort    int    `json:"target_port"`
}

type HealthEvaluationRuleMutationInput added in v0.1.19

type HealthEvaluationRuleMutationInput struct {
	HealthCheckID  string
	Name           string
	Enabled        bool
	ExpressionJSON string
	Events         []HealthEventMutationInput
}

type HealthEvaluationRulePayload added in v0.1.19

type HealthEvaluationRulePayload struct {
	ID             string               `json:"id"`
	HealthCheckID  string               `json:"health_check_id"`
	Name           string               `json:"name"`
	Enabled        bool                 `json:"enabled"`
	ExpressionJSON string               `json:"expression_json"`
	Events         []HealthEventPayload `json:"events"`
	CreatedAt      string               `json:"created_at"`
	UpdatedAt      string               `json:"updated_at"`
}

type HealthEventExecutionInput added in v0.1.19

type HealthEventExecutionInput = HealthActionExecutionInput

type HealthEventExecutor added in v0.1.19

type HealthEventExecutor = HealthActionExecutor

type HealthEventMutationInput added in v0.1.19

type HealthEventMutationInput struct {
	EventType  string
	ConfigJSON string
	Secret     string
	Enabled    bool
}

type HealthEventPayload added in v0.1.19

type HealthEventPayload struct {
	ID         string `json:"id"`
	EventType  string `json:"event_type"`
	ConfigJSON string `json:"config_json"`
	Enabled    bool   `json:"enabled"`
	CreatedAt  string `json:"created_at"`
	UpdatedAt  string `json:"updated_at"`
}

type HealthMonitorScopeInput added in v0.1.19

type HealthMonitorScopeInput struct {
	Type           string
	MonitorID      string
	MonitorGroupID string
}

type HealthMonitorScopePayload added in v0.1.19

type HealthMonitorScopePayload struct {
	ID             string `json:"id"`
	ScopeType      string `json:"scope_type"`
	MonitorID      string `json:"monitor_id,omitempty"`
	MonitorGroupID string `json:"monitor_group_id,omitempty"`
}

type HealthResultInput added in v0.1.19

type HealthResultInput struct {
	HealthCheckID       string
	HealthCheckTargetID string
	TargetID            string
	Status              string
	LatencyMS           int
	ErrorMessage        string
	ObservedAt          string
}

type HealthResultPayload added in v0.1.19

type HealthResultPayload struct {
	ID                  string `json:"id"`
	HealthCheckID       string `json:"health_check_id"`
	HealthCheckTargetID string `json:"health_check_target_id"`
	MonitorID           string `json:"monitor_id"`
	TargetID            string `json:"target_id"`
	Status              string `json:"status"`
	LatencyMS           int    `json:"latency_ms"`
	ErrorMessage        string `json:"error_message,omitempty"`
	ObservedAt          string `json:"observed_at"`
	CreatedAt           string `json:"created_at"`
}

type HealthTargetScopeInput added in v0.1.19

type HealthTargetScopeInput struct {
	Type          string
	TargetIDs     []string
	TargetGroupID string
}

type HealthTargetScopePayload added in v0.1.20

type HealthTargetScopePayload struct {
	Type          string   `json:"type"`
	TargetIDs     []string `json:"target_ids,omitempty"`
	TargetGroupID string   `json:"target_group_id,omitempty"`
}

type InternalIdentity

type InternalIdentity struct {
	UserID         string
	OrganizationID string
	MemberID       string
	Roles          []string
	Permissions    []string
	ResourceScopes []ResourceScopePayload
	SourceIP       string
}

type MemberMutationInput

type MemberMutationInput struct {
	Email           string
	RoleIDs         []string
	RoleIDsProvided bool
	Status          string
}

type MemberPayload

type MemberPayload struct {
	ID      string   `json:"id"`
	UserID  string   `json:"user_id"`
	Email   string   `json:"email"`
	Name    string   `json:"name"`
	Status  string   `json:"status"`
	RoleIDs []string `json:"role_ids"`
}

type MonitorGroupPayload

type MonitorGroupPayload struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type MonitorMutationInput

type MonitorMutationInput struct {
	Name             string
	NameProvided     bool
	GroupIDs         []string
	GroupIDsProvided bool
}

type MonitorPayload

type MonitorPayload struct {
	ID                   string   `json:"id"`
	Name                 string   `json:"name"`
	Status               string   `json:"status"`
	DesiredConfigVersion int      `json:"desired_config_version"`
	AppliedConfigVersion int      `json:"applied_config_version"`
	LastSeenAt           string   `json:"last_seen_at,omitempty"`
	RegisteredAt         string   `json:"registered_at,omitempty"`
	GroupIDs             []string `json:"group_ids"`
}

type NodeDNSPublishAddressInput added in v0.1.20

type NodeDNSPublishAddressInput struct {
	AddressType string
	Address     string
	Enabled     bool
}

type NodeDNSPublishAddressPayload added in v0.1.20

type NodeDNSPublishAddressPayload struct {
	ID          string `json:"id,omitempty"`
	AddressType string `json:"address_type"`
	Address     string `json:"address"`
	Source      string `json:"source"`
	Enabled     bool   `json:"enabled"`
	ObservedAt  string `json:"observed_at,omitempty"`
}

type NodeGroupPayload

type NodeGroupPayload struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type NodeListenIPInput

type NodeListenIPInput struct {
	ListenIP    string
	DisplayName string
}

type NodeListenIPPayload

type NodeListenIPPayload struct {
	ID          string `json:"id,omitempty"`
	ListenIP    string `json:"listen_ip"`
	DisplayName string `json:"display_name"`
	Enabled     bool   `json:"enabled"`
}

type NodeMutationInput

type NodeMutationInput struct {
	Name                        string
	NameProvided                bool
	GroupIDs                    []string
	GroupIDsProvided            bool
	ListenIPs                   []NodeListenIPInput
	ListenIPsProvided           bool
	PortRanges                  []NodePortRangeInput
	PortRangesProvided          bool
	DNSPublishAddresses         []NodeDNSPublishAddressInput
	DNSPublishAddressesProvided bool
	PublicDescription           string
	PublicDescriptionProvided   bool
}

type NodePayload

type NodePayload struct {
	ID                     string                         `json:"id"`
	Name                   string                         `json:"name"`
	Status                 string                         `json:"status"`
	PublicDescription      string                         `json:"public_description"`
	DesiredConfigVersion   int                            `json:"desired_config_version"`
	AppliedConfigVersion   int                            `json:"applied_config_version"`
	ConfigStatus           string                         `json:"config_status"`
	ConfigErrorMessage     string                         `json:"config_error_message,omitempty"`
	ConfigStatusUpdatedAt  string                         `json:"config_status_updated_at,omitempty"`
	LastSeenAt             string                         `json:"last_seen_at,omitempty"`
	RegisteredAt           string                         `json:"registered_at,omitempty"`
	AgentVersion           string                         `json:"agent_version"`
	AgentCommit            string                         `json:"agent_commit"`
	AgentBuildTime         string                         `json:"agent_build_time"`
	AgentAutoUpdateEnabled bool                           `json:"agent_auto_update_enabled"`
	DesiredAgentVersion    string                         `json:"desired_agent_version"`
	AgentUpdateStatus      string                         `json:"agent_update_status"`
	AgentUpdateError       string                         `json:"agent_update_error,omitempty"`
	AgentUpdateStartedAt   string                         `json:"agent_update_started_at,omitempty"`
	AgentUpdateFinishedAt  string                         `json:"agent_update_finished_at,omitempty"`
	GroupIDs               []string                       `json:"group_ids"`
	ListenIPs              []NodeListenIPPayload          `json:"listen_ips"`
	PortRanges             []NodePortRangePayload         `json:"port_ranges"`
	DNSPublishAddresses    []NodeDNSPublishAddressPayload `json:"dns_publish_addresses"`
}

type NodePortRangeInput

type NodePortRangeInput struct {
	Protocol  string
	StartPort int
	EndPort   int
}

type NodePortRangePayload

type NodePortRangePayload struct {
	ID        string `json:"id,omitempty"`
	Protocol  string `json:"protocol"`
	StartPort int    `json:"start_port"`
	EndPort   int    `json:"end_port"`
	Enabled   bool   `json:"enabled"`
}

type NotificationChannelMutationInput added in v0.1.20

type NotificationChannelMutationInput struct {
	Name        string
	ChannelType string
	Config      map[string]any
	Secret      string
	Enabled     bool
}

type NotificationChannelPayload added in v0.1.20

type NotificationChannelPayload struct {
	ID          string         `json:"id"`
	Name        string         `json:"name"`
	ChannelType string         `json:"channel_type"`
	Config      map[string]any `json:"config"`
	Enabled     bool           `json:"enabled"`
}

type OrganizationPayload

type OrganizationPayload struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type OrganizationUpdateInput

type OrganizationUpdateInput struct {
	Name string
	Slug string
}

type PortableRulePayload

type PortableRulePayload struct {
	Name           string                      `json:"name"`
	Tags           []string                    `json:"tags"`
	FailurePolicy  string                      `json:"failure_policy,omitempty"`
	ForwardingType string                      `json:"forwarding_type"`
	Protocol       string                      `json:"protocol"`
	Port           int                         `json:"port"`
	Match          RuleMatchPayload            `json:"match"`
	ProxyProtocol  RuleProxyProtocolInput      `json:"proxy_protocol"`
	Upstream       PortableRuleUpstreamPayload `json:"upstream"`
}

type PortableRuleUpstreamPayload

type PortableRuleUpstreamPayload struct {
	Type           string `json:"type"`
	TargetRef      string `json:"target_ref,omitempty"`
	TargetGroupRef string `json:"target_group_ref,omitempty"`
}

type PortableTargetGroupMemberPayload

type PortableTargetGroupMemberPayload struct {
	TargetRef string `json:"target_ref"`
	Priority  int    `json:"priority"`
	Enabled   bool   `json:"enabled"`
}

type PortableTargetGroupPayload

type PortableTargetGroupPayload struct {
	Ref         string                             `json:"ref"`
	Name        string                             `json:"name"`
	Description string                             `json:"description"`
	Scheduler   string                             `json:"scheduler"`
	Members     []PortableTargetGroupMemberPayload `json:"members"`
}

type PortableTargetPayload

type PortableTargetPayload struct {
	Ref     string `json:"ref"`
	Name    string `json:"name"`
	Host    string `json:"host"`
	Port    int    `json:"port"`
	Enabled bool   `json:"enabled"`
}

type RBACBackend added in v0.1.11

type RBACBackend interface {
	ListMembers(ctx context.Context, identity InternalIdentity) ([]MemberPayload, error)
	AddMember(ctx context.Context, identity InternalIdentity, input MemberMutationInput) (MemberPayload, error)
	UpdateMember(ctx context.Context, identity InternalIdentity, memberID string, input MemberMutationInput) (MemberPayload, error)
	DeleteMember(ctx context.Context, identity InternalIdentity, memberID string) error
	ListRoles(ctx context.Context, identity InternalIdentity) ([]RolePayload, error)
	CreateRole(ctx context.Context, identity InternalIdentity, input RoleMutationInput) (RolePayload, error)
	UpdateRole(ctx context.Context, identity InternalIdentity, roleID string, input RoleMutationInput) (RolePayload, error)
	DeleteRole(ctx context.Context, identity InternalIdentity, roleID string) error
}

type RegistrationTokenInput

type RegistrationTokenInput struct {
	TTLHours int
}

type RegistrationTokenPayload

type RegistrationTokenPayload struct {
	TokenID         string `json:"token_id"`
	Token           string `json:"token,omitempty"`
	AgentType       string `json:"agent_type"`
	AgentID         string `json:"agent_id"`
	ExpiresAt       string `json:"expires_at"`
	UsedAt          string `json:"used_at,omitempty"`
	RevokedAt       string `json:"revoked_at,omitempty"`
	CreatedAt       string `json:"created_at"`
	CreatedByUserID string `json:"created_by_user_id,omitempty"`
	InstallCommand  string `json:"install_command,omitempty"`
}

type ResourceOption

type ResourceOption struct {
	Value          string `json:"value"`
	Label          string `json:"label"`
	Disabled       bool   `json:"disabled"`
	DisabledReason string `json:"disabled_reason,omitempty"`
}

type ResourceScopePayload

type ResourceScopePayload struct {
	ResourceType string `json:"resource_type"`
	ResourceID   string `json:"resource_id"`
	AccessLevel  string `json:"access_level"`
}

type RoleMutationInput

type RoleMutationInput struct {
	Name           string
	Description    string
	Permissions    []string
	ResourceScopes []ResourceScopePayload
}

type RolePayload

type RolePayload struct {
	ID             string                 `json:"id"`
	Key            string                 `json:"key"`
	Name           string                 `json:"name"`
	Description    string                 `json:"description"`
	IsSystem       bool                   `json:"is_system"`
	Permissions    []string               `json:"permissions"`
	ResourceScopes []ResourceScopePayload `json:"resource_scopes"`
}

type RuleBatchInput

type RuleBatchInput struct {
	Action  string
	RuleIDs []string
}

type RuleBatchItemResult

type RuleBatchItemResult struct {
	RuleID  string        `json:"rule_id"`
	Status  string        `json:"status"`
	Error   *ErrorPayload `json:"error,omitempty"`
	Warning string        `json:"warning,omitempty"`
}

type RuleBatchResult

type RuleBatchResult struct {
	Action    string                `json:"action"`
	Total     int                   `json:"total"`
	Succeeded int                   `json:"succeeded"`
	Failed    int                   `json:"failed"`
	Results   []RuleBatchItemResult `json:"results"`
}

type RuleConfig

type RuleConfig = agent.RuleConfig

type RuleConnectInfoPayload

type RuleConnectInfoPayload struct {
	Protocol         string   `json:"protocol"`
	ListenPort       int      `json:"listen_port"`
	ListenIP         string   `json:"listen_ip"`
	NodeDescriptions []string `json:"node_descriptions"`
}

type RuleCopyInput

type RuleCopyInput struct {
	Name    string
	Tags    []string
	TagsSet bool
}

type RuleDeploymentNodePayload added in v0.1.19

type RuleDeploymentNodePayload struct {
	NodeID       string `json:"node_id"`
	NodeName     string `json:"node_name"`
	Status       string `json:"status"`
	ErrorCode    string `json:"error_code,omitempty"`
	ErrorMessage string `json:"error_message,omitempty"`
	Protocol     string `json:"protocol,omitempty"`
	ListenIP     string `json:"listen_ip,omitempty"`
	Port         int    `json:"port,omitempty"`
	UpdatedAt    string `json:"updated_at,omitempty"`
}

type RuleDeploymentPayload added in v0.1.19

type RuleDeploymentPayload struct {
	Status  string                      `json:"status"`
	Total   int                         `json:"total"`
	Applied int                         `json:"applied"`
	Failed  int                         `json:"failed"`
	Pending int                         `json:"pending"`
	Nodes   []RuleDeploymentNodePayload `json:"nodes"`
}

type RuleDiagnosticsPayload

type RuleDiagnosticsPayload struct {
	RuleID        string                         `json:"rule_id"`
	GeneratedAt   string                         `json:"generated_at"`
	BandwidthBps  int64                          `json:"bandwidth_bps"`
	UploadBytes   int64                          `json:"upload_bytes"`
	DownloadBytes int64                          `json:"download_bytes"`
	Targets       []RuleTargetDiagnosticsPayload `json:"targets"`
}

type RuleImportEntry

type RuleImportEntry struct {
	NodeGroupID string `json:"node_group_id"`
	ListenIP    string `json:"listen_ip"`
}

type RuleImportInput

type RuleImportInput struct {
	DryRun     bool
	Entry      RuleImportEntry
	Format     string
	SourceText string
}

type RuleImportIssue

type RuleImportIssue struct {
	Code    string         `json:"code"`
	Scope   string         `json:"scope"`
	Index   *int           `json:"index,omitempty"`
	Details map[string]any `json:"details,omitempty"`
}

type RuleMatchInput

type RuleMatchInput struct {
	Type        string
	SNIHostname string
}

type RuleMatchPayload

type RuleMatchPayload struct {
	Type        string `json:"type"`
	SNIHostname string `json:"sni_hostname,omitempty"`
}

type RuleMutationInput

type RuleMutationInput struct {
	Name           string
	Tags           []string
	NodeGroupID    string
	ListenIP       string
	FailurePolicy  string
	ForwardingType string
	Protocol       string
	Port           int
	Match          RuleMatchInput
	ProxyProtocol  RuleProxyProtocolInput
	Upstream       RuleUpstreamInput
	Enabled        bool
	EnabledSet     bool
}

type RulePayload

type RulePayload struct {
	ID             string                 `json:"id"`
	Name           string                 `json:"name"`
	Status         string                 `json:"status"`
	Enabled        bool                   `json:"enabled"`
	Tags           []string               `json:"tags"`
	NodeGroupID    string                 `json:"node_group_id"`
	ListenIP       string                 `json:"listen_ip"`
	FailurePolicy  string                 `json:"failure_policy"`
	ForwardingType string                 `json:"forwarding_type"`
	Protocol       string                 `json:"protocol"`
	Port           int                    `json:"port"`
	Match          RuleMatchPayload       `json:"match"`
	ProxyProtocol  RuleProxyProtocolInput `json:"proxy_protocol"`
	Upstream       RuleUpstreamInput      `json:"upstream"`
	OwnerUserID    string                 `json:"owner_user_id"`
	ConfigVersion  int                    `json:"config_version"`
	ConnectInfo    RuleConnectInfoPayload `json:"connect_info"`
	Deployment     RuleDeploymentPayload  `json:"deployment"`
}

type RuleProxyProtocolInput

type RuleProxyProtocolInput struct {
	In  string `json:"in"`
	Out string `json:"out"`
}

type RuleTargetDiagnosticsPayload

type RuleTargetDiagnosticsPayload struct {
	TargetID            string `json:"target_id"`
	Name                string `json:"name"`
	Address             string `json:"address"`
	Status              string `json:"status"`
	LastSeenAt          string `json:"last_seen_at,omitempty"`
	LatencyMS           *int64 `json:"latency_ms"`
	BandwidthBps        *int64 `json:"bandwidth_bps"`
	UploadBytes         int64  `json:"upload_bytes"`
	DownloadBytes       int64  `json:"download_bytes"`
	TCPConnections      int64  `json:"tcp_connections"`
	UDPPacketsPerSecond int64  `json:"udp_packets_per_second"`
}

type RuleTrafficPayload

type RuleTrafficPayload struct {
	UploadBytes    int64  `json:"upload_bytes"`
	DownloadBytes  int64  `json:"download_bytes"`
	TCPConnections int64  `json:"tcp_connections"`
	UDPPackets     int64  `json:"udp_packets"`
	LimitBytes     int64  `json:"limit_bytes"`
	LimitMode      string `json:"limit_mode"`
}

type RuleUpstreamConfig

type RuleUpstreamConfig = agent.RuleUpstreamConfig

type RuleUpstreamInput

type RuleUpstreamInput struct {
	Type          string `json:"type"`
	TargetID      string `json:"target_id"`
	TargetGroupID string `json:"target_group_id"`
}

type RulesExportPayload

type RulesExportPayload struct {
	SchemaVersion string                       `json:"schema_version"`
	ExportedAt    string                       `json:"exported_at"`
	Rules         []PortableRulePayload        `json:"rules"`
	Targets       []PortableTargetPayload      `json:"targets"`
	TargetGroups  []PortableTargetGroupPayload `json:"target_groups"`
}

type RulesImportResult

type RulesImportResult struct {
	DryRun   bool              `json:"dry_run"`
	Created  int               `json:"created"`
	Skipped  int               `json:"skipped"`
	Errors   []RuleImportIssue `json:"errors"`
	Warnings []RuleImportIssue `json:"warnings"`
}

type SessionBackend added in v0.1.11

type SessionBackend interface {
	Bootstrap(ctx context.Context, identity WebUserIdentity, input BootstrapInput) (SessionResult, error)
	SessionForWebUser(ctx context.Context, identity WebUserIdentity) (SessionResult, error)
	SessionForInternalIdentity(ctx context.Context, identity InternalIdentity) (SessionResult, error)
}

type SessionResult

type SessionResult struct {
	Created        bool                   `json:"created"`
	User           UserPayload            `json:"user"`
	Organization   OrganizationPayload    `json:"organization"`
	Organizations  []OrganizationPayload  `json:"organizations"`
	Member         MemberPayload          `json:"member"`
	Roles          []RolePayload          `json:"roles"`
	Permissions    []string               `json:"permissions"`
	ResourceScopes []ResourceScopePayload `json:"resource_scopes"`
}

type TargetEndpoint

type TargetEndpoint = agent.TargetEndpoint

type TargetGroupMemberInput

type TargetGroupMemberInput struct {
	TargetID string
	Priority int
	Enabled  bool
}

type TargetGroupMemberPayload

type TargetGroupMemberPayload struct {
	TargetID string `json:"target_id"`
	Priority int    `json:"priority"`
	Enabled  bool   `json:"enabled"`
}

type TargetGroupMutationInput

type TargetGroupMutationInput struct {
	Name        string
	Description string
	Scheduler   string
	Members     []TargetGroupMemberInput
}

type TargetGroupPayload

type TargetGroupPayload struct {
	ID          string                     `json:"id"`
	Name        string                     `json:"name"`
	Description string                     `json:"description"`
	Scheduler   string                     `json:"scheduler"`
	Members     []TargetGroupMemberPayload `json:"members"`
}

type TargetGroupSchedulerSupportFunc added in v0.1.15

type TargetGroupSchedulerSupportFunc func(scheduler string) bool

type TargetMutationInput

type TargetMutationInput struct {
	Name                   string
	Host                   string
	Port                   int
	Enabled                bool
	TargetGroupIDs         []string
	TargetGroupIDsProvided bool
}

type TargetPayload

type TargetPayload struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Host    string `json:"host"`
	Port    int    `json:"port"`
	Enabled bool   `json:"enabled"`
}

type TargetPriorityBucket

type TargetPriorityBucket = agent.TargetPriorityBucket

type UserPayload

type UserPayload struct {
	ID    string `json:"id"`
	Email string `json:"email"`
	Name  string `json:"name"`
}

type WebUserIdentity

type WebUserIdentity struct {
	UserID string
	Email  string
	Name   string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL