validator

package
v0.1.18 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRequest = errors.New("invalid request")

Functions

This section is empty.

Types

type BootstrapRequest

type BootstrapRequest struct {
	OrganizationName string `json:"organization_name"`
	OrganizationSlug string `json:"organization_slug"`
}

func ValidateBootstrapRequest

func ValidateBootstrapRequest(request BootstrapRequest) (BootstrapRequest, error)

type GroupRequest

type GroupRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

func ValidateGroupRequest

func ValidateGroupRequest(request GroupRequest) (GroupRequest, error)

type MemberRequest

type MemberRequest struct {
	Email   string   `json:"email"`
	RoleIDs []string `json:"role_ids"`
	Status  string   `json:"status"`
}

func ValidateMemberRequest

func ValidateMemberRequest(request MemberRequest) (MemberRequest, error)

type MemberUpdateRequest

type MemberUpdateRequest struct {
	RoleIDs *[]string `json:"role_ids"`
	Status  string    `json:"status"`
}

func ValidateMemberUpdateRequest

func ValidateMemberUpdateRequest(request MemberUpdateRequest) (MemberUpdateRequest, error)

type MonitorPatchRequest

type MonitorPatchRequest struct {
	Name     *string   `json:"name"`
	GroupIDs *[]string `json:"group_ids"`
}

func ValidateMonitorPatchRequest

func ValidateMonitorPatchRequest(request MonitorPatchRequest) (MonitorPatchRequest, error)

type MonitorRequest

type MonitorRequest struct {
	Name     string   `json:"name"`
	GroupIDs []string `json:"group_ids"`
}

func ValidateMonitorRequest

func ValidateMonitorRequest(request MonitorRequest) (MonitorRequest, error)

type NodeListenIP

type NodeListenIP struct {
	ListenIP    string `json:"listen_ip"`
	DisplayName string `json:"display_name"`
}

type NodePatchRequest

type NodePatchRequest struct {
	Name              *string          `json:"name"`
	GroupIDs          *[]string        `json:"group_ids"`
	ListenIPs         *[]NodeListenIP  `json:"listen_ips"`
	PortRanges        *[]NodePortRange `json:"port_ranges"`
	PublicDescription *string          `json:"public_description"`
}

func ValidateNodePatchRequest

func ValidateNodePatchRequest(request NodePatchRequest) (NodePatchRequest, error)

type NodePortRange

type NodePortRange struct {
	Protocol  string `json:"protocol"`
	StartPort int    `json:"start_port"`
	EndPort   int    `json:"end_port"`
}

type NodeRequest

type NodeRequest struct {
	Name              string          `json:"name"`
	GroupIDs          []string        `json:"group_ids"`
	ListenIPs         []NodeListenIP  `json:"listen_ips"`
	PortRanges        []NodePortRange `json:"port_ranges"`
	PublicDescription string          `json:"public_description"`
}

func ValidateNodeRequest

func ValidateNodeRequest(request NodeRequest) (NodeRequest, error)

type OrganizationRequest

type OrganizationRequest struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
}

func ValidateOrganizationRequest

func ValidateOrganizationRequest(request OrganizationRequest) (OrganizationRequest, error)

type ProxyProtocolRequest

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

type RegistrationTokenRequest

type RegistrationTokenRequest struct {
	TTLHours int `json:"ttl_hours"`
}

func ValidateRegistrationTokenRequest

func ValidateRegistrationTokenRequest(request RegistrationTokenRequest) (RegistrationTokenRequest, error)

type ResourceScopeRequest

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

type RoleRequest

type RoleRequest struct {
	Name           string                 `json:"name"`
	Description    string                 `json:"description"`
	Permissions    []string               `json:"permissions"`
	ResourceScopes []ResourceScopeRequest `json:"resource_scopes"`
}

func ValidateRoleRequest

func ValidateRoleRequest(request RoleRequest) (RoleRequest, error)

type RuleBatchRequest

type RuleBatchRequest struct {
	Action  string   `json:"action"`
	RuleIDs []string `json:"rule_ids"`
}

func ValidateRuleBatchRequest

func ValidateRuleBatchRequest(request RuleBatchRequest) (RuleBatchRequest, error)

type RuleCopyRequest

type RuleCopyRequest struct {
	Name string    `json:"name"`
	Tags *[]string `json:"tags"`
}

func ValidateRuleCopyRequest

func ValidateRuleCopyRequest(request RuleCopyRequest) (RuleCopyRequest, error)

type RuleImportRequest

type RuleImportRequest struct {
	DryRun bool `json:"dry_run"`
}

type RuleMatchRequest

type RuleMatchRequest struct {
	Type        string `json:"type"`
	SNIHostname string `json:"sni_hostname"`
}

type RuleRequest

type RuleRequest struct {
	Name           string               `json:"name"`
	Tags           []string             `json:"tags"`
	NodeGroupID    string               `json:"node_group_id"`
	ListenIP       string               `json:"listen_ip"`
	ForwardingType string               `json:"forwarding_type"`
	Protocol       string               `json:"protocol"`
	Port           int                  `json:"port"`
	Match          RuleMatchRequest     `json:"match"`
	ProxyProtocol  ProxyProtocolRequest `json:"proxy_protocol"`
	Upstream       RuleUpstreamRequest  `json:"upstream"`
	Enabled        bool                 `json:"enabled"`
}

func ValidateRuleRequest

func ValidateRuleRequest(request RuleRequest) (RuleRequest, error)

type RuleUpstreamRequest

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

type TargetGroupMemberRequest

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

type TargetGroupRequest

type TargetGroupRequest struct {
	Name        string                     `json:"name"`
	Description string                     `json:"description"`
	Scheduler   string                     `json:"scheduler"`
	Members     []TargetGroupMemberRequest `json:"members"`
}

func ValidateTargetGroupRequest

func ValidateTargetGroupRequest(request TargetGroupRequest) (TargetGroupRequest, error)

type TargetRequest

type TargetRequest struct {
	Name           string    `json:"name"`
	Host           string    `json:"host"`
	Port           int       `json:"port"`
	Enabled        bool      `json:"enabled"`
	TargetGroupIDs *[]string `json:"target_group_ids"`
}

func ValidateTargetRequest

func ValidateTargetRequest(request TargetRequest) (TargetRequest, error)

type ValidationError

type ValidationError struct {
	Message string
	Details map[string]any
}

func (*ValidationError) Error

func (err *ValidationError) Error() string

func (*ValidationError) Unwrap

func (err *ValidationError) Unwrap() error

Jump to

Keyboard shortcuts

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