store

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: 5 Imported by: 0

Documentation

Overview

Package store provides in-memory storage for the mock Cloudflare API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store provides thread-safe in-memory storage for mock data.

func NewStore

func NewStore() *Store

NewStore creates a new Store with initialized maps and default data.

func (*Store) CreateAccessApplication

func (s *Store) CreateAccessApplication(app *models.AccessApplication)

CreateAccessApplication creates a new access application.

func (*Store) CreateAccessGroup

func (s *Store) CreateAccessGroup(group *models.AccessGroup)

CreateAccessGroup creates a new access group.

func (*Store) CreateAccessIdentityProvider

func (s *Store) CreateAccessIdentityProvider(idp *models.AccessIdentityProvider)

CreateAccessIdentityProvider creates a new access identity provider.

func (*Store) CreateAccessPolicy

func (s *Store) CreateAccessPolicy(appID string, policy *models.AccessPolicy)

CreateAccessPolicy creates a new access policy.

func (*Store) CreateAccessServiceToken

func (s *Store) CreateAccessServiceToken(token *models.AccessServiceToken)

CreateAccessServiceToken creates a new access service token.

func (*Store) CreateDNSRecord

func (s *Store) CreateDNSRecord(record *models.DNSRecord)

CreateDNSRecord creates a new DNS record.

func (*Store) CreateDevicePostureRule

func (s *Store) CreateDevicePostureRule(rule *models.DevicePostureRule)

CreateDevicePostureRule creates a new device posture rule.

func (*Store) CreateGatewayList

func (s *Store) CreateGatewayList(list *models.GatewayList)

CreateGatewayList creates a new gateway list.

func (*Store) CreateGatewayRule

func (s *Store) CreateGatewayRule(rule *models.GatewayRule)

CreateGatewayRule creates a new gateway rule.

func (*Store) CreateR2Bucket

func (s *Store) CreateR2Bucket(bucket *models.R2Bucket)

CreateR2Bucket creates a new R2 bucket.

func (*Store) CreateTunnel

func (s *Store) CreateTunnel(tunnel *models.Tunnel)

CreateTunnel creates a new tunnel.

func (*Store) CreateTunnelRoute

func (s *Store) CreateTunnelRoute(route *models.TunnelRoute)

CreateTunnelRoute creates a new tunnel route.

func (*Store) CreateVirtualNetwork

func (s *Store) CreateVirtualNetwork(vnet *models.VirtualNetwork)

CreateVirtualNetwork creates a new virtual network.

func (*Store) CreateZoneRuleset

func (s *Store) CreateZoneRuleset(ruleset *models.ZoneRuleset)

CreateZoneRuleset creates a new zone ruleset.

func (*Store) DeleteAccessApplication

func (s *Store) DeleteAccessApplication(id string) bool

DeleteAccessApplication deletes an access application.

func (*Store) DeleteAccessGroup

func (s *Store) DeleteAccessGroup(id string) bool

DeleteAccessGroup deletes an access group.

func (*Store) DeleteAccessIdentityProvider

func (s *Store) DeleteAccessIdentityProvider(id string) bool

DeleteAccessIdentityProvider deletes an access identity provider.

func (*Store) DeleteAccessPolicy

func (s *Store) DeleteAccessPolicy(appID, policyID string) bool

DeleteAccessPolicy deletes an access policy.

func (*Store) DeleteAccessServiceToken

func (s *Store) DeleteAccessServiceToken(id string) bool

DeleteAccessServiceToken deletes an access service token.

func (*Store) DeleteDNSRecord

func (s *Store) DeleteDNSRecord(id string) bool

DeleteDNSRecord deletes a DNS record.

func (*Store) DeleteDevicePostureRule

func (s *Store) DeleteDevicePostureRule(id string) bool

DeleteDevicePostureRule deletes a device posture rule.

func (*Store) DeleteGatewayList

func (s *Store) DeleteGatewayList(id string) bool

DeleteGatewayList deletes a gateway list.

func (*Store) DeleteGatewayRule

func (s *Store) DeleteGatewayRule(id string) bool

DeleteGatewayRule deletes a gateway rule.

func (*Store) DeleteR2Bucket

func (s *Store) DeleteR2Bucket(name string) bool

DeleteR2Bucket deletes an R2 bucket.

func (*Store) DeleteTunnel

func (s *Store) DeleteTunnel(id string) bool

DeleteTunnel soft-deletes a tunnel.

func (*Store) DeleteTunnelRoute

func (s *Store) DeleteTunnelRoute(network, vnetID string) bool

DeleteTunnelRoute deletes a tunnel route.

func (*Store) DeleteVirtualNetwork

func (s *Store) DeleteVirtualNetwork(id string) bool

DeleteVirtualNetwork soft-deletes a virtual network.

func (*Store) DeleteZoneRuleset

func (s *Store) DeleteZoneRuleset(id string) bool

DeleteZoneRuleset deletes a zone ruleset.

func (*Store) GenerateID

func (s *Store) GenerateID() string

GenerateID generates a unique ID.

func (*Store) GetAccessApplication

func (s *Store) GetAccessApplication(id string) (*models.AccessApplication, bool)

GetAccessApplication retrieves an access application by ID.

func (*Store) GetAccessApplicationByName

func (s *Store) GetAccessApplicationByName(name string) (*models.AccessApplication, bool)

GetAccessApplicationByName retrieves an access application by name.

func (*Store) GetAccessGroup

func (s *Store) GetAccessGroup(id string) (*models.AccessGroup, bool)

GetAccessGroup retrieves an access group by ID.

func (*Store) GetAccessGroupByName

func (s *Store) GetAccessGroupByName(name string) (*models.AccessGroup, bool)

GetAccessGroupByName retrieves an access group by name.

func (*Store) GetAccessIdentityProvider

func (s *Store) GetAccessIdentityProvider(id string) (*models.AccessIdentityProvider, bool)

GetAccessIdentityProvider retrieves an access identity provider by ID.

func (*Store) GetAccessIdentityProviderByName

func (s *Store) GetAccessIdentityProviderByName(name string) (*models.AccessIdentityProvider, bool)

GetAccessIdentityProviderByName retrieves an access identity provider by name.

func (*Store) GetAccessPolicy

func (s *Store) GetAccessPolicy(appID, policyID string) (*models.AccessPolicy, bool)

GetAccessPolicy retrieves an access policy.

func (*Store) GetAccessServiceToken

func (s *Store) GetAccessServiceToken(id string) (*models.AccessServiceToken, bool)

GetAccessServiceToken retrieves an access service token by ID.

func (*Store) GetAccessServiceTokenByName

func (s *Store) GetAccessServiceTokenByName(name string) (*models.AccessServiceToken, bool)

GetAccessServiceTokenByName retrieves an access service token by name.

func (*Store) GetAccount

func (s *Store) GetAccount(id string) (*models.Account, bool)

GetAccount retrieves an account by ID.

func (*Store) GetAccountByName

func (s *Store) GetAccountByName(name string) (*models.Account, bool)

GetAccountByName retrieves an account by name.

func (*Store) GetDNSRecord

func (s *Store) GetDNSRecord(id string) (*models.DNSRecord, bool)

GetDNSRecord retrieves a DNS record by ID.

func (*Store) GetDevicePostureRule

func (s *Store) GetDevicePostureRule(id string) (*models.DevicePostureRule, bool)

GetDevicePostureRule retrieves a device posture rule by ID.

func (*Store) GetDevicePostureRuleByName

func (s *Store) GetDevicePostureRuleByName(name string) (*models.DevicePostureRule, bool)

GetDevicePostureRuleByName retrieves a device posture rule by name.

func (*Store) GetFallbackDomains

func (s *Store) GetFallbackDomains() []models.FallbackDomainEntry

GetFallbackDomains returns fallback domain entries.

func (*Store) GetGatewayConfiguration

func (s *Store) GetGatewayConfiguration() *models.GatewayConfiguration

GetGatewayConfiguration retrieves the gateway configuration.

func (*Store) GetGatewayList

func (s *Store) GetGatewayList(id string) (*models.GatewayList, bool)

GetGatewayList retrieves a gateway list by ID.

func (*Store) GetGatewayListByName

func (s *Store) GetGatewayListByName(name string) (*models.GatewayList, bool)

GetGatewayListByName retrieves a gateway list by name.

func (*Store) GetGatewayRule

func (s *Store) GetGatewayRule(id string) (*models.GatewayRule, bool)

GetGatewayRule retrieves a gateway rule by ID.

func (*Store) GetGatewayRuleByName

func (s *Store) GetGatewayRuleByName(name string) (*models.GatewayRule, bool)

GetGatewayRuleByName retrieves a gateway rule by name.

func (*Store) GetR2Bucket

func (s *Store) GetR2Bucket(name string) (*models.R2Bucket, bool)

GetR2Bucket retrieves an R2 bucket by name.

func (*Store) GetR2BucketLifecycle

func (s *Store) GetR2BucketLifecycle(bucketName string) interface{}

GetR2BucketLifecycle retrieves lifecycle rules for an R2 bucket.

func (*Store) GetSplitTunnelExclude

func (s *Store) GetSplitTunnelExclude() []models.SplitTunnelEntry

GetSplitTunnelExclude returns split tunnel exclude entries.

func (*Store) GetSplitTunnelInclude

func (s *Store) GetSplitTunnelInclude() []models.SplitTunnelEntry

GetSplitTunnelInclude returns split tunnel include entries.

func (*Store) GetTunnel

func (s *Store) GetTunnel(id string) (*models.Tunnel, bool)

GetTunnel retrieves a tunnel by ID.

func (*Store) GetTunnelByName

func (s *Store) GetTunnelByName(accountID, name string) (*models.Tunnel, bool)

GetTunnelByName retrieves a tunnel by name.

func (*Store) GetTunnelConfiguration

func (s *Store) GetTunnelConfiguration(tunnelID string) (*models.TunnelConfiguration, bool)

GetTunnelConfiguration retrieves tunnel configuration.

func (*Store) GetTunnelRoute

func (s *Store) GetTunnelRoute(network, vnetID string) (*models.TunnelRoute, bool)

GetTunnelRoute retrieves a tunnel route.

func (*Store) GetVirtualNetwork

func (s *Store) GetVirtualNetwork(id string) (*models.VirtualNetwork, bool)

GetVirtualNetwork retrieves a virtual network by ID.

func (*Store) GetVirtualNetworkByName

func (s *Store) GetVirtualNetworkByName(name string) (*models.VirtualNetwork, bool)

GetVirtualNetworkByName retrieves a virtual network by name.

func (*Store) GetZone

func (s *Store) GetZone(id string) (*models.Zone, bool)

GetZone retrieves a zone by ID.

func (*Store) GetZoneByName

func (s *Store) GetZoneByName(name string) (*models.Zone, bool)

GetZoneByName retrieves a zone by name.

func (*Store) GetZoneRuleset

func (s *Store) GetZoneRuleset(id string) (*models.ZoneRuleset, bool)

GetZoneRuleset retrieves a zone ruleset by ID.

func (*Store) GetZoneRulesetByPhase

func (s *Store) GetZoneRulesetByPhase(zoneID, phase string) (*models.ZoneRuleset, bool)

GetZoneRulesetByPhase retrieves a zone ruleset by zone ID and phase.

func (*Store) ListAccessApplications

func (s *Store) ListAccessApplications() []*models.AccessApplication

ListAccessApplications returns all access applications.

func (*Store) ListAccessGroups

func (s *Store) ListAccessGroups() []*models.AccessGroup

ListAccessGroups returns all access groups.

func (*Store) ListAccessPolicies

func (s *Store) ListAccessPolicies(appID string) []*models.AccessPolicy

ListAccessPolicies returns all policies for an application.

func (*Store) ListDNSRecords

func (s *Store) ListDNSRecords(zoneID, recordType, name string) []*models.DNSRecord

ListDNSRecords returns DNS records filtered by zone, type, and name.

func (*Store) ListGatewayRules

func (s *Store) ListGatewayRules() []*models.GatewayRule

ListGatewayRules returns all gateway rules.

func (*Store) ListR2Buckets

func (s *Store) ListR2Buckets(namePrefix string) []*models.R2Bucket

ListR2Buckets returns all R2 buckets, optionally filtered by name prefix.

func (*Store) ListTunnelRoutes

func (s *Store) ListTunnelRoutes(tunnelID, vnetID string) []*models.TunnelRoute

ListTunnelRoutes returns routes filtered by tunnel ID or virtual network ID.

func (*Store) ListTunnels

func (s *Store) ListTunnels(accountID string) []*models.Tunnel

ListTunnels returns all tunnels for an account.

func (*Store) ListVirtualNetworks

func (s *Store) ListVirtualNetworks() []*models.VirtualNetwork

ListVirtualNetworks returns all virtual networks.

func (*Store) ListZoneRulesets

func (s *Store) ListZoneRulesets(zoneID string) []*models.ZoneRuleset

ListZoneRulesets returns all rulesets for a zone.

func (*Store) ListZones

func (s *Store) ListZones() []*models.Zone

ListZones returns all zones.

func (*Store) Reset

func (s *Store) Reset()

Reset clears all data and reinitializes defaults.

func (*Store) UpdateAccessApplication

func (s *Store) UpdateAccessApplication(id string, update func(*models.AccessApplication)) bool

UpdateAccessApplication updates an access application.

func (*Store) UpdateAccessGroup

func (s *Store) UpdateAccessGroup(id string, update func(*models.AccessGroup)) bool

UpdateAccessGroup updates an access group.

func (*Store) UpdateAccessIdentityProvider

func (s *Store) UpdateAccessIdentityProvider(id string, update func(*models.AccessIdentityProvider)) bool

UpdateAccessIdentityProvider updates an access identity provider.

func (*Store) UpdateAccessPolicy

func (s *Store) UpdateAccessPolicy(appID, policyID string, update func(*models.AccessPolicy)) bool

UpdateAccessPolicy updates an access policy.

func (*Store) UpdateAccessServiceToken

func (s *Store) UpdateAccessServiceToken(id string, update func(*models.AccessServiceToken)) bool

UpdateAccessServiceToken updates an access service token.

func (*Store) UpdateDNSRecord

func (s *Store) UpdateDNSRecord(id string, update func(*models.DNSRecord)) bool

UpdateDNSRecord updates a DNS record.

func (*Store) UpdateDevicePostureRule

func (s *Store) UpdateDevicePostureRule(id string, update func(*models.DevicePostureRule)) bool

UpdateDevicePostureRule updates a device posture rule.

func (*Store) UpdateFallbackDomains

func (s *Store) UpdateFallbackDomains(entries []models.FallbackDomainEntry)

UpdateFallbackDomains updates fallback domain entries.

func (*Store) UpdateGatewayConfiguration

func (s *Store) UpdateGatewayConfiguration(config *models.GatewayConfiguration)

UpdateGatewayConfiguration updates the gateway configuration.

func (*Store) UpdateGatewayList

func (s *Store) UpdateGatewayList(id string, update func(*models.GatewayList)) bool

UpdateGatewayList updates a gateway list.

func (*Store) UpdateGatewayRule

func (s *Store) UpdateGatewayRule(id string, update func(*models.GatewayRule)) bool

UpdateGatewayRule updates a gateway rule.

func (*Store) UpdateR2BucketLifecycle

func (s *Store) UpdateR2BucketLifecycle(bucketName string, lifecycle interface{})

UpdateR2BucketLifecycle updates lifecycle rules for an R2 bucket.

func (*Store) UpdateSplitTunnelExclude

func (s *Store) UpdateSplitTunnelExclude(entries []models.SplitTunnelEntry)

UpdateSplitTunnelExclude updates split tunnel exclude entries.

func (*Store) UpdateSplitTunnelInclude

func (s *Store) UpdateSplitTunnelInclude(entries []models.SplitTunnelEntry)

UpdateSplitTunnelInclude updates split tunnel include entries.

func (*Store) UpdateTunnelConfiguration

func (s *Store) UpdateTunnelConfiguration(tunnelID string, config models.TunnelConfigurationData) (*models.TunnelConfiguration, bool)

UpdateTunnelConfiguration updates tunnel configuration.

func (*Store) UpdateTunnelRoute

func (s *Store) UpdateTunnelRoute(network, vnetID string, update func(*models.TunnelRoute)) bool

UpdateTunnelRoute updates a tunnel route.

func (*Store) UpdateVirtualNetwork

func (s *Store) UpdateVirtualNetwork(id string, update func(*models.VirtualNetwork)) bool

UpdateVirtualNetwork updates a virtual network.

func (*Store) UpdateZoneRuleset

func (s *Store) UpdateZoneRuleset(id string, update func(*models.ZoneRuleset)) bool

UpdateZoneRuleset updates a zone ruleset.

Jump to

Keyboard shortcuts

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