handlers

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package handlers provides HTTP handlers for the mock Cloudflare API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(w http.ResponseWriter, message string)

BadRequest writes a bad request error response.

func BoolPtr

func BoolPtr(b bool) *bool

BoolPtr returns a pointer to a bool.

func Conflict

func Conflict(w http.ResponseWriter, message string)

Conflict writes a conflict error response.

func Created

func Created[T any](w http.ResponseWriter, result T)

Created writes a successful creation response.

func Error

func Error(w http.ResponseWriter, status int, code int, message string)

Error writes an error response.

func GenerateID

func GenerateID() string

GenerateID generates a random UUID-like string.

func GenerateToken

func GenerateToken(length int) string

GenerateToken generates a random token string.

func GetPathParam

func GetPathParam(r *http.Request, name string) string

GetPathParam extracts a path parameter from the request.

func GetQueryParam

func GetQueryParam(r *http.Request, name string) string

GetQueryParam extracts a query parameter from the request.

func InternalError

func InternalError(w http.ResponseWriter, message string)

InternalError writes an internal server error response.

func NotFound

func NotFound(w http.ResponseWriter, resource string)

NotFound writes a not found error response.

func ReadJSON

func ReadJSON[T any](r *http.Request) (*T, error)

ReadJSON reads and unmarshals JSON from the request body.

func Response

func Response[T any](w http.ResponseWriter, status int, result T, errors []models.APIError)

Response writes a standard Cloudflare API response.

func ResponseWithResultInfo

func ResponseWithResultInfo[T any](w http.ResponseWriter, status int, result T, resultInfo *models.ResultInfo)

ResponseWithResultInfo writes a response with pagination info.

func Success

func Success[T any](w http.ResponseWriter, result T)

Success writes a successful response.

Types

type AccessApplicationCreateRequest

type AccessApplicationCreateRequest struct {
	Name                    string                      `json:"name"`
	Domain                  string                      `json:"domain"`
	Type                    string                      `json:"type"`
	SessionDuration         string                      `json:"session_duration"`
	AutoRedirectToIdentity  bool                        `json:"auto_redirect_to_identity"`
	EnableBindingCookie     bool                        `json:"enable_binding_cookie"`
	CustomDenyMessage       string                      `json:"custom_deny_message"`
	CustomDenyURL           string                      `json:"custom_deny_url"`
	SameSiteCookieAttribute string                      `json:"same_site_cookie_attribute"`
	LogoURL                 string                      `json:"logo_url"`
	SkipInterstitial        bool                        `json:"skip_interstitial"`
	AppLauncherVisible      bool                        `json:"app_launcher_visible"`
	ServiceAuth401Redirect  bool                        `json:"service_auth_401_redirect"`
	AllowedIdps             []string                    `json:"allowed_idps"`
	SelfHostedDomains       []string                    `json:"self_hosted_domains"`
	Destinations            []models.AccessDestination  `json:"destinations"`
	Policies                []AccessPolicyCreateRequest `json:"policies"`
}

AccessApplicationCreateRequest represents an access application creation request.

type AccessGroupCreateRequest

type AccessGroupCreateRequest struct {
	Name    string              `json:"name"`
	Include []models.AccessRule `json:"include"`
	Exclude []models.AccessRule `json:"exclude"`
	Require []models.AccessRule `json:"require"`
}

AccessGroupCreateRequest represents an access group creation request.

type AccessIdentityProviderCreateRequest

type AccessIdentityProviderCreateRequest struct {
	Name   string                 `json:"name"`
	Type   string                 `json:"type"`
	Config map[string]interface{} `json:"config"`
}

AccessIdentityProviderCreateRequest represents an IdP creation request.

type AccessPolicyCreateRequest

type AccessPolicyCreateRequest struct {
	Name       string              `json:"name"`
	Precedence int                 `json:"precedence"`
	Decision   string              `json:"decision"`
	Include    []models.AccessRule `json:"include"`
	Exclude    []models.AccessRule `json:"exclude"`
	Require    []models.AccessRule `json:"require"`
}

AccessPolicyCreateRequest represents an access policy creation request.

type AccessServiceTokenCreateRequest

type AccessServiceTokenCreateRequest struct {
	Name     string `json:"name"`
	Duration string `json:"duration"`
}

AccessServiceTokenCreateRequest represents a service token creation request.

type DNSRecordCreateRequest

type DNSRecordCreateRequest struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Content  string `json:"content"`
	TTL      int    `json:"ttl"`
	Proxied  *bool  `json:"proxied"`
	Priority *int   `json:"priority"`
	Comment  string `json:"comment"`
}

DNSRecordCreateRequest represents a DNS record creation request.

type DNSRecordUpdateRequest

type DNSRecordUpdateRequest struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Content  string `json:"content"`
	TTL      int    `json:"ttl"`
	Proxied  *bool  `json:"proxied"`
	Priority *int   `json:"priority"`
	Comment  string `json:"comment"`
}

DNSRecordUpdateRequest represents a DNS record update request.

type DevicePostureRuleCreateRequest

type DevicePostureRuleCreateRequest struct {
	Name        string                      `json:"name"`
	Description string                      `json:"description"`
	Type        string                      `json:"type"`
	Schedule    string                      `json:"schedule"`
	Expiration  string                      `json:"expiration"`
	Match       []models.DevicePostureMatch `json:"match"`
	Input       map[string]interface{}      `json:"input"`
}

DevicePostureRuleCreateRequest represents a device posture rule creation request.

type GatewayListCreateRequest

type GatewayListCreateRequest struct {
	Name        string                   `json:"name"`
	Description string                   `json:"description"`
	Type        string                   `json:"type"`
	Items       []models.GatewayListItem `json:"items"`
}

GatewayListCreateRequest represents a gateway list creation request.

type GatewayRuleCreateRequest

type GatewayRuleCreateRequest struct {
	Name         string                 `json:"name"`
	Description  string                 `json:"description"`
	Precedence   int                    `json:"precedence"`
	Enabled      bool                   `json:"enabled"`
	Action       string                 `json:"action"`
	Filters      []string               `json:"filters"`
	Traffic      string                 `json:"traffic"`
	Identity     string                 `json:"identity"`
	RuleSettings map[string]interface{} `json:"rule_settings"`
}

GatewayRuleCreateRequest represents a gateway rule creation request.

type Handlers

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

Handlers provides HTTP handlers for the mock API.

func NewHandlers

func NewHandlers(s *store.Store) *Handlers

NewHandlers creates a new Handlers instance.

func (*Handlers) CleanupTunnelConnections

func (h *Handlers) CleanupTunnelConnections(w http.ResponseWriter, r *http.Request)

CleanupTunnelConnections handles DELETE /accounts/{accountId}/cfd_tunnel/{tunnelId}/connections.

func (*Handlers) CreateAccessApplication

func (h *Handlers) CreateAccessApplication(w http.ResponseWriter, r *http.Request)

CreateAccessApplication handles POST /accounts/{accountId}/access/apps.

func (*Handlers) CreateAccessGroup

func (h *Handlers) CreateAccessGroup(w http.ResponseWriter, r *http.Request)

CreateAccessGroup handles POST /accounts/{accountId}/access/groups.

func (*Handlers) CreateAccessIdentityProvider

func (h *Handlers) CreateAccessIdentityProvider(w http.ResponseWriter, r *http.Request)

CreateAccessIdentityProvider handles POST /accounts/{accountId}/access/identity_providers.

func (*Handlers) CreateAccessPolicy

func (h *Handlers) CreateAccessPolicy(w http.ResponseWriter, r *http.Request)

CreateAccessPolicy handles POST /accounts/{accountId}/access/apps/{appId}/policies.

func (*Handlers) CreateAccessServiceToken

func (h *Handlers) CreateAccessServiceToken(w http.ResponseWriter, r *http.Request)

CreateAccessServiceToken handles POST /accounts/{accountId}/access/service_tokens.

func (*Handlers) CreateDNSRecord

func (h *Handlers) CreateDNSRecord(w http.ResponseWriter, r *http.Request)

CreateDNSRecord handles POST /zones/{zoneId}/dns_records.

func (*Handlers) CreateDevicePostureRule

func (h *Handlers) CreateDevicePostureRule(w http.ResponseWriter, r *http.Request)

CreateDevicePostureRule handles POST /accounts/{accountId}/devices/posture.

func (*Handlers) CreateGatewayList

func (h *Handlers) CreateGatewayList(w http.ResponseWriter, r *http.Request)

CreateGatewayList handles POST /accounts/{accountId}/gateway/lists.

func (*Handlers) CreateGatewayRule

func (h *Handlers) CreateGatewayRule(w http.ResponseWriter, r *http.Request)

CreateGatewayRule handles POST /accounts/{accountId}/gateway/rules.

func (*Handlers) CreateR2Bucket

func (h *Handlers) CreateR2Bucket(w http.ResponseWriter, r *http.Request)

CreateR2Bucket handles PUT /accounts/{accountId}/r2/buckets.

func (*Handlers) CreateTunnel

func (h *Handlers) CreateTunnel(w http.ResponseWriter, r *http.Request)

CreateTunnel handles POST /accounts/{accountId}/cfd_tunnel.

func (*Handlers) CreateTunnelRoute

func (h *Handlers) CreateTunnelRoute(w http.ResponseWriter, r *http.Request)

CreateTunnelRoute handles POST /accounts/{accountId}/teamnet/routes/network/{network}. Note: cloudflare-go SDK passes network in URL path, not request body.

func (*Handlers) CreateVirtualNetwork

func (h *Handlers) CreateVirtualNetwork(w http.ResponseWriter, r *http.Request)

CreateVirtualNetwork handles POST /accounts/{accountId}/teamnet/virtual_networks.

func (*Handlers) CreateZoneRuleset

func (h *Handlers) CreateZoneRuleset(w http.ResponseWriter, r *http.Request)

CreateZoneRuleset handles POST /zones/{zoneId}/rulesets.

func (*Handlers) DeleteAccessApplication

func (h *Handlers) DeleteAccessApplication(w http.ResponseWriter, r *http.Request)

DeleteAccessApplication handles DELETE /accounts/{accountId}/access/apps/{appId}.

func (*Handlers) DeleteAccessGroup

func (h *Handlers) DeleteAccessGroup(w http.ResponseWriter, r *http.Request)

DeleteAccessGroup handles DELETE /accounts/{accountId}/access/groups/{groupId}.

func (*Handlers) DeleteAccessIdentityProvider

func (h *Handlers) DeleteAccessIdentityProvider(w http.ResponseWriter, r *http.Request)

DeleteAccessIdentityProvider handles DELETE /accounts/{accountId}/access/identity_providers/{idpId}.

func (*Handlers) DeleteAccessPolicy

func (h *Handlers) DeleteAccessPolicy(w http.ResponseWriter, r *http.Request)

DeleteAccessPolicy handles DELETE /accounts/{accountId}/access/apps/{appId}/policies/{policyId}.

func (*Handlers) DeleteAccessServiceToken

func (h *Handlers) DeleteAccessServiceToken(w http.ResponseWriter, r *http.Request)

DeleteAccessServiceToken handles DELETE /accounts/{accountId}/access/service_tokens/{tokenId}.

func (*Handlers) DeleteDNSRecord

func (h *Handlers) DeleteDNSRecord(w http.ResponseWriter, r *http.Request)

DeleteDNSRecord handles DELETE /zones/{zoneId}/dns_records/{recordId}.

func (*Handlers) DeleteDevicePostureRule

func (h *Handlers) DeleteDevicePostureRule(w http.ResponseWriter, r *http.Request)

DeleteDevicePostureRule handles DELETE /accounts/{accountId}/devices/posture/{ruleId}.

func (*Handlers) DeleteGatewayList

func (h *Handlers) DeleteGatewayList(w http.ResponseWriter, r *http.Request)

DeleteGatewayList handles DELETE /accounts/{accountId}/gateway/lists/{listId}.

func (*Handlers) DeleteGatewayRule

func (h *Handlers) DeleteGatewayRule(w http.ResponseWriter, r *http.Request)

DeleteGatewayRule handles DELETE /accounts/{accountId}/gateway/rules/{ruleId}.

func (*Handlers) DeleteR2Bucket

func (h *Handlers) DeleteR2Bucket(w http.ResponseWriter, r *http.Request)

DeleteR2Bucket handles DELETE /accounts/{accountId}/r2/buckets/{bucketName}.

func (*Handlers) DeleteTunnel

func (h *Handlers) DeleteTunnel(w http.ResponseWriter, r *http.Request)

DeleteTunnel handles DELETE /accounts/{accountId}/cfd_tunnel/{tunnelId}.

func (*Handlers) DeleteTunnelRoute

func (h *Handlers) DeleteTunnelRoute(w http.ResponseWriter, r *http.Request)

DeleteTunnelRoute handles DELETE /accounts/{accountId}/teamnet/routes/network/{network}.

func (*Handlers) DeleteVirtualNetwork

func (h *Handlers) DeleteVirtualNetwork(w http.ResponseWriter, r *http.Request)

DeleteVirtualNetwork handles DELETE /accounts/{accountId}/teamnet/virtual_networks/{vnetId}.

func (*Handlers) DeleteZoneRuleset

func (h *Handlers) DeleteZoneRuleset(w http.ResponseWriter, r *http.Request)

DeleteZoneRuleset handles DELETE /zones/{zoneId}/rulesets/{rulesetId}.

func (*Handlers) GetAccessApplication

func (h *Handlers) GetAccessApplication(w http.ResponseWriter, r *http.Request)

GetAccessApplication handles GET /accounts/{accountId}/access/apps/{appId}.

func (*Handlers) GetAccessGroup

func (h *Handlers) GetAccessGroup(w http.ResponseWriter, r *http.Request)

GetAccessGroup handles GET /accounts/{accountId}/access/groups/{groupId}.

func (*Handlers) GetAccessIdentityProvider

func (h *Handlers) GetAccessIdentityProvider(w http.ResponseWriter, r *http.Request)

GetAccessIdentityProvider handles GET /accounts/{accountId}/access/identity_providers/{idpId}.

func (*Handlers) GetAccessPolicy

func (h *Handlers) GetAccessPolicy(w http.ResponseWriter, r *http.Request)

GetAccessPolicy handles GET /accounts/{accountId}/access/apps/{appId}/policies/{policyId}.

func (*Handlers) GetAccessServiceToken

func (h *Handlers) GetAccessServiceToken(w http.ResponseWriter, r *http.Request)

GetAccessServiceToken handles GET /accounts/{accountId}/access/service_tokens/{tokenId}.

func (*Handlers) GetAccount

func (h *Handlers) GetAccount(w http.ResponseWriter, r *http.Request)

GetAccount handles GET /accounts/{accountId}.

func (*Handlers) GetDNSRecord

func (h *Handlers) GetDNSRecord(w http.ResponseWriter, r *http.Request)

GetDNSRecord handles GET /zones/{zoneId}/dns_records/{recordId}.

func (*Handlers) GetDevicePostureRule

func (h *Handlers) GetDevicePostureRule(w http.ResponseWriter, r *http.Request)

GetDevicePostureRule handles GET /accounts/{accountId}/devices/posture/{ruleId}.

func (*Handlers) GetFallbackDomains

func (h *Handlers) GetFallbackDomains(w http.ResponseWriter, r *http.Request)

GetFallbackDomains handles GET /accounts/{accountId}/devices/policy/fallback_domains.

func (*Handlers) GetGatewayConfiguration

func (h *Handlers) GetGatewayConfiguration(w http.ResponseWriter, r *http.Request)

GetGatewayConfiguration handles GET /accounts/{accountId}/gateway/configuration.

func (*Handlers) GetGatewayList

func (h *Handlers) GetGatewayList(w http.ResponseWriter, r *http.Request)

GetGatewayList handles GET /accounts/{accountId}/gateway/lists/{listId}.

func (*Handlers) GetGatewayRule

func (h *Handlers) GetGatewayRule(w http.ResponseWriter, r *http.Request)

GetGatewayRule handles GET /accounts/{accountId}/gateway/rules/{ruleId}.

func (*Handlers) GetR2Bucket

func (h *Handlers) GetR2Bucket(w http.ResponseWriter, r *http.Request)

GetR2Bucket handles GET /accounts/{accountId}/r2/buckets/{bucketName}.

func (*Handlers) GetR2BucketLifecycle

func (h *Handlers) GetR2BucketLifecycle(w http.ResponseWriter, r *http.Request)

GetR2BucketLifecycle handles GET /accounts/{accountId}/r2/buckets/{bucketName}/lifecycle.

func (*Handlers) GetSplitTunnelExclude

func (h *Handlers) GetSplitTunnelExclude(w http.ResponseWriter, r *http.Request)

GetSplitTunnelExclude handles GET /accounts/{accountId}/devices/policy/exclude.

func (*Handlers) GetSplitTunnelInclude

func (h *Handlers) GetSplitTunnelInclude(w http.ResponseWriter, r *http.Request)

GetSplitTunnelInclude handles GET /accounts/{accountId}/devices/policy/include.

func (*Handlers) GetTunnel

func (h *Handlers) GetTunnel(w http.ResponseWriter, r *http.Request)

GetTunnel handles GET /accounts/{accountId}/cfd_tunnel/{tunnelId}.

func (*Handlers) GetTunnelConfiguration

func (h *Handlers) GetTunnelConfiguration(w http.ResponseWriter, r *http.Request)

GetTunnelConfiguration handles GET /accounts/{accountId}/cfd_tunnel/{tunnelId}/configurations.

func (*Handlers) GetTunnelToken

func (h *Handlers) GetTunnelToken(w http.ResponseWriter, r *http.Request)

GetTunnelToken handles GET /accounts/{accountId}/cfd_tunnel/{tunnelId}/token.

func (*Handlers) GetVirtualNetwork

func (h *Handlers) GetVirtualNetwork(w http.ResponseWriter, r *http.Request)

GetVirtualNetwork handles GET /accounts/{accountId}/teamnet/virtual_networks/{vnetId}.

func (*Handlers) GetZone

func (h *Handlers) GetZone(w http.ResponseWriter, r *http.Request)

GetZone handles GET /zones/{zoneId}.

func (*Handlers) GetZoneRuleset

func (h *Handlers) GetZoneRuleset(w http.ResponseWriter, r *http.Request)

GetZoneRuleset handles GET /zones/{zoneId}/rulesets/{rulesetId}.

func (*Handlers) GetZoneRulesetByPhase

func (h *Handlers) GetZoneRulesetByPhase(w http.ResponseWriter, r *http.Request)

GetZoneRulesetByPhase handles GET /zones/{zoneId}/rulesets/phases/{phase}/entrypoint.

func (*Handlers) ListAccessApplications

func (h *Handlers) ListAccessApplications(w http.ResponseWriter, r *http.Request)

ListAccessApplications handles GET /accounts/{accountId}/access/apps.

func (*Handlers) ListAccessGroups

func (h *Handlers) ListAccessGroups(w http.ResponseWriter, r *http.Request)

ListAccessGroups handles GET /accounts/{accountId}/access/groups.

func (*Handlers) ListAccessIdentityProviders

func (h *Handlers) ListAccessIdentityProviders(w http.ResponseWriter, r *http.Request)

ListAccessIdentityProviders handles GET /accounts/{accountId}/access/identity_providers.

func (*Handlers) ListAccessPolicies

func (h *Handlers) ListAccessPolicies(w http.ResponseWriter, r *http.Request)

ListAccessPolicies handles GET /accounts/{accountId}/access/apps/{appId}/policies.

func (*Handlers) ListAccessServiceTokens

func (h *Handlers) ListAccessServiceTokens(w http.ResponseWriter, r *http.Request)

ListAccessServiceTokens handles GET /accounts/{accountId}/access/service_tokens.

func (*Handlers) ListAccounts

func (h *Handlers) ListAccounts(w http.ResponseWriter, r *http.Request)

ListAccounts handles GET /accounts.

func (*Handlers) ListDNSRecords

func (h *Handlers) ListDNSRecords(w http.ResponseWriter, r *http.Request)

ListDNSRecords handles GET /zones/{zoneId}/dns_records.

func (*Handlers) ListDevicePostureRules

func (h *Handlers) ListDevicePostureRules(w http.ResponseWriter, r *http.Request)

ListDevicePostureRules handles GET /accounts/{accountId}/devices/posture.

func (*Handlers) ListGatewayLists

func (h *Handlers) ListGatewayLists(w http.ResponseWriter, r *http.Request)

ListGatewayLists handles GET /accounts/{accountId}/gateway/lists.

func (*Handlers) ListGatewayRules

func (h *Handlers) ListGatewayRules(w http.ResponseWriter, r *http.Request)

ListGatewayRules handles GET /accounts/{accountId}/gateway/rules.

func (*Handlers) ListR2Buckets

func (h *Handlers) ListR2Buckets(w http.ResponseWriter, r *http.Request)

ListR2Buckets handles GET /accounts/{accountId}/r2/buckets.

func (*Handlers) ListTunnelRoutes

func (h *Handlers) ListTunnelRoutes(w http.ResponseWriter, r *http.Request)

ListTunnelRoutes handles GET /accounts/{accountId}/teamnet/routes.

func (*Handlers) ListTunnels

func (h *Handlers) ListTunnels(w http.ResponseWriter, r *http.Request)

ListTunnels handles GET /accounts/{accountId}/cfd_tunnel.

func (*Handlers) ListVirtualNetworks

func (h *Handlers) ListVirtualNetworks(w http.ResponseWriter, r *http.Request)

ListVirtualNetworks handles GET /accounts/{accountId}/teamnet/virtual_networks.

func (*Handlers) ListZoneRulesets

func (h *Handlers) ListZoneRulesets(w http.ResponseWriter, r *http.Request)

ListZoneRulesets handles GET /zones/{zoneId}/rulesets.

func (*Handlers) ListZones

func (h *Handlers) ListZones(w http.ResponseWriter, r *http.Request)

ListZones handles GET /zones.

func (*Handlers) RefreshAccessServiceToken

func (h *Handlers) RefreshAccessServiceToken(w http.ResponseWriter, r *http.Request)

RefreshAccessServiceToken handles POST /accounts/{accountId}/access/service_tokens/{tokenId}/refresh.

func (*Handlers) UpdateAccessApplication

func (h *Handlers) UpdateAccessApplication(w http.ResponseWriter, r *http.Request)

UpdateAccessApplication handles PUT /accounts/{accountId}/access/apps/{appId}.

func (*Handlers) UpdateAccessGroup

func (h *Handlers) UpdateAccessGroup(w http.ResponseWriter, r *http.Request)

UpdateAccessGroup handles PUT /accounts/{accountId}/access/groups/{groupId}.

func (*Handlers) UpdateAccessIdentityProvider

func (h *Handlers) UpdateAccessIdentityProvider(w http.ResponseWriter, r *http.Request)

UpdateAccessIdentityProvider handles PUT /accounts/{accountId}/access/identity_providers/{idpId}.

func (*Handlers) UpdateAccessPolicy

func (h *Handlers) UpdateAccessPolicy(w http.ResponseWriter, r *http.Request)

UpdateAccessPolicy handles PUT /accounts/{accountId}/access/apps/{appId}/policies/{policyId}.

func (*Handlers) UpdateAccessServiceToken

func (h *Handlers) UpdateAccessServiceToken(w http.ResponseWriter, r *http.Request)

UpdateAccessServiceToken handles PUT /accounts/{accountId}/access/service_tokens/{tokenId}.

func (*Handlers) UpdateDNSRecord

func (h *Handlers) UpdateDNSRecord(w http.ResponseWriter, r *http.Request)

UpdateDNSRecord handles PUT/PATCH /zones/{zoneId}/dns_records/{recordId}.

func (*Handlers) UpdateDevicePostureRule

func (h *Handlers) UpdateDevicePostureRule(w http.ResponseWriter, r *http.Request)

UpdateDevicePostureRule handles PUT /accounts/{accountId}/devices/posture/{ruleId}.

func (*Handlers) UpdateFallbackDomains

func (h *Handlers) UpdateFallbackDomains(w http.ResponseWriter, r *http.Request)

UpdateFallbackDomains handles PUT /accounts/{accountId}/devices/policy/fallback_domains.

func (*Handlers) UpdateGatewayConfiguration

func (h *Handlers) UpdateGatewayConfiguration(w http.ResponseWriter, r *http.Request)

UpdateGatewayConfiguration handles PUT/PATCH /accounts/{accountId}/gateway/configuration.

func (*Handlers) UpdateGatewayList

func (h *Handlers) UpdateGatewayList(w http.ResponseWriter, r *http.Request)

UpdateGatewayList handles PUT /accounts/{accountId}/gateway/lists/{listId}.

func (*Handlers) UpdateGatewayRule

func (h *Handlers) UpdateGatewayRule(w http.ResponseWriter, r *http.Request)

UpdateGatewayRule handles PUT /accounts/{accountId}/gateway/rules/{ruleId}.

func (*Handlers) UpdateR2BucketLifecycle

func (h *Handlers) UpdateR2BucketLifecycle(w http.ResponseWriter, r *http.Request)

UpdateR2BucketLifecycle handles PUT /accounts/{accountId}/r2/buckets/{bucketName}/lifecycle.

func (*Handlers) UpdateSplitTunnelExclude

func (h *Handlers) UpdateSplitTunnelExclude(w http.ResponseWriter, r *http.Request)

UpdateSplitTunnelExclude handles PUT /accounts/{accountId}/devices/policy/exclude.

func (*Handlers) UpdateSplitTunnelInclude

func (h *Handlers) UpdateSplitTunnelInclude(w http.ResponseWriter, r *http.Request)

UpdateSplitTunnelInclude handles PUT /accounts/{accountId}/devices/policy/include.

func (*Handlers) UpdateTunnelConfiguration

func (h *Handlers) UpdateTunnelConfiguration(w http.ResponseWriter, r *http.Request)

UpdateTunnelConfiguration handles PUT /accounts/{accountId}/cfd_tunnel/{tunnelId}/configurations.

func (*Handlers) UpdateTunnelRoute

func (h *Handlers) UpdateTunnelRoute(w http.ResponseWriter, r *http.Request)

UpdateTunnelRoute handles PATCH /accounts/{accountId}/teamnet/routes/network/{network}.

func (*Handlers) UpdateVirtualNetwork

func (h *Handlers) UpdateVirtualNetwork(w http.ResponseWriter, r *http.Request)

UpdateVirtualNetwork handles PATCH /accounts/{accountId}/teamnet/virtual_networks/{vnetId}.

func (*Handlers) UpdateZoneRuleset

func (h *Handlers) UpdateZoneRuleset(w http.ResponseWriter, r *http.Request)

UpdateZoneRuleset handles PUT /zones/{zoneId}/rulesets/{rulesetId}.

func (*Handlers) UpdateZoneRulesetByPhase

func (h *Handlers) UpdateZoneRulesetByPhase(w http.ResponseWriter, r *http.Request)

UpdateZoneRulesetByPhase handles PUT /zones/{zoneId}/rulesets/phases/{phase}/entrypoint.

type R2BucketCreateRequest

type R2BucketCreateRequest struct {
	Name     string `json:"name"`
	Location string `json:"locationHint,omitempty"`
}

R2BucketCreateRequest represents an R2 bucket creation request.

type R2BucketLifecycleRules

type R2BucketLifecycleRules struct {
	Rules []R2LifecycleRule `json:"rules"`
}

R2BucketLifecycleRules represents lifecycle rules for an R2 bucket.

type R2LifecycleRule

type R2LifecycleRule struct {
	ID         string `json:"id"`
	Enabled    bool   `json:"enabled"`
	Conditions struct {
		Prefix string `json:"prefix,omitempty"`
	} `json:"conditions,omitempty"`
	Actions struct {
		DeleteAfterDays int `json:"deleteAfterDays,omitempty"`
	} `json:"actions,omitempty"`
}

R2LifecycleRule represents a single lifecycle rule.

type RulesetCreateRequest

type RulesetCreateRequest struct {
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Kind        string        `json:"kind"`
	Phase       string        `json:"phase"`
	Rules       []RulesetRule `json:"rules"`
}

RulesetCreateRequest represents a ruleset creation request.

type RulesetRule

type RulesetRule struct {
	ID               string                 `json:"id,omitempty"`
	Action           string                 `json:"action"`
	Expression       string                 `json:"expression"`
	Description      string                 `json:"description,omitempty"`
	Enabled          *bool                  `json:"enabled,omitempty"`
	ActionParameters map[string]interface{} `json:"action_parameters,omitempty"`
}

RulesetRule represents a single rule in a ruleset.

type TunnelConfigurationUpdateRequest

type TunnelConfigurationUpdateRequest struct {
	Config models.TunnelConfigurationData `json:"config"`
}

TunnelConfigurationUpdateRequest represents a tunnel configuration update request.

type TunnelCreateRequest

type TunnelCreateRequest struct {
	Name      string `json:"name"`
	Secret    string `json:"tunnel_secret"`
	ConfigSrc string `json:"config_src"`
}

TunnelCreateRequest represents a tunnel creation request.

type TunnelRouteCreateRequest

type TunnelRouteCreateRequest struct {
	Network          string `json:"network"`
	TunnelID         string `json:"tunnel_id"`
	VirtualNetworkID string `json:"virtual_network_id"`
	Comment          string `json:"comment"`
}

TunnelRouteCreateRequest represents a tunnel route creation request.

type VirtualNetworkCreateRequest

type VirtualNetworkCreateRequest struct {
	Name      string `json:"name"`
	Comment   string `json:"comment"`
	IsDefault bool   `json:"is_default"`
}

VirtualNetworkCreateRequest represents a virtual network creation request.

type VirtualNetworkUpdateRequest

type VirtualNetworkUpdateRequest struct {
	Name      string `json:"name"`
	Comment   string `json:"comment"`
	IsDefault *bool  `json:"is_default_network"`
}

VirtualNetworkUpdateRequest represents a virtual network update request.

Jump to

Keyboard shortcuts

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