store

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 51 Imported by: 2

Documentation

Overview

Package store is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeyQueryCondition added in v0.36.0

func GetKeyQueryCondition(s *SqlStore) string

func LoadSQL added in v0.39.0

func LoadSQL(db *gorm.DB, filepath string) error

func MigrateFileStoreToSqlite

func MigrateFileStoreToSqlite(ctx context.Context, dataDir string) error

MigrateFileStoreToSqlite migrates the file store to the SQLite store.

Types

type FileStore

type FileStore struct {
	Accounts                map[string]*types.Account
	SetupKeyID2AccountID    map[string]string `json:"-"`
	PeerKeyID2AccountID     map[string]string `json:"-"`
	PeerID2AccountID        map[string]string `json:"-"`
	UserID2AccountID        map[string]string `json:"-"`
	PrivateDomain2AccountID map[string]string `json:"-"`
	HashedPAT2TokenID       map[string]string `json:"-"`
	TokenID2UserID          map[string]string `json:"-"`
	InstallationID          string
	// contains filtered or unexported fields
}

FileStore represents an account storage backed by a file persisted to disk

func NewFileStore

func NewFileStore(ctx context.Context, dataDir string, metrics telemetry.AppMetrics) (*FileStore, error)

NewFileStore restores a store from the file located in the datadir

func (*FileStore) Close

func (s *FileStore) Close(ctx context.Context) error

Close the FileStore persisting data to disk

func (*FileStore) GetAllAccounts

func (s *FileStore) GetAllAccounts(_ context.Context) (all []*types.Account)

GetAllAccounts returns all accounts

func (*FileStore) GetCustomDomainsCounts added in v0.66.0

func (s *FileStore) GetCustomDomainsCounts(_ context.Context) (int64, int64, error)

GetCustomDomainsCounts is a no-op for FileStore as it doesn't support custom domains.

func (*FileStore) GetStoreEngine

func (s *FileStore) GetStoreEngine() types.Engine

GetStoreEngine returns FileStoreEngine

func (*FileStore) SetFieldEncrypt added in v0.62.0

func (s *FileStore) SetFieldEncrypt(_ *crypt.FieldEncrypt)

SetFieldEncrypt is a no-op for FileStore as it doesn't support field encryption.

type LockingStrength

type LockingStrength string
const (
	LockingStrengthUpdate      LockingStrength = "UPDATE"        // Strongest lock, preventing any changes by other transactions until your transaction completes.
	LockingStrengthShare       LockingStrength = "SHARE"         // Allows reading but prevents changes by other transactions.
	LockingStrengthNoKeyUpdate LockingStrength = "NO KEY UPDATE" // Similar to UPDATE but allows changes to related rows.
	LockingStrengthKeyShare    LockingStrength = "KEY SHARE"     // Protects against changes to primary/unique keys but allows other updates.
	LockingStrengthNone        LockingStrength = "NONE"          // No locking, allowing all transactions to proceed without restrictions.
)

type MockStore added in v0.65.0

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

MockStore is a mock of Store interface.

func NewMockStore added in v0.65.0

func NewMockStore(ctrl *gomock.Controller) *MockStore

NewMockStore creates a new mock instance.

func (*MockStore) AccountExists added in v0.65.0

func (m *MockStore) AccountExists(ctx context.Context, lockStrength LockingStrength, id string) (bool, error)

AccountExists mocks base method.

func (*MockStore) AcquireGlobalLock added in v0.65.0

func (m *MockStore) AcquireGlobalLock(ctx context.Context) func()

AcquireGlobalLock mocks base method.

func (*MockStore) AddPeerToAccount added in v0.65.0

func (m *MockStore) AddPeerToAccount(ctx context.Context, peer *peer.Peer) error

AddPeerToAccount mocks base method.

func (*MockStore) AddPeerToAllGroup added in v0.65.0

func (m *MockStore) AddPeerToAllGroup(ctx context.Context, accountID, peerID string) error

AddPeerToAllGroup mocks base method.

func (*MockStore) AddPeerToGroup added in v0.65.0

func (m *MockStore) AddPeerToGroup(ctx context.Context, accountID, peerId, groupID string) error

AddPeerToGroup mocks base method.

func (*MockStore) AddResourceToGroup added in v0.65.0

func (m *MockStore) AddResourceToGroup(ctx context.Context, accountId, groupID string, resource *types2.Resource) error

AddResourceToGroup mocks base method.

func (*MockStore) ApproveAccountPeers added in v0.65.0

func (m *MockStore) ApproveAccountPeers(ctx context.Context, accountID string) (int, error)

ApproveAccountPeers mocks base method.

func (*MockStore) Close added in v0.65.0

func (m *MockStore) Close(ctx context.Context) error

Close mocks base method.

func (*MockStore) CompletePeerJob added in v0.65.0

func (m *MockStore) CompletePeerJob(ctx context.Context, job *types2.Job) error

CompletePeerJob mocks base method.

func (*MockStore) CountAccountsByPrivateDomain added in v0.65.0

func (m *MockStore) CountAccountsByPrivateDomain(ctx context.Context, domain string) (int64, error)

CountAccountsByPrivateDomain mocks base method.

func (*MockStore) CreateAccessLog added in v0.65.0

func (m *MockStore) CreateAccessLog(ctx context.Context, log *accesslogs.AccessLogEntry) error

CreateAccessLog mocks base method.

func (*MockStore) CreateCustomDomain added in v0.65.0

func (m *MockStore) CreateCustomDomain(ctx context.Context, accountID, domainName, targetCluster string, validated bool) (*domain.Domain, error)

CreateCustomDomain mocks base method.

func (*MockStore) CreateDNSRecord added in v0.65.0

func (m *MockStore) CreateDNSRecord(ctx context.Context, record *records.Record) error

CreateDNSRecord mocks base method.

func (*MockStore) CreateGroup added in v0.65.0

func (m *MockStore) CreateGroup(ctx context.Context, group *types2.Group) error

CreateGroup mocks base method.

func (*MockStore) CreateGroups added in v0.65.0

func (m *MockStore) CreateGroups(ctx context.Context, accountID string, groups []*types2.Group) error

CreateGroups mocks base method.

func (*MockStore) CreatePeerJob added in v0.65.0

func (m *MockStore) CreatePeerJob(ctx context.Context, job *types2.Job) error

CreatePeerJob mocks base method.

func (*MockStore) CreatePolicy added in v0.65.0

func (m *MockStore) CreatePolicy(ctx context.Context, policy *types2.Policy) error

CreatePolicy mocks base method.

func (*MockStore) CreateService added in v0.65.0

func (m *MockStore) CreateService(ctx context.Context, service *reverseproxy.Service) error

CreateService mocks base method.

func (*MockStore) CreateZone added in v0.65.0

func (m *MockStore) CreateZone(ctx context.Context, zone *zones.Zone) error

CreateZone mocks base method.

func (*MockStore) DeleteAccount added in v0.65.0

func (m *MockStore) DeleteAccount(ctx context.Context, account *types2.Account) error

DeleteAccount mocks base method.

func (*MockStore) DeleteCustomDomain added in v0.65.0

func (m *MockStore) DeleteCustomDomain(ctx context.Context, accountID, domainID string) error

DeleteCustomDomain mocks base method.

func (*MockStore) DeleteDNSRecord added in v0.65.0

func (m *MockStore) DeleteDNSRecord(ctx context.Context, accountID, zoneID, recordID string) error

DeleteDNSRecord mocks base method.

func (*MockStore) DeleteGroup added in v0.65.0

func (m *MockStore) DeleteGroup(ctx context.Context, accountID, groupID string) error

DeleteGroup mocks base method.

func (*MockStore) DeleteGroups added in v0.65.0

func (m *MockStore) DeleteGroups(ctx context.Context, accountID string, groupIDs []string) error

DeleteGroups mocks base method.

func (*MockStore) DeleteHashedPAT2TokenIDIndex added in v0.65.0

func (m *MockStore) DeleteHashedPAT2TokenIDIndex(hashedToken string) error

DeleteHashedPAT2TokenIDIndex mocks base method.

func (*MockStore) DeleteNameServerGroup added in v0.65.0

func (m *MockStore) DeleteNameServerGroup(ctx context.Context, accountID, nameServerGroupID string) error

DeleteNameServerGroup mocks base method.

func (*MockStore) DeleteNetwork added in v0.65.0

func (m *MockStore) DeleteNetwork(ctx context.Context, accountID, networkID string) error

DeleteNetwork mocks base method.

func (*MockStore) DeleteNetworkResource added in v0.65.0

func (m *MockStore) DeleteNetworkResource(ctx context.Context, accountID, resourceID string) error

DeleteNetworkResource mocks base method.

func (*MockStore) DeleteNetworkRouter added in v0.65.0

func (m *MockStore) DeleteNetworkRouter(ctx context.Context, accountID, routerID string) error

DeleteNetworkRouter mocks base method.

func (*MockStore) DeleteOldAccessLogs added in v0.66.0

func (m *MockStore) DeleteOldAccessLogs(ctx context.Context, olderThan time.Time) (int64, error)

DeleteOldAccessLogs mocks base method.

func (*MockStore) DeletePAT added in v0.65.0

func (m *MockStore) DeletePAT(ctx context.Context, userID, patID string) error

DeletePAT mocks base method.

func (*MockStore) DeletePeer added in v0.65.0

func (m *MockStore) DeletePeer(ctx context.Context, accountID, peerID string) error

DeletePeer mocks base method.

func (*MockStore) DeletePolicy added in v0.65.0

func (m *MockStore) DeletePolicy(ctx context.Context, accountID, policyID string) error

DeletePolicy mocks base method.

func (*MockStore) DeletePostureChecks added in v0.65.0

func (m *MockStore) DeletePostureChecks(ctx context.Context, accountID, postureChecksID string) error

DeletePostureChecks mocks base method.

func (*MockStore) DeleteRoute added in v0.65.0

func (m *MockStore) DeleteRoute(ctx context.Context, accountID, routeID string) error

DeleteRoute mocks base method.

func (*MockStore) DeleteService added in v0.65.0

func (m *MockStore) DeleteService(ctx context.Context, accountID, serviceID string) error

DeleteService mocks base method.

func (*MockStore) DeleteSetupKey added in v0.65.0

func (m *MockStore) DeleteSetupKey(ctx context.Context, accountID, keyID string) error

DeleteSetupKey mocks base method.

func (*MockStore) DeleteTokenID2UserIDIndex added in v0.65.0

func (m *MockStore) DeleteTokenID2UserIDIndex(tokenID string) error

DeleteTokenID2UserIDIndex mocks base method.

func (*MockStore) DeleteUser added in v0.65.0

func (m *MockStore) DeleteUser(ctx context.Context, accountID, userID string) error

DeleteUser mocks base method.

func (*MockStore) DeleteUserInvite added in v0.65.0

func (m *MockStore) DeleteUserInvite(ctx context.Context, inviteID string) error

DeleteUserInvite mocks base method.

func (*MockStore) DeleteZone added in v0.65.0

func (m *MockStore) DeleteZone(ctx context.Context, accountID, zoneID string) error

DeleteZone mocks base method.

func (*MockStore) DeleteZoneDNSRecords added in v0.65.0

func (m *MockStore) DeleteZoneDNSRecords(ctx context.Context, accountID, zoneID string) error

DeleteZoneDNSRecords mocks base method.

func (*MockStore) EXPECT added in v0.65.0

func (m *MockStore) EXPECT() *MockStoreMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockStore) ExecuteInTransaction added in v0.65.0

func (m *MockStore) ExecuteInTransaction(ctx context.Context, f func(Store) error) error

ExecuteInTransaction mocks base method.

func (*MockStore) GetAccount added in v0.65.0

func (m *MockStore) GetAccount(ctx context.Context, accountID string) (*types2.Account, error)

GetAccount mocks base method.

func (*MockStore) GetAccountAccessLogs added in v0.65.0

func (m *MockStore) GetAccountAccessLogs(ctx context.Context, lockStrength LockingStrength, accountID string, filter accesslogs.AccessLogFilter) ([]*accesslogs.AccessLogEntry, int64, error)

GetAccountAccessLogs mocks base method.

func (*MockStore) GetAccountByPeerID added in v0.65.0

func (m *MockStore) GetAccountByPeerID(ctx context.Context, peerID string) (*types2.Account, error)

GetAccountByPeerID mocks base method.

func (*MockStore) GetAccountByPeerPubKey added in v0.65.0

func (m *MockStore) GetAccountByPeerPubKey(ctx context.Context, peerKey string) (*types2.Account, error)

GetAccountByPeerPubKey mocks base method.

func (*MockStore) GetAccountByPrivateDomain added in v0.65.0

func (m *MockStore) GetAccountByPrivateDomain(ctx context.Context, domain string) (*types2.Account, error)

GetAccountByPrivateDomain mocks base method.

func (*MockStore) GetAccountBySetupKey added in v0.65.0

func (m *MockStore) GetAccountBySetupKey(ctx context.Context, setupKey string) (*types2.Account, error)

GetAccountBySetupKey mocks base method.

func (*MockStore) GetAccountByUser added in v0.65.0

func (m *MockStore) GetAccountByUser(ctx context.Context, userID string) (*types2.Account, error)

GetAccountByUser mocks base method.

func (*MockStore) GetAccountCreatedBy added in v0.65.0

func (m *MockStore) GetAccountCreatedBy(ctx context.Context, lockStrength LockingStrength, accountID string) (string, error)

GetAccountCreatedBy mocks base method.

func (*MockStore) GetAccountDNSSettings added in v0.65.0

func (m *MockStore) GetAccountDNSSettings(ctx context.Context, lockStrength LockingStrength, accountID string) (*types2.DNSSettings, error)

GetAccountDNSSettings mocks base method.

func (*MockStore) GetAccountDomainAndCategory added in v0.65.0

func (m *MockStore) GetAccountDomainAndCategory(ctx context.Context, lockStrength LockingStrength, accountID string) (string, string, error)

GetAccountDomainAndCategory mocks base method.

func (*MockStore) GetAccountGroupPeers added in v0.65.0

func (m *MockStore) GetAccountGroupPeers(ctx context.Context, lockStrength LockingStrength, accountID string) (map[string]map[string]struct{}, error)

GetAccountGroupPeers mocks base method.

func (*MockStore) GetAccountGroups added in v0.65.0

func (m *MockStore) GetAccountGroups(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types2.Group, error)

GetAccountGroups mocks base method.

func (*MockStore) GetAccountIDByPeerID added in v0.65.0

func (m *MockStore) GetAccountIDByPeerID(ctx context.Context, lockStrength LockingStrength, peerID string) (string, error)

GetAccountIDByPeerID mocks base method.

func (*MockStore) GetAccountIDByPeerPubKey added in v0.65.0

func (m *MockStore) GetAccountIDByPeerPubKey(ctx context.Context, peerKey string) (string, error)

GetAccountIDByPeerPubKey mocks base method.

func (*MockStore) GetAccountIDByPrivateDomain added in v0.65.0

func (m *MockStore) GetAccountIDByPrivateDomain(ctx context.Context, lockStrength LockingStrength, domain string) (string, error)

GetAccountIDByPrivateDomain mocks base method.

func (*MockStore) GetAccountIDBySetupKey added in v0.65.0

func (m *MockStore) GetAccountIDBySetupKey(ctx context.Context, peerKey string) (string, error)

GetAccountIDBySetupKey mocks base method.

func (*MockStore) GetAccountIDByUserID added in v0.65.0

func (m *MockStore) GetAccountIDByUserID(ctx context.Context, lockStrength LockingStrength, userID string) (string, error)

GetAccountIDByUserID mocks base method.

func (*MockStore) GetAccountMeta added in v0.65.0

func (m *MockStore) GetAccountMeta(ctx context.Context, lockStrength LockingStrength, accountID string) (*types2.AccountMeta, error)

GetAccountMeta mocks base method.

func (*MockStore) GetAccountNameServerGroups added in v0.65.0

func (m *MockStore) GetAccountNameServerGroups(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*dns.NameServerGroup, error)

GetAccountNameServerGroups mocks base method.

func (*MockStore) GetAccountNetwork added in v0.65.0

func (m *MockStore) GetAccountNetwork(ctx context.Context, lockStrength LockingStrength, accountId string) (*types2.Network, error)

GetAccountNetwork mocks base method.

func (*MockStore) GetAccountNetworks added in v0.65.0

func (m *MockStore) GetAccountNetworks(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types1.Network, error)

GetAccountNetworks mocks base method.

func (*MockStore) GetAccountOnboarding added in v0.65.0

func (m *MockStore) GetAccountOnboarding(ctx context.Context, accountID string) (*types2.AccountOnboarding, error)

GetAccountOnboarding mocks base method.

func (*MockStore) GetAccountOwner added in v0.65.0

func (m *MockStore) GetAccountOwner(ctx context.Context, lockStrength LockingStrength, accountID string) (*types2.User, error)

GetAccountOwner mocks base method.

func (*MockStore) GetAccountPeers added in v0.65.0

func (m *MockStore) GetAccountPeers(ctx context.Context, lockStrength LockingStrength, accountID, nameFilter, ipFilter string) ([]*peer.Peer, error)

GetAccountPeers mocks base method.

func (*MockStore) GetAccountPeersWithExpiration added in v0.65.0

func (m *MockStore) GetAccountPeersWithExpiration(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*peer.Peer, error)

GetAccountPeersWithExpiration mocks base method.

func (*MockStore) GetAccountPeersWithInactivity added in v0.65.0

func (m *MockStore) GetAccountPeersWithInactivity(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*peer.Peer, error)

GetAccountPeersWithInactivity mocks base method.

func (*MockStore) GetAccountPolicies added in v0.65.0

func (m *MockStore) GetAccountPolicies(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types2.Policy, error)

GetAccountPolicies mocks base method.

func (*MockStore) GetAccountPostureChecks added in v0.65.0

func (m *MockStore) GetAccountPostureChecks(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*posture.Checks, error)

GetAccountPostureChecks mocks base method.

func (*MockStore) GetAccountRoutes added in v0.65.0

func (m *MockStore) GetAccountRoutes(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*route.Route, error)

GetAccountRoutes mocks base method.

func (*MockStore) GetAccountServices added in v0.65.0

func (m *MockStore) GetAccountServices(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*reverseproxy.Service, error)

GetAccountServices mocks base method.

func (*MockStore) GetAccountSettings added in v0.65.0

func (m *MockStore) GetAccountSettings(ctx context.Context, lockStrength LockingStrength, accountID string) (*types2.Settings, error)

GetAccountSettings mocks base method.

func (*MockStore) GetAccountSetupKeys added in v0.65.0

func (m *MockStore) GetAccountSetupKeys(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types2.SetupKey, error)

GetAccountSetupKeys mocks base method.

func (*MockStore) GetAccountUserInvites added in v0.65.0

func (m *MockStore) GetAccountUserInvites(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types2.UserInviteRecord, error)

GetAccountUserInvites mocks base method.

func (*MockStore) GetAccountUsers added in v0.65.0

func (m *MockStore) GetAccountUsers(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types2.User, error)

GetAccountUsers mocks base method.

func (*MockStore) GetAccountZones added in v0.65.0

func (m *MockStore) GetAccountZones(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*zones.Zone, error)

GetAccountZones mocks base method.

func (*MockStore) GetAccountsCounter added in v0.65.0

func (m *MockStore) GetAccountsCounter(ctx context.Context) (int64, error)

GetAccountsCounter mocks base method.

func (*MockStore) GetAllAccounts added in v0.65.0

func (m *MockStore) GetAllAccounts(ctx context.Context) []*types2.Account

GetAllAccounts mocks base method.

func (*MockStore) GetAllEphemeralPeers added in v0.65.0

func (m *MockStore) GetAllEphemeralPeers(ctx context.Context, lockStrength LockingStrength) ([]*peer.Peer, error)

GetAllEphemeralPeers mocks base method.

func (*MockStore) GetAllProxyAccessTokens added in v0.65.0

func (m *MockStore) GetAllProxyAccessTokens(ctx context.Context, lockStrength LockingStrength) ([]*types2.ProxyAccessToken, error)

GetAllProxyAccessTokens mocks base method.

func (*MockStore) GetAnyAccountID added in v0.65.0

func (m *MockStore) GetAnyAccountID(ctx context.Context) (string, error)

GetAnyAccountID mocks base method.

func (*MockStore) GetCustomDomain added in v0.65.0

func (m *MockStore) GetCustomDomain(ctx context.Context, accountID, domainID string) (*domain.Domain, error)

GetCustomDomain mocks base method.

func (*MockStore) GetCustomDomainsCounts added in v0.66.0

func (m *MockStore) GetCustomDomainsCounts(ctx context.Context) (int64, int64, error)

GetCustomDomainsCounts mocks base method.

func (*MockStore) GetDNSRecordByID added in v0.65.0

func (m *MockStore) GetDNSRecordByID(ctx context.Context, lockStrength LockingStrength, accountID, zoneID, recordID string) (*records.Record, error)

GetDNSRecordByID mocks base method.

func (*MockStore) GetGroupByID added in v0.65.0

func (m *MockStore) GetGroupByID(ctx context.Context, lockStrength LockingStrength, accountID, groupID string) (*types2.Group, error)

GetGroupByID mocks base method.

func (*MockStore) GetGroupByName added in v0.65.0

func (m *MockStore) GetGroupByName(ctx context.Context, lockStrength LockingStrength, groupName, accountID string) (*types2.Group, error)

GetGroupByName mocks base method.

func (*MockStore) GetGroupsByIDs added in v0.65.0

func (m *MockStore) GetGroupsByIDs(ctx context.Context, lockStrength LockingStrength, accountID string, groupIDs []string) (map[string]*types2.Group, error)

GetGroupsByIDs mocks base method.

func (*MockStore) GetInstallationID added in v0.65.0

func (m *MockStore) GetInstallationID() string

GetInstallationID mocks base method.

func (*MockStore) GetNameServerGroupByID added in v0.65.0

func (m *MockStore) GetNameServerGroupByID(ctx context.Context, lockStrength LockingStrength, nameServerGroupID, accountID string) (*dns.NameServerGroup, error)

GetNameServerGroupByID mocks base method.

func (*MockStore) GetNetworkByID added in v0.65.0

func (m *MockStore) GetNetworkByID(ctx context.Context, lockStrength LockingStrength, accountID, networkID string) (*types1.Network, error)

GetNetworkByID mocks base method.

func (*MockStore) GetNetworkResourceByID added in v0.65.0

func (m *MockStore) GetNetworkResourceByID(ctx context.Context, lockStrength LockingStrength, accountID, resourceID string) (*types.NetworkResource, error)

GetNetworkResourceByID mocks base method.

func (*MockStore) GetNetworkResourceByName added in v0.65.0

func (m *MockStore) GetNetworkResourceByName(ctx context.Context, lockStrength LockingStrength, accountID, resourceName string) (*types.NetworkResource, error)

GetNetworkResourceByName mocks base method.

func (*MockStore) GetNetworkResourcesByAccountID added in v0.65.0

func (m *MockStore) GetNetworkResourcesByAccountID(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.NetworkResource, error)

GetNetworkResourcesByAccountID mocks base method.

func (*MockStore) GetNetworkResourcesByNetID added in v0.65.0

func (m *MockStore) GetNetworkResourcesByNetID(ctx context.Context, lockStrength LockingStrength, accountID, netID string) ([]*types.NetworkResource, error)

GetNetworkResourcesByNetID mocks base method.

func (*MockStore) GetNetworkRouterByID added in v0.65.0

func (m *MockStore) GetNetworkRouterByID(ctx context.Context, lockStrength LockingStrength, accountID, routerID string) (*types0.NetworkRouter, error)

GetNetworkRouterByID mocks base method.

func (*MockStore) GetNetworkRoutersByAccountID added in v0.65.0

func (m *MockStore) GetNetworkRoutersByAccountID(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types0.NetworkRouter, error)

GetNetworkRoutersByAccountID mocks base method.

func (*MockStore) GetNetworkRoutersByNetID added in v0.65.0

func (m *MockStore) GetNetworkRoutersByNetID(ctx context.Context, lockStrength LockingStrength, accountID, netID string) ([]*types0.NetworkRouter, error)

GetNetworkRoutersByNetID mocks base method.

func (*MockStore) GetPATByHashedToken added in v0.65.0

func (m *MockStore) GetPATByHashedToken(ctx context.Context, lockStrength LockingStrength, hashedToken string) (*types2.PersonalAccessToken, error)

GetPATByHashedToken mocks base method.

func (*MockStore) GetPATByID added in v0.65.0

func (m *MockStore) GetPATByID(ctx context.Context, lockStrength LockingStrength, userID, patID string) (*types2.PersonalAccessToken, error)

GetPATByID mocks base method.

func (*MockStore) GetPeerByID added in v0.65.0

func (m *MockStore) GetPeerByID(ctx context.Context, lockStrength LockingStrength, accountID, peerID string) (*peer.Peer, error)

GetPeerByID mocks base method.

func (*MockStore) GetPeerByIP added in v0.65.0

func (m *MockStore) GetPeerByIP(ctx context.Context, lockStrength LockingStrength, accountID string, ip net.IP) (*peer.Peer, error)

GetPeerByIP mocks base method.

func (*MockStore) GetPeerByPeerPubKey added in v0.65.0

func (m *MockStore) GetPeerByPeerPubKey(ctx context.Context, lockStrength LockingStrength, peerKey string) (*peer.Peer, error)

GetPeerByPeerPubKey mocks base method.

func (*MockStore) GetPeerGroupIDs added in v0.65.0

func (m *MockStore) GetPeerGroupIDs(ctx context.Context, lockStrength LockingStrength, accountId, peerId string) ([]string, error)

GetPeerGroupIDs mocks base method.

func (*MockStore) GetPeerGroups added in v0.65.0

func (m *MockStore) GetPeerGroups(ctx context.Context, lockStrength LockingStrength, accountId, peerId string) ([]*types2.Group, error)

GetPeerGroups mocks base method.

func (*MockStore) GetPeerIDByKey added in v0.65.0

func (m *MockStore) GetPeerIDByKey(ctx context.Context, lockStrength LockingStrength, key string) (string, error)

GetPeerIDByKey mocks base method.

func (*MockStore) GetPeerIdByLabel added in v0.65.0

func (m *MockStore) GetPeerIdByLabel(ctx context.Context, lockStrength LockingStrength, accountID, hostname string) (string, error)

GetPeerIdByLabel mocks base method.

func (*MockStore) GetPeerJobByID added in v0.65.0

func (m *MockStore) GetPeerJobByID(ctx context.Context, accountID, jobID string) (*types2.Job, error)

GetPeerJobByID mocks base method.

func (*MockStore) GetPeerJobs added in v0.65.0

func (m *MockStore) GetPeerJobs(ctx context.Context, accountID, peerID string) ([]*types2.Job, error)

GetPeerJobs mocks base method.

func (*MockStore) GetPeerLabelsInAccount added in v0.65.0

func (m *MockStore) GetPeerLabelsInAccount(ctx context.Context, lockStrength LockingStrength, accountId, hostname string) ([]string, error)

GetPeerLabelsInAccount mocks base method.

func (*MockStore) GetPeersByGroupIDs added in v0.65.0

func (m *MockStore) GetPeersByGroupIDs(ctx context.Context, accountID string, groupIDs []string) ([]*peer.Peer, error)

GetPeersByGroupIDs mocks base method.

func (*MockStore) GetPeersByIDs added in v0.65.0

func (m *MockStore) GetPeersByIDs(ctx context.Context, lockStrength LockingStrength, accountID string, peerIDs []string) (map[string]*peer.Peer, error)

GetPeersByIDs mocks base method.

func (*MockStore) GetPolicyByID added in v0.65.0

func (m *MockStore) GetPolicyByID(ctx context.Context, lockStrength LockingStrength, accountID, policyID string) (*types2.Policy, error)

GetPolicyByID mocks base method.

func (*MockStore) GetPolicyRulesByResourceID added in v0.65.0

func (m *MockStore) GetPolicyRulesByResourceID(ctx context.Context, lockStrength LockingStrength, accountID, peerID string) ([]*types2.PolicyRule, error)

GetPolicyRulesByResourceID mocks base method.

func (*MockStore) GetPostureCheckByChecksDefinition added in v0.65.0

func (m *MockStore) GetPostureCheckByChecksDefinition(accountID string, checks *posture.ChecksDefinition) (*posture.Checks, error)

GetPostureCheckByChecksDefinition mocks base method.

func (*MockStore) GetPostureChecksByID added in v0.65.0

func (m *MockStore) GetPostureChecksByID(ctx context.Context, lockStrength LockingStrength, accountID, postureCheckID string) (*posture.Checks, error)

GetPostureChecksByID mocks base method.

func (*MockStore) GetPostureChecksByIDs added in v0.65.0

func (m *MockStore) GetPostureChecksByIDs(ctx context.Context, lockStrength LockingStrength, accountID string, postureChecksIDs []string) (map[string]*posture.Checks, error)

GetPostureChecksByIDs mocks base method.

func (*MockStore) GetProxyAccessTokenByHashedToken added in v0.65.0

func (m *MockStore) GetProxyAccessTokenByHashedToken(ctx context.Context, lockStrength LockingStrength, hashedToken types2.HashedProxyToken) (*types2.ProxyAccessToken, error)

GetProxyAccessTokenByHashedToken mocks base method.

func (*MockStore) GetResourceGroups added in v0.65.0

func (m *MockStore) GetResourceGroups(ctx context.Context, lockStrength LockingStrength, accountID, resourceID string) ([]*types2.Group, error)

GetResourceGroups mocks base method.

func (*MockStore) GetRouteByID added in v0.65.0

func (m *MockStore) GetRouteByID(ctx context.Context, lockStrength LockingStrength, accountID, routeID string) (*route.Route, error)

GetRouteByID mocks base method.

func (*MockStore) GetServiceByDomain added in v0.65.0

func (m *MockStore) GetServiceByDomain(ctx context.Context, accountID, domain string) (*reverseproxy.Service, error)

GetServiceByDomain mocks base method.

func (*MockStore) GetServiceByID added in v0.65.0

func (m *MockStore) GetServiceByID(ctx context.Context, lockStrength LockingStrength, accountID, serviceID string) (*reverseproxy.Service, error)

GetServiceByID mocks base method.

func (*MockStore) GetServiceTargetByTargetID added in v0.65.0

func (m *MockStore) GetServiceTargetByTargetID(ctx context.Context, lockStrength LockingStrength, accountID, targetID string) (*reverseproxy.Target, error)

GetServiceTargetByTargetID mocks base method.

func (*MockStore) GetServices added in v0.65.0

func (m *MockStore) GetServices(ctx context.Context, lockStrength LockingStrength) ([]*reverseproxy.Service, error)

GetServices mocks base method.

func (*MockStore) GetServicesByAccountID added in v0.66.0

func (m *MockStore) GetServicesByAccountID(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*reverseproxy.Service, error)

GetServicesByAccountID mocks base method.

func (*MockStore) GetSetupKeyByID added in v0.65.0

func (m *MockStore) GetSetupKeyByID(ctx context.Context, lockStrength LockingStrength, accountID, setupKeyID string) (*types2.SetupKey, error)

GetSetupKeyByID mocks base method.

func (*MockStore) GetSetupKeyBySecret added in v0.65.0

func (m *MockStore) GetSetupKeyBySecret(ctx context.Context, lockStrength LockingStrength, key string) (*types2.SetupKey, error)

GetSetupKeyBySecret mocks base method.

func (*MockStore) GetStoreEngine added in v0.65.0

func (m *MockStore) GetStoreEngine() types2.Engine

GetStoreEngine mocks base method.

func (*MockStore) GetTakenIPs added in v0.65.0

func (m *MockStore) GetTakenIPs(ctx context.Context, lockStrength LockingStrength, accountId string) ([]net.IP, error)

GetTakenIPs mocks base method.

func (*MockStore) GetTokenIDByHashedToken added in v0.65.0

func (m *MockStore) GetTokenIDByHashedToken(ctx context.Context, secret string) (string, error)

GetTokenIDByHashedToken mocks base method.

func (*MockStore) GetUserByPATID added in v0.65.0

func (m *MockStore) GetUserByPATID(ctx context.Context, lockStrength LockingStrength, patID string) (*types2.User, error)

GetUserByPATID mocks base method.

func (*MockStore) GetUserByUserID added in v0.65.0

func (m *MockStore) GetUserByUserID(ctx context.Context, lockStrength LockingStrength, userID string) (*types2.User, error)

GetUserByUserID mocks base method.

func (*MockStore) GetUserIDByPeerKey added in v0.65.0

func (m *MockStore) GetUserIDByPeerKey(ctx context.Context, lockStrength LockingStrength, peerKey string) (string, error)

GetUserIDByPeerKey mocks base method.

func (*MockStore) GetUserInviteByEmail added in v0.65.0

func (m *MockStore) GetUserInviteByEmail(ctx context.Context, lockStrength LockingStrength, accountID, email string) (*types2.UserInviteRecord, error)

GetUserInviteByEmail mocks base method.

func (*MockStore) GetUserInviteByHashedToken added in v0.65.0

func (m *MockStore) GetUserInviteByHashedToken(ctx context.Context, lockStrength LockingStrength, hashedToken string) (*types2.UserInviteRecord, error)

GetUserInviteByHashedToken mocks base method.

func (*MockStore) GetUserInviteByID added in v0.65.0

func (m *MockStore) GetUserInviteByID(ctx context.Context, lockStrength LockingStrength, accountID, inviteID string) (*types2.UserInviteRecord, error)

GetUserInviteByID mocks base method.

func (*MockStore) GetUserPATs added in v0.65.0

func (m *MockStore) GetUserPATs(ctx context.Context, lockStrength LockingStrength, userID string) ([]*types2.PersonalAccessToken, error)

GetUserPATs mocks base method.

func (*MockStore) GetUserPeers added in v0.65.0

func (m *MockStore) GetUserPeers(ctx context.Context, lockStrength LockingStrength, accountID, userID string) ([]*peer.Peer, error)

GetUserPeers mocks base method.

func (*MockStore) GetZoneByDomain added in v0.65.0

func (m *MockStore) GetZoneByDomain(ctx context.Context, accountID, domain string) (*zones.Zone, error)

GetZoneByDomain mocks base method.

func (*MockStore) GetZoneByID added in v0.65.0

func (m *MockStore) GetZoneByID(ctx context.Context, lockStrength LockingStrength, accountID, zoneID string) (*zones.Zone, error)

GetZoneByID mocks base method.

func (*MockStore) GetZoneDNSRecords added in v0.65.0

func (m *MockStore) GetZoneDNSRecords(ctx context.Context, lockStrength LockingStrength, accountID, zoneID string) ([]*records.Record, error)

GetZoneDNSRecords mocks base method.

func (*MockStore) GetZoneDNSRecordsByName added in v0.65.0

func (m *MockStore) GetZoneDNSRecordsByName(ctx context.Context, lockStrength LockingStrength, accountID, zoneID, name string) ([]*records.Record, error)

GetZoneDNSRecordsByName mocks base method.

func (*MockStore) IncrementNetworkSerial added in v0.65.0

func (m *MockStore) IncrementNetworkSerial(ctx context.Context, accountId string) error

IncrementNetworkSerial mocks base method.

func (*MockStore) IncrementSetupKeyUsage added in v0.65.0

func (m *MockStore) IncrementSetupKeyUsage(ctx context.Context, setupKeyID string) error

IncrementSetupKeyUsage mocks base method.

func (*MockStore) IsPrimaryAccount added in v0.65.0

func (m *MockStore) IsPrimaryAccount(ctx context.Context, accountID string) (bool, string, error)

IsPrimaryAccount mocks base method.

func (*MockStore) ListCustomDomains added in v0.65.0

func (m *MockStore) ListCustomDomains(ctx context.Context, accountID string) ([]*domain.Domain, error)

ListCustomDomains mocks base method.

func (*MockStore) ListFreeDomains added in v0.65.0

func (m *MockStore) ListFreeDomains(ctx context.Context, accountID string) ([]string, error)

ListFreeDomains mocks base method.

func (*MockStore) MarkAccountPrimary added in v0.65.0

func (m *MockStore) MarkAccountPrimary(ctx context.Context, accountID string) error

MarkAccountPrimary mocks base method.

func (*MockStore) MarkAllPendingJobsAsFailed added in v0.65.0

func (m *MockStore) MarkAllPendingJobsAsFailed(ctx context.Context, accountID, peerID, reason string) error

MarkAllPendingJobsAsFailed mocks base method.

func (*MockStore) MarkPATUsed added in v0.65.0

func (m *MockStore) MarkPATUsed(ctx context.Context, patID string) error

MarkPATUsed mocks base method.

func (*MockStore) MarkPendingJobsAsFailed added in v0.65.0

func (m *MockStore) MarkPendingJobsAsFailed(ctx context.Context, accountID, peerID, jobID, reason string) error

MarkPendingJobsAsFailed mocks base method.

func (*MockStore) MarkProxyAccessTokenUsed added in v0.65.0

func (m *MockStore) MarkProxyAccessTokenUsed(ctx context.Context, tokenID string) error

MarkProxyAccessTokenUsed mocks base method.

func (*MockStore) RemovePeerFromAllGroups added in v0.65.0

func (m *MockStore) RemovePeerFromAllGroups(ctx context.Context, peerID string) error

RemovePeerFromAllGroups mocks base method.

func (*MockStore) RemovePeerFromGroup added in v0.65.0

func (m *MockStore) RemovePeerFromGroup(ctx context.Context, peerID, groupID string) error

RemovePeerFromGroup mocks base method.

func (*MockStore) RemoveResourceFromGroup added in v0.65.0

func (m *MockStore) RemoveResourceFromGroup(ctx context.Context, accountId, groupID, resourceID string) error

RemoveResourceFromGroup mocks base method.

func (*MockStore) RevokeProxyAccessToken added in v0.65.0

func (m *MockStore) RevokeProxyAccessToken(ctx context.Context, tokenID string) error

RevokeProxyAccessToken mocks base method.

func (*MockStore) SaveAccount added in v0.65.0

func (m *MockStore) SaveAccount(ctx context.Context, account *types2.Account) error

SaveAccount mocks base method.

func (*MockStore) SaveAccountOnboarding added in v0.65.0

func (m *MockStore) SaveAccountOnboarding(ctx context.Context, onboarding *types2.AccountOnboarding) error

SaveAccountOnboarding mocks base method.

func (*MockStore) SaveAccountSettings added in v0.65.0

func (m *MockStore) SaveAccountSettings(ctx context.Context, accountID string, settings *types2.Settings) error

SaveAccountSettings mocks base method.

func (*MockStore) SaveDNSSettings added in v0.65.0

func (m *MockStore) SaveDNSSettings(ctx context.Context, accountID string, settings *types2.DNSSettings) error

SaveDNSSettings mocks base method.

func (*MockStore) SaveInstallationID added in v0.65.0

func (m *MockStore) SaveInstallationID(ctx context.Context, ID string) error

SaveInstallationID mocks base method.

func (*MockStore) SaveNameServerGroup added in v0.65.0

func (m *MockStore) SaveNameServerGroup(ctx context.Context, nameServerGroup *dns.NameServerGroup) error

SaveNameServerGroup mocks base method.

func (*MockStore) SaveNetwork added in v0.65.0

func (m *MockStore) SaveNetwork(ctx context.Context, network *types1.Network) error

SaveNetwork mocks base method.

func (*MockStore) SaveNetworkResource added in v0.65.0

func (m *MockStore) SaveNetworkResource(ctx context.Context, resource *types.NetworkResource) error

SaveNetworkResource mocks base method.

func (*MockStore) SaveNetworkRouter added in v0.65.0

func (m *MockStore) SaveNetworkRouter(ctx context.Context, router *types0.NetworkRouter) error

SaveNetworkRouter mocks base method.

func (*MockStore) SavePAT added in v0.65.0

func (m *MockStore) SavePAT(ctx context.Context, pat *types2.PersonalAccessToken) error

SavePAT mocks base method.

func (*MockStore) SavePeer added in v0.65.0

func (m *MockStore) SavePeer(ctx context.Context, accountID string, peer *peer.Peer) error

SavePeer mocks base method.

func (*MockStore) SavePeerLocation added in v0.65.0

func (m *MockStore) SavePeerLocation(ctx context.Context, accountID string, peer *peer.Peer) error

SavePeerLocation mocks base method.

func (*MockStore) SavePeerStatus added in v0.65.0

func (m *MockStore) SavePeerStatus(ctx context.Context, accountID, peerID string, status peer.PeerStatus) error

SavePeerStatus mocks base method.

func (*MockStore) SavePolicy added in v0.65.0

func (m *MockStore) SavePolicy(ctx context.Context, policy *types2.Policy) error

SavePolicy mocks base method.

func (*MockStore) SavePostureChecks added in v0.65.0

func (m *MockStore) SavePostureChecks(ctx context.Context, postureCheck *posture.Checks) error

SavePostureChecks mocks base method.

func (*MockStore) SaveProxyAccessToken added in v0.65.0

func (m *MockStore) SaveProxyAccessToken(ctx context.Context, token *types2.ProxyAccessToken) error

SaveProxyAccessToken mocks base method.

func (*MockStore) SaveRoute added in v0.65.0

func (m *MockStore) SaveRoute(ctx context.Context, route *route.Route) error

SaveRoute mocks base method.

func (*MockStore) SaveSetupKey added in v0.65.0

func (m *MockStore) SaveSetupKey(ctx context.Context, setupKey *types2.SetupKey) error

SaveSetupKey mocks base method.

func (*MockStore) SaveUser added in v0.65.0

func (m *MockStore) SaveUser(ctx context.Context, user *types2.User) error

SaveUser mocks base method.

func (*MockStore) SaveUserInvite added in v0.65.0

func (m *MockStore) SaveUserInvite(ctx context.Context, invite *types2.UserInviteRecord) error

SaveUserInvite mocks base method.

func (*MockStore) SaveUserLastLogin added in v0.65.0

func (m *MockStore) SaveUserLastLogin(ctx context.Context, accountID, userID string, lastLogin time.Time) error

SaveUserLastLogin mocks base method.

func (*MockStore) SaveUsers added in v0.65.0

func (m *MockStore) SaveUsers(ctx context.Context, users []*types2.User) error

SaveUsers mocks base method.

func (*MockStore) SetFieldEncrypt added in v0.65.0

func (m *MockStore) SetFieldEncrypt(enc *crypt.FieldEncrypt)

SetFieldEncrypt mocks base method.

func (*MockStore) UpdateAccountDomainAttributes added in v0.65.0

func (m *MockStore) UpdateAccountDomainAttributes(ctx context.Context, accountID, domain, category string, isPrimaryDomain bool) error

UpdateAccountDomainAttributes mocks base method.

func (*MockStore) UpdateAccountNetwork added in v0.65.0

func (m *MockStore) UpdateAccountNetwork(ctx context.Context, accountID string, ipNet net.IPNet) error

UpdateAccountNetwork mocks base method.

func (*MockStore) UpdateCustomDomain added in v0.65.0

func (m *MockStore) UpdateCustomDomain(ctx context.Context, accountID string, d *domain.Domain) (*domain.Domain, error)

UpdateCustomDomain mocks base method.

func (*MockStore) UpdateDNSRecord added in v0.65.0

func (m *MockStore) UpdateDNSRecord(ctx context.Context, record *records.Record) error

UpdateDNSRecord mocks base method.

func (*MockStore) UpdateGroup added in v0.65.0

func (m *MockStore) UpdateGroup(ctx context.Context, group *types2.Group) error

UpdateGroup mocks base method.

func (*MockStore) UpdateGroups added in v0.65.0

func (m *MockStore) UpdateGroups(ctx context.Context, accountID string, groups []*types2.Group) error

UpdateGroups mocks base method.

func (*MockStore) UpdateService added in v0.65.0

func (m *MockStore) UpdateService(ctx context.Context, service *reverseproxy.Service) error

UpdateService mocks base method.

func (*MockStore) UpdateZone added in v0.65.0

func (m *MockStore) UpdateZone(ctx context.Context, zone *zones.Zone) error

UpdateZone mocks base method.

type MockStoreMockRecorder added in v0.65.0

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

MockStoreMockRecorder is the mock recorder for MockStore.

func (*MockStoreMockRecorder) AccountExists added in v0.65.0

func (mr *MockStoreMockRecorder) AccountExists(ctx, lockStrength, id interface{}) *gomock.Call

AccountExists indicates an expected call of AccountExists.

func (*MockStoreMockRecorder) AcquireGlobalLock added in v0.65.0

func (mr *MockStoreMockRecorder) AcquireGlobalLock(ctx interface{}) *gomock.Call

AcquireGlobalLock indicates an expected call of AcquireGlobalLock.

func (*MockStoreMockRecorder) AddPeerToAccount added in v0.65.0

func (mr *MockStoreMockRecorder) AddPeerToAccount(ctx, peer interface{}) *gomock.Call

AddPeerToAccount indicates an expected call of AddPeerToAccount.

func (*MockStoreMockRecorder) AddPeerToAllGroup added in v0.65.0

func (mr *MockStoreMockRecorder) AddPeerToAllGroup(ctx, accountID, peerID interface{}) *gomock.Call

AddPeerToAllGroup indicates an expected call of AddPeerToAllGroup.

func (*MockStoreMockRecorder) AddPeerToGroup added in v0.65.0

func (mr *MockStoreMockRecorder) AddPeerToGroup(ctx, accountID, peerId, groupID interface{}) *gomock.Call

AddPeerToGroup indicates an expected call of AddPeerToGroup.

func (*MockStoreMockRecorder) AddResourceToGroup added in v0.65.0

func (mr *MockStoreMockRecorder) AddResourceToGroup(ctx, accountId, groupID, resource interface{}) *gomock.Call

AddResourceToGroup indicates an expected call of AddResourceToGroup.

func (*MockStoreMockRecorder) ApproveAccountPeers added in v0.65.0

func (mr *MockStoreMockRecorder) ApproveAccountPeers(ctx, accountID interface{}) *gomock.Call

ApproveAccountPeers indicates an expected call of ApproveAccountPeers.

func (*MockStoreMockRecorder) Close added in v0.65.0

func (mr *MockStoreMockRecorder) Close(ctx interface{}) *gomock.Call

Close indicates an expected call of Close.

func (*MockStoreMockRecorder) CompletePeerJob added in v0.65.0

func (mr *MockStoreMockRecorder) CompletePeerJob(ctx, job interface{}) *gomock.Call

CompletePeerJob indicates an expected call of CompletePeerJob.

func (*MockStoreMockRecorder) CountAccountsByPrivateDomain added in v0.65.0

func (mr *MockStoreMockRecorder) CountAccountsByPrivateDomain(ctx, domain interface{}) *gomock.Call

CountAccountsByPrivateDomain indicates an expected call of CountAccountsByPrivateDomain.

func (*MockStoreMockRecorder) CreateAccessLog added in v0.65.0

func (mr *MockStoreMockRecorder) CreateAccessLog(ctx, log interface{}) *gomock.Call

CreateAccessLog indicates an expected call of CreateAccessLog.

func (*MockStoreMockRecorder) CreateCustomDomain added in v0.65.0

func (mr *MockStoreMockRecorder) CreateCustomDomain(ctx, accountID, domainName, targetCluster, validated interface{}) *gomock.Call

CreateCustomDomain indicates an expected call of CreateCustomDomain.

func (*MockStoreMockRecorder) CreateDNSRecord added in v0.65.0

func (mr *MockStoreMockRecorder) CreateDNSRecord(ctx, record interface{}) *gomock.Call

CreateDNSRecord indicates an expected call of CreateDNSRecord.

func (*MockStoreMockRecorder) CreateGroup added in v0.65.0

func (mr *MockStoreMockRecorder) CreateGroup(ctx, group interface{}) *gomock.Call

CreateGroup indicates an expected call of CreateGroup.

func (*MockStoreMockRecorder) CreateGroups added in v0.65.0

func (mr *MockStoreMockRecorder) CreateGroups(ctx, accountID, groups interface{}) *gomock.Call

CreateGroups indicates an expected call of CreateGroups.

func (*MockStoreMockRecorder) CreatePeerJob added in v0.65.0

func (mr *MockStoreMockRecorder) CreatePeerJob(ctx, job interface{}) *gomock.Call

CreatePeerJob indicates an expected call of CreatePeerJob.

func (*MockStoreMockRecorder) CreatePolicy added in v0.65.0

func (mr *MockStoreMockRecorder) CreatePolicy(ctx, policy interface{}) *gomock.Call

CreatePolicy indicates an expected call of CreatePolicy.

func (*MockStoreMockRecorder) CreateService added in v0.65.0

func (mr *MockStoreMockRecorder) CreateService(ctx, service interface{}) *gomock.Call

CreateService indicates an expected call of CreateService.

func (*MockStoreMockRecorder) CreateZone added in v0.65.0

func (mr *MockStoreMockRecorder) CreateZone(ctx, zone interface{}) *gomock.Call

CreateZone indicates an expected call of CreateZone.

func (*MockStoreMockRecorder) DeleteAccount added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteAccount(ctx, account interface{}) *gomock.Call

DeleteAccount indicates an expected call of DeleteAccount.

func (*MockStoreMockRecorder) DeleteCustomDomain added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteCustomDomain(ctx, accountID, domainID interface{}) *gomock.Call

DeleteCustomDomain indicates an expected call of DeleteCustomDomain.

func (*MockStoreMockRecorder) DeleteDNSRecord added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteDNSRecord(ctx, accountID, zoneID, recordID interface{}) *gomock.Call

DeleteDNSRecord indicates an expected call of DeleteDNSRecord.

func (*MockStoreMockRecorder) DeleteGroup added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteGroup(ctx, accountID, groupID interface{}) *gomock.Call

DeleteGroup indicates an expected call of DeleteGroup.

func (*MockStoreMockRecorder) DeleteGroups added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteGroups(ctx, accountID, groupIDs interface{}) *gomock.Call

DeleteGroups indicates an expected call of DeleteGroups.

func (*MockStoreMockRecorder) DeleteHashedPAT2TokenIDIndex added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteHashedPAT2TokenIDIndex(hashedToken interface{}) *gomock.Call

DeleteHashedPAT2TokenIDIndex indicates an expected call of DeleteHashedPAT2TokenIDIndex.

func (*MockStoreMockRecorder) DeleteNameServerGroup added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteNameServerGroup(ctx, accountID, nameServerGroupID interface{}) *gomock.Call

DeleteNameServerGroup indicates an expected call of DeleteNameServerGroup.

func (*MockStoreMockRecorder) DeleteNetwork added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteNetwork(ctx, accountID, networkID interface{}) *gomock.Call

DeleteNetwork indicates an expected call of DeleteNetwork.

func (*MockStoreMockRecorder) DeleteNetworkResource added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteNetworkResource(ctx, accountID, resourceID interface{}) *gomock.Call

DeleteNetworkResource indicates an expected call of DeleteNetworkResource.

func (*MockStoreMockRecorder) DeleteNetworkRouter added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteNetworkRouter(ctx, accountID, routerID interface{}) *gomock.Call

DeleteNetworkRouter indicates an expected call of DeleteNetworkRouter.

func (*MockStoreMockRecorder) DeleteOldAccessLogs added in v0.66.0

func (mr *MockStoreMockRecorder) DeleteOldAccessLogs(ctx, olderThan interface{}) *gomock.Call

DeleteOldAccessLogs indicates an expected call of DeleteOldAccessLogs.

func (*MockStoreMockRecorder) DeletePAT added in v0.65.0

func (mr *MockStoreMockRecorder) DeletePAT(ctx, userID, patID interface{}) *gomock.Call

DeletePAT indicates an expected call of DeletePAT.

func (*MockStoreMockRecorder) DeletePeer added in v0.65.0

func (mr *MockStoreMockRecorder) DeletePeer(ctx, accountID, peerID interface{}) *gomock.Call

DeletePeer indicates an expected call of DeletePeer.

func (*MockStoreMockRecorder) DeletePolicy added in v0.65.0

func (mr *MockStoreMockRecorder) DeletePolicy(ctx, accountID, policyID interface{}) *gomock.Call

DeletePolicy indicates an expected call of DeletePolicy.

func (*MockStoreMockRecorder) DeletePostureChecks added in v0.65.0

func (mr *MockStoreMockRecorder) DeletePostureChecks(ctx, accountID, postureChecksID interface{}) *gomock.Call

DeletePostureChecks indicates an expected call of DeletePostureChecks.

func (*MockStoreMockRecorder) DeleteRoute added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteRoute(ctx, accountID, routeID interface{}) *gomock.Call

DeleteRoute indicates an expected call of DeleteRoute.

func (*MockStoreMockRecorder) DeleteService added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteService(ctx, accountID, serviceID interface{}) *gomock.Call

DeleteService indicates an expected call of DeleteService.

func (*MockStoreMockRecorder) DeleteSetupKey added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteSetupKey(ctx, accountID, keyID interface{}) *gomock.Call

DeleteSetupKey indicates an expected call of DeleteSetupKey.

func (*MockStoreMockRecorder) DeleteTokenID2UserIDIndex added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteTokenID2UserIDIndex(tokenID interface{}) *gomock.Call

DeleteTokenID2UserIDIndex indicates an expected call of DeleteTokenID2UserIDIndex.

func (*MockStoreMockRecorder) DeleteUser added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteUser(ctx, accountID, userID interface{}) *gomock.Call

DeleteUser indicates an expected call of DeleteUser.

func (*MockStoreMockRecorder) DeleteUserInvite added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteUserInvite(ctx, inviteID interface{}) *gomock.Call

DeleteUserInvite indicates an expected call of DeleteUserInvite.

func (*MockStoreMockRecorder) DeleteZone added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteZone(ctx, accountID, zoneID interface{}) *gomock.Call

DeleteZone indicates an expected call of DeleteZone.

func (*MockStoreMockRecorder) DeleteZoneDNSRecords added in v0.65.0

func (mr *MockStoreMockRecorder) DeleteZoneDNSRecords(ctx, accountID, zoneID interface{}) *gomock.Call

DeleteZoneDNSRecords indicates an expected call of DeleteZoneDNSRecords.

func (*MockStoreMockRecorder) ExecuteInTransaction added in v0.65.0

func (mr *MockStoreMockRecorder) ExecuteInTransaction(ctx, f interface{}) *gomock.Call

ExecuteInTransaction indicates an expected call of ExecuteInTransaction.

func (*MockStoreMockRecorder) GetAccount added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccount(ctx, accountID interface{}) *gomock.Call

GetAccount indicates an expected call of GetAccount.

func (*MockStoreMockRecorder) GetAccountAccessLogs added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountAccessLogs(ctx, lockStrength, accountID, filter interface{}) *gomock.Call

GetAccountAccessLogs indicates an expected call of GetAccountAccessLogs.

func (*MockStoreMockRecorder) GetAccountByPeerID added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountByPeerID(ctx, peerID interface{}) *gomock.Call

GetAccountByPeerID indicates an expected call of GetAccountByPeerID.

func (*MockStoreMockRecorder) GetAccountByPeerPubKey added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountByPeerPubKey(ctx, peerKey interface{}) *gomock.Call

GetAccountByPeerPubKey indicates an expected call of GetAccountByPeerPubKey.

func (*MockStoreMockRecorder) GetAccountByPrivateDomain added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountByPrivateDomain(ctx, domain interface{}) *gomock.Call

GetAccountByPrivateDomain indicates an expected call of GetAccountByPrivateDomain.

func (*MockStoreMockRecorder) GetAccountBySetupKey added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountBySetupKey(ctx, setupKey interface{}) *gomock.Call

GetAccountBySetupKey indicates an expected call of GetAccountBySetupKey.

func (*MockStoreMockRecorder) GetAccountByUser added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountByUser(ctx, userID interface{}) *gomock.Call

GetAccountByUser indicates an expected call of GetAccountByUser.

func (*MockStoreMockRecorder) GetAccountCreatedBy added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountCreatedBy(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountCreatedBy indicates an expected call of GetAccountCreatedBy.

func (*MockStoreMockRecorder) GetAccountDNSSettings added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountDNSSettings(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountDNSSettings indicates an expected call of GetAccountDNSSettings.

func (*MockStoreMockRecorder) GetAccountDomainAndCategory added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountDomainAndCategory(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountDomainAndCategory indicates an expected call of GetAccountDomainAndCategory.

func (*MockStoreMockRecorder) GetAccountGroupPeers added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountGroupPeers(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountGroupPeers indicates an expected call of GetAccountGroupPeers.

func (*MockStoreMockRecorder) GetAccountGroups added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountGroups(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountGroups indicates an expected call of GetAccountGroups.

func (*MockStoreMockRecorder) GetAccountIDByPeerID added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountIDByPeerID(ctx, lockStrength, peerID interface{}) *gomock.Call

GetAccountIDByPeerID indicates an expected call of GetAccountIDByPeerID.

func (*MockStoreMockRecorder) GetAccountIDByPeerPubKey added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountIDByPeerPubKey(ctx, peerKey interface{}) *gomock.Call

GetAccountIDByPeerPubKey indicates an expected call of GetAccountIDByPeerPubKey.

func (*MockStoreMockRecorder) GetAccountIDByPrivateDomain added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountIDByPrivateDomain(ctx, lockStrength, domain interface{}) *gomock.Call

GetAccountIDByPrivateDomain indicates an expected call of GetAccountIDByPrivateDomain.

func (*MockStoreMockRecorder) GetAccountIDBySetupKey added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountIDBySetupKey(ctx, peerKey interface{}) *gomock.Call

GetAccountIDBySetupKey indicates an expected call of GetAccountIDBySetupKey.

func (*MockStoreMockRecorder) GetAccountIDByUserID added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountIDByUserID(ctx, lockStrength, userID interface{}) *gomock.Call

GetAccountIDByUserID indicates an expected call of GetAccountIDByUserID.

func (*MockStoreMockRecorder) GetAccountMeta added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountMeta(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountMeta indicates an expected call of GetAccountMeta.

func (*MockStoreMockRecorder) GetAccountNameServerGroups added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountNameServerGroups(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountNameServerGroups indicates an expected call of GetAccountNameServerGroups.

func (*MockStoreMockRecorder) GetAccountNetwork added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountNetwork(ctx, lockStrength, accountId interface{}) *gomock.Call

GetAccountNetwork indicates an expected call of GetAccountNetwork.

func (*MockStoreMockRecorder) GetAccountNetworks added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountNetworks(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountNetworks indicates an expected call of GetAccountNetworks.

func (*MockStoreMockRecorder) GetAccountOnboarding added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountOnboarding(ctx, accountID interface{}) *gomock.Call

GetAccountOnboarding indicates an expected call of GetAccountOnboarding.

func (*MockStoreMockRecorder) GetAccountOwner added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountOwner(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountOwner indicates an expected call of GetAccountOwner.

func (*MockStoreMockRecorder) GetAccountPeers added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountPeers(ctx, lockStrength, accountID, nameFilter, ipFilter interface{}) *gomock.Call

GetAccountPeers indicates an expected call of GetAccountPeers.

func (*MockStoreMockRecorder) GetAccountPeersWithExpiration added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountPeersWithExpiration(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountPeersWithExpiration indicates an expected call of GetAccountPeersWithExpiration.

func (*MockStoreMockRecorder) GetAccountPeersWithInactivity added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountPeersWithInactivity(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountPeersWithInactivity indicates an expected call of GetAccountPeersWithInactivity.

func (*MockStoreMockRecorder) GetAccountPolicies added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountPolicies(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountPolicies indicates an expected call of GetAccountPolicies.

func (*MockStoreMockRecorder) GetAccountPostureChecks added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountPostureChecks(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountPostureChecks indicates an expected call of GetAccountPostureChecks.

func (*MockStoreMockRecorder) GetAccountRoutes added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountRoutes(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountRoutes indicates an expected call of GetAccountRoutes.

func (*MockStoreMockRecorder) GetAccountServices added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountServices(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountServices indicates an expected call of GetAccountServices.

func (*MockStoreMockRecorder) GetAccountSettings added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountSettings(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountSettings indicates an expected call of GetAccountSettings.

func (*MockStoreMockRecorder) GetAccountSetupKeys added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountSetupKeys(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountSetupKeys indicates an expected call of GetAccountSetupKeys.

func (*MockStoreMockRecorder) GetAccountUserInvites added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountUserInvites(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountUserInvites indicates an expected call of GetAccountUserInvites.

func (*MockStoreMockRecorder) GetAccountUsers added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountUsers(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountUsers indicates an expected call of GetAccountUsers.

func (*MockStoreMockRecorder) GetAccountZones added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountZones(ctx, lockStrength, accountID interface{}) *gomock.Call

GetAccountZones indicates an expected call of GetAccountZones.

func (*MockStoreMockRecorder) GetAccountsCounter added in v0.65.0

func (mr *MockStoreMockRecorder) GetAccountsCounter(ctx interface{}) *gomock.Call

GetAccountsCounter indicates an expected call of GetAccountsCounter.

func (*MockStoreMockRecorder) GetAllAccounts added in v0.65.0

func (mr *MockStoreMockRecorder) GetAllAccounts(ctx interface{}) *gomock.Call

GetAllAccounts indicates an expected call of GetAllAccounts.

func (*MockStoreMockRecorder) GetAllEphemeralPeers added in v0.65.0

func (mr *MockStoreMockRecorder) GetAllEphemeralPeers(ctx, lockStrength interface{}) *gomock.Call

GetAllEphemeralPeers indicates an expected call of GetAllEphemeralPeers.

func (*MockStoreMockRecorder) GetAllProxyAccessTokens added in v0.65.0

func (mr *MockStoreMockRecorder) GetAllProxyAccessTokens(ctx, lockStrength interface{}) *gomock.Call

GetAllProxyAccessTokens indicates an expected call of GetAllProxyAccessTokens.

func (*MockStoreMockRecorder) GetAnyAccountID added in v0.65.0

func (mr *MockStoreMockRecorder) GetAnyAccountID(ctx interface{}) *gomock.Call

GetAnyAccountID indicates an expected call of GetAnyAccountID.

func (*MockStoreMockRecorder) GetCustomDomain added in v0.65.0

func (mr *MockStoreMockRecorder) GetCustomDomain(ctx, accountID, domainID interface{}) *gomock.Call

GetCustomDomain indicates an expected call of GetCustomDomain.

func (*MockStoreMockRecorder) GetCustomDomainsCounts added in v0.66.0

func (mr *MockStoreMockRecorder) GetCustomDomainsCounts(ctx interface{}) *gomock.Call

GetCustomDomainsCounts indicates an expected call of GetCustomDomainsCounts.

func (*MockStoreMockRecorder) GetDNSRecordByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetDNSRecordByID(ctx, lockStrength, accountID, zoneID, recordID interface{}) *gomock.Call

GetDNSRecordByID indicates an expected call of GetDNSRecordByID.

func (*MockStoreMockRecorder) GetGroupByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetGroupByID(ctx, lockStrength, accountID, groupID interface{}) *gomock.Call

GetGroupByID indicates an expected call of GetGroupByID.

func (*MockStoreMockRecorder) GetGroupByName added in v0.65.0

func (mr *MockStoreMockRecorder) GetGroupByName(ctx, lockStrength, groupName, accountID interface{}) *gomock.Call

GetGroupByName indicates an expected call of GetGroupByName.

func (*MockStoreMockRecorder) GetGroupsByIDs added in v0.65.0

func (mr *MockStoreMockRecorder) GetGroupsByIDs(ctx, lockStrength, accountID, groupIDs interface{}) *gomock.Call

GetGroupsByIDs indicates an expected call of GetGroupsByIDs.

func (*MockStoreMockRecorder) GetInstallationID added in v0.65.0

func (mr *MockStoreMockRecorder) GetInstallationID() *gomock.Call

GetInstallationID indicates an expected call of GetInstallationID.

func (*MockStoreMockRecorder) GetNameServerGroupByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetNameServerGroupByID(ctx, lockStrength, nameServerGroupID, accountID interface{}) *gomock.Call

GetNameServerGroupByID indicates an expected call of GetNameServerGroupByID.

func (*MockStoreMockRecorder) GetNetworkByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetNetworkByID(ctx, lockStrength, accountID, networkID interface{}) *gomock.Call

GetNetworkByID indicates an expected call of GetNetworkByID.

func (*MockStoreMockRecorder) GetNetworkResourceByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetNetworkResourceByID(ctx, lockStrength, accountID, resourceID interface{}) *gomock.Call

GetNetworkResourceByID indicates an expected call of GetNetworkResourceByID.

func (*MockStoreMockRecorder) GetNetworkResourceByName added in v0.65.0

func (mr *MockStoreMockRecorder) GetNetworkResourceByName(ctx, lockStrength, accountID, resourceName interface{}) *gomock.Call

GetNetworkResourceByName indicates an expected call of GetNetworkResourceByName.

func (*MockStoreMockRecorder) GetNetworkResourcesByAccountID added in v0.65.0

func (mr *MockStoreMockRecorder) GetNetworkResourcesByAccountID(ctx, lockStrength, accountID interface{}) *gomock.Call

GetNetworkResourcesByAccountID indicates an expected call of GetNetworkResourcesByAccountID.

func (*MockStoreMockRecorder) GetNetworkResourcesByNetID added in v0.65.0

func (mr *MockStoreMockRecorder) GetNetworkResourcesByNetID(ctx, lockStrength, accountID, netID interface{}) *gomock.Call

GetNetworkResourcesByNetID indicates an expected call of GetNetworkResourcesByNetID.

func (*MockStoreMockRecorder) GetNetworkRouterByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetNetworkRouterByID(ctx, lockStrength, accountID, routerID interface{}) *gomock.Call

GetNetworkRouterByID indicates an expected call of GetNetworkRouterByID.

func (*MockStoreMockRecorder) GetNetworkRoutersByAccountID added in v0.65.0

func (mr *MockStoreMockRecorder) GetNetworkRoutersByAccountID(ctx, lockStrength, accountID interface{}) *gomock.Call

GetNetworkRoutersByAccountID indicates an expected call of GetNetworkRoutersByAccountID.

func (*MockStoreMockRecorder) GetNetworkRoutersByNetID added in v0.65.0

func (mr *MockStoreMockRecorder) GetNetworkRoutersByNetID(ctx, lockStrength, accountID, netID interface{}) *gomock.Call

GetNetworkRoutersByNetID indicates an expected call of GetNetworkRoutersByNetID.

func (*MockStoreMockRecorder) GetPATByHashedToken added in v0.65.0

func (mr *MockStoreMockRecorder) GetPATByHashedToken(ctx, lockStrength, hashedToken interface{}) *gomock.Call

GetPATByHashedToken indicates an expected call of GetPATByHashedToken.

func (*MockStoreMockRecorder) GetPATByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetPATByID(ctx, lockStrength, userID, patID interface{}) *gomock.Call

GetPATByID indicates an expected call of GetPATByID.

func (*MockStoreMockRecorder) GetPeerByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeerByID(ctx, lockStrength, accountID, peerID interface{}) *gomock.Call

GetPeerByID indicates an expected call of GetPeerByID.

func (*MockStoreMockRecorder) GetPeerByIP added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeerByIP(ctx, lockStrength, accountID, ip interface{}) *gomock.Call

GetPeerByIP indicates an expected call of GetPeerByIP.

func (*MockStoreMockRecorder) GetPeerByPeerPubKey added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeerByPeerPubKey(ctx, lockStrength, peerKey interface{}) *gomock.Call

GetPeerByPeerPubKey indicates an expected call of GetPeerByPeerPubKey.

func (*MockStoreMockRecorder) GetPeerGroupIDs added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeerGroupIDs(ctx, lockStrength, accountId, peerId interface{}) *gomock.Call

GetPeerGroupIDs indicates an expected call of GetPeerGroupIDs.

func (*MockStoreMockRecorder) GetPeerGroups added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeerGroups(ctx, lockStrength, accountId, peerId interface{}) *gomock.Call

GetPeerGroups indicates an expected call of GetPeerGroups.

func (*MockStoreMockRecorder) GetPeerIDByKey added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeerIDByKey(ctx, lockStrength, key interface{}) *gomock.Call

GetPeerIDByKey indicates an expected call of GetPeerIDByKey.

func (*MockStoreMockRecorder) GetPeerIdByLabel added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeerIdByLabel(ctx, lockStrength, accountID, hostname interface{}) *gomock.Call

GetPeerIdByLabel indicates an expected call of GetPeerIdByLabel.

func (*MockStoreMockRecorder) GetPeerJobByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeerJobByID(ctx, accountID, jobID interface{}) *gomock.Call

GetPeerJobByID indicates an expected call of GetPeerJobByID.

func (*MockStoreMockRecorder) GetPeerJobs added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeerJobs(ctx, accountID, peerID interface{}) *gomock.Call

GetPeerJobs indicates an expected call of GetPeerJobs.

func (*MockStoreMockRecorder) GetPeerLabelsInAccount added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeerLabelsInAccount(ctx, lockStrength, accountId, hostname interface{}) *gomock.Call

GetPeerLabelsInAccount indicates an expected call of GetPeerLabelsInAccount.

func (*MockStoreMockRecorder) GetPeersByGroupIDs added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeersByGroupIDs(ctx, accountID, groupIDs interface{}) *gomock.Call

GetPeersByGroupIDs indicates an expected call of GetPeersByGroupIDs.

func (*MockStoreMockRecorder) GetPeersByIDs added in v0.65.0

func (mr *MockStoreMockRecorder) GetPeersByIDs(ctx, lockStrength, accountID, peerIDs interface{}) *gomock.Call

GetPeersByIDs indicates an expected call of GetPeersByIDs.

func (*MockStoreMockRecorder) GetPolicyByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetPolicyByID(ctx, lockStrength, accountID, policyID interface{}) *gomock.Call

GetPolicyByID indicates an expected call of GetPolicyByID.

func (*MockStoreMockRecorder) GetPolicyRulesByResourceID added in v0.65.0

func (mr *MockStoreMockRecorder) GetPolicyRulesByResourceID(ctx, lockStrength, accountID, peerID interface{}) *gomock.Call

GetPolicyRulesByResourceID indicates an expected call of GetPolicyRulesByResourceID.

func (*MockStoreMockRecorder) GetPostureCheckByChecksDefinition added in v0.65.0

func (mr *MockStoreMockRecorder) GetPostureCheckByChecksDefinition(accountID, checks interface{}) *gomock.Call

GetPostureCheckByChecksDefinition indicates an expected call of GetPostureCheckByChecksDefinition.

func (*MockStoreMockRecorder) GetPostureChecksByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetPostureChecksByID(ctx, lockStrength, accountID, postureCheckID interface{}) *gomock.Call

GetPostureChecksByID indicates an expected call of GetPostureChecksByID.

func (*MockStoreMockRecorder) GetPostureChecksByIDs added in v0.65.0

func (mr *MockStoreMockRecorder) GetPostureChecksByIDs(ctx, lockStrength, accountID, postureChecksIDs interface{}) *gomock.Call

GetPostureChecksByIDs indicates an expected call of GetPostureChecksByIDs.

func (*MockStoreMockRecorder) GetProxyAccessTokenByHashedToken added in v0.65.0

func (mr *MockStoreMockRecorder) GetProxyAccessTokenByHashedToken(ctx, lockStrength, hashedToken interface{}) *gomock.Call

GetProxyAccessTokenByHashedToken indicates an expected call of GetProxyAccessTokenByHashedToken.

func (*MockStoreMockRecorder) GetResourceGroups added in v0.65.0

func (mr *MockStoreMockRecorder) GetResourceGroups(ctx, lockStrength, accountID, resourceID interface{}) *gomock.Call

GetResourceGroups indicates an expected call of GetResourceGroups.

func (*MockStoreMockRecorder) GetRouteByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetRouteByID(ctx, lockStrength, accountID, routeID interface{}) *gomock.Call

GetRouteByID indicates an expected call of GetRouteByID.

func (*MockStoreMockRecorder) GetServiceByDomain added in v0.65.0

func (mr *MockStoreMockRecorder) GetServiceByDomain(ctx, accountID, domain interface{}) *gomock.Call

GetServiceByDomain indicates an expected call of GetServiceByDomain.

func (*MockStoreMockRecorder) GetServiceByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetServiceByID(ctx, lockStrength, accountID, serviceID interface{}) *gomock.Call

GetServiceByID indicates an expected call of GetServiceByID.

func (*MockStoreMockRecorder) GetServiceTargetByTargetID added in v0.65.0

func (mr *MockStoreMockRecorder) GetServiceTargetByTargetID(ctx, lockStrength, accountID, targetID interface{}) *gomock.Call

GetServiceTargetByTargetID indicates an expected call of GetServiceTargetByTargetID.

func (*MockStoreMockRecorder) GetServices added in v0.65.0

func (mr *MockStoreMockRecorder) GetServices(ctx, lockStrength interface{}) *gomock.Call

GetServices indicates an expected call of GetServices.

func (*MockStoreMockRecorder) GetServicesByAccountID added in v0.66.0

func (mr *MockStoreMockRecorder) GetServicesByAccountID(ctx, lockStrength, accountID interface{}) *gomock.Call

GetServicesByAccountID indicates an expected call of GetServicesByAccountID.

func (*MockStoreMockRecorder) GetSetupKeyByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetSetupKeyByID(ctx, lockStrength, accountID, setupKeyID interface{}) *gomock.Call

GetSetupKeyByID indicates an expected call of GetSetupKeyByID.

func (*MockStoreMockRecorder) GetSetupKeyBySecret added in v0.65.0

func (mr *MockStoreMockRecorder) GetSetupKeyBySecret(ctx, lockStrength, key interface{}) *gomock.Call

GetSetupKeyBySecret indicates an expected call of GetSetupKeyBySecret.

func (*MockStoreMockRecorder) GetStoreEngine added in v0.65.0

func (mr *MockStoreMockRecorder) GetStoreEngine() *gomock.Call

GetStoreEngine indicates an expected call of GetStoreEngine.

func (*MockStoreMockRecorder) GetTakenIPs added in v0.65.0

func (mr *MockStoreMockRecorder) GetTakenIPs(ctx, lockStrength, accountId interface{}) *gomock.Call

GetTakenIPs indicates an expected call of GetTakenIPs.

func (*MockStoreMockRecorder) GetTokenIDByHashedToken added in v0.65.0

func (mr *MockStoreMockRecorder) GetTokenIDByHashedToken(ctx, secret interface{}) *gomock.Call

GetTokenIDByHashedToken indicates an expected call of GetTokenIDByHashedToken.

func (*MockStoreMockRecorder) GetUserByPATID added in v0.65.0

func (mr *MockStoreMockRecorder) GetUserByPATID(ctx, lockStrength, patID interface{}) *gomock.Call

GetUserByPATID indicates an expected call of GetUserByPATID.

func (*MockStoreMockRecorder) GetUserByUserID added in v0.65.0

func (mr *MockStoreMockRecorder) GetUserByUserID(ctx, lockStrength, userID interface{}) *gomock.Call

GetUserByUserID indicates an expected call of GetUserByUserID.

func (*MockStoreMockRecorder) GetUserIDByPeerKey added in v0.65.0

func (mr *MockStoreMockRecorder) GetUserIDByPeerKey(ctx, lockStrength, peerKey interface{}) *gomock.Call

GetUserIDByPeerKey indicates an expected call of GetUserIDByPeerKey.

func (*MockStoreMockRecorder) GetUserInviteByEmail added in v0.65.0

func (mr *MockStoreMockRecorder) GetUserInviteByEmail(ctx, lockStrength, accountID, email interface{}) *gomock.Call

GetUserInviteByEmail indicates an expected call of GetUserInviteByEmail.

func (*MockStoreMockRecorder) GetUserInviteByHashedToken added in v0.65.0

func (mr *MockStoreMockRecorder) GetUserInviteByHashedToken(ctx, lockStrength, hashedToken interface{}) *gomock.Call

GetUserInviteByHashedToken indicates an expected call of GetUserInviteByHashedToken.

func (*MockStoreMockRecorder) GetUserInviteByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetUserInviteByID(ctx, lockStrength, accountID, inviteID interface{}) *gomock.Call

GetUserInviteByID indicates an expected call of GetUserInviteByID.

func (*MockStoreMockRecorder) GetUserPATs added in v0.65.0

func (mr *MockStoreMockRecorder) GetUserPATs(ctx, lockStrength, userID interface{}) *gomock.Call

GetUserPATs indicates an expected call of GetUserPATs.

func (*MockStoreMockRecorder) GetUserPeers added in v0.65.0

func (mr *MockStoreMockRecorder) GetUserPeers(ctx, lockStrength, accountID, userID interface{}) *gomock.Call

GetUserPeers indicates an expected call of GetUserPeers.

func (*MockStoreMockRecorder) GetZoneByDomain added in v0.65.0

func (mr *MockStoreMockRecorder) GetZoneByDomain(ctx, accountID, domain interface{}) *gomock.Call

GetZoneByDomain indicates an expected call of GetZoneByDomain.

func (*MockStoreMockRecorder) GetZoneByID added in v0.65.0

func (mr *MockStoreMockRecorder) GetZoneByID(ctx, lockStrength, accountID, zoneID interface{}) *gomock.Call

GetZoneByID indicates an expected call of GetZoneByID.

func (*MockStoreMockRecorder) GetZoneDNSRecords added in v0.65.0

func (mr *MockStoreMockRecorder) GetZoneDNSRecords(ctx, lockStrength, accountID, zoneID interface{}) *gomock.Call

GetZoneDNSRecords indicates an expected call of GetZoneDNSRecords.

func (*MockStoreMockRecorder) GetZoneDNSRecordsByName added in v0.65.0

func (mr *MockStoreMockRecorder) GetZoneDNSRecordsByName(ctx, lockStrength, accountID, zoneID, name interface{}) *gomock.Call

GetZoneDNSRecordsByName indicates an expected call of GetZoneDNSRecordsByName.

func (*MockStoreMockRecorder) IncrementNetworkSerial added in v0.65.0

func (mr *MockStoreMockRecorder) IncrementNetworkSerial(ctx, accountId interface{}) *gomock.Call

IncrementNetworkSerial indicates an expected call of IncrementNetworkSerial.

func (*MockStoreMockRecorder) IncrementSetupKeyUsage added in v0.65.0

func (mr *MockStoreMockRecorder) IncrementSetupKeyUsage(ctx, setupKeyID interface{}) *gomock.Call

IncrementSetupKeyUsage indicates an expected call of IncrementSetupKeyUsage.

func (*MockStoreMockRecorder) IsPrimaryAccount added in v0.65.0

func (mr *MockStoreMockRecorder) IsPrimaryAccount(ctx, accountID interface{}) *gomock.Call

IsPrimaryAccount indicates an expected call of IsPrimaryAccount.

func (*MockStoreMockRecorder) ListCustomDomains added in v0.65.0

func (mr *MockStoreMockRecorder) ListCustomDomains(ctx, accountID interface{}) *gomock.Call

ListCustomDomains indicates an expected call of ListCustomDomains.

func (*MockStoreMockRecorder) ListFreeDomains added in v0.65.0

func (mr *MockStoreMockRecorder) ListFreeDomains(ctx, accountID interface{}) *gomock.Call

ListFreeDomains indicates an expected call of ListFreeDomains.

func (*MockStoreMockRecorder) MarkAccountPrimary added in v0.65.0

func (mr *MockStoreMockRecorder) MarkAccountPrimary(ctx, accountID interface{}) *gomock.Call

MarkAccountPrimary indicates an expected call of MarkAccountPrimary.

func (*MockStoreMockRecorder) MarkAllPendingJobsAsFailed added in v0.65.0

func (mr *MockStoreMockRecorder) MarkAllPendingJobsAsFailed(ctx, accountID, peerID, reason interface{}) *gomock.Call

MarkAllPendingJobsAsFailed indicates an expected call of MarkAllPendingJobsAsFailed.

func (*MockStoreMockRecorder) MarkPATUsed added in v0.65.0

func (mr *MockStoreMockRecorder) MarkPATUsed(ctx, patID interface{}) *gomock.Call

MarkPATUsed indicates an expected call of MarkPATUsed.

func (*MockStoreMockRecorder) MarkPendingJobsAsFailed added in v0.65.0

func (mr *MockStoreMockRecorder) MarkPendingJobsAsFailed(ctx, accountID, peerID, jobID, reason interface{}) *gomock.Call

MarkPendingJobsAsFailed indicates an expected call of MarkPendingJobsAsFailed.

func (*MockStoreMockRecorder) MarkProxyAccessTokenUsed added in v0.65.0

func (mr *MockStoreMockRecorder) MarkProxyAccessTokenUsed(ctx, tokenID interface{}) *gomock.Call

MarkProxyAccessTokenUsed indicates an expected call of MarkProxyAccessTokenUsed.

func (*MockStoreMockRecorder) RemovePeerFromAllGroups added in v0.65.0

func (mr *MockStoreMockRecorder) RemovePeerFromAllGroups(ctx, peerID interface{}) *gomock.Call

RemovePeerFromAllGroups indicates an expected call of RemovePeerFromAllGroups.

func (*MockStoreMockRecorder) RemovePeerFromGroup added in v0.65.0

func (mr *MockStoreMockRecorder) RemovePeerFromGroup(ctx, peerID, groupID interface{}) *gomock.Call

RemovePeerFromGroup indicates an expected call of RemovePeerFromGroup.

func (*MockStoreMockRecorder) RemoveResourceFromGroup added in v0.65.0

func (mr *MockStoreMockRecorder) RemoveResourceFromGroup(ctx, accountId, groupID, resourceID interface{}) *gomock.Call

RemoveResourceFromGroup indicates an expected call of RemoveResourceFromGroup.

func (*MockStoreMockRecorder) RevokeProxyAccessToken added in v0.65.0

func (mr *MockStoreMockRecorder) RevokeProxyAccessToken(ctx, tokenID interface{}) *gomock.Call

RevokeProxyAccessToken indicates an expected call of RevokeProxyAccessToken.

func (*MockStoreMockRecorder) SaveAccount added in v0.65.0

func (mr *MockStoreMockRecorder) SaveAccount(ctx, account interface{}) *gomock.Call

SaveAccount indicates an expected call of SaveAccount.

func (*MockStoreMockRecorder) SaveAccountOnboarding added in v0.65.0

func (mr *MockStoreMockRecorder) SaveAccountOnboarding(ctx, onboarding interface{}) *gomock.Call

SaveAccountOnboarding indicates an expected call of SaveAccountOnboarding.

func (*MockStoreMockRecorder) SaveAccountSettings added in v0.65.0

func (mr *MockStoreMockRecorder) SaveAccountSettings(ctx, accountID, settings interface{}) *gomock.Call

SaveAccountSettings indicates an expected call of SaveAccountSettings.

func (*MockStoreMockRecorder) SaveDNSSettings added in v0.65.0

func (mr *MockStoreMockRecorder) SaveDNSSettings(ctx, accountID, settings interface{}) *gomock.Call

SaveDNSSettings indicates an expected call of SaveDNSSettings.

func (*MockStoreMockRecorder) SaveInstallationID added in v0.65.0

func (mr *MockStoreMockRecorder) SaveInstallationID(ctx, ID interface{}) *gomock.Call

SaveInstallationID indicates an expected call of SaveInstallationID.

func (*MockStoreMockRecorder) SaveNameServerGroup added in v0.65.0

func (mr *MockStoreMockRecorder) SaveNameServerGroup(ctx, nameServerGroup interface{}) *gomock.Call

SaveNameServerGroup indicates an expected call of SaveNameServerGroup.

func (*MockStoreMockRecorder) SaveNetwork added in v0.65.0

func (mr *MockStoreMockRecorder) SaveNetwork(ctx, network interface{}) *gomock.Call

SaveNetwork indicates an expected call of SaveNetwork.

func (*MockStoreMockRecorder) SaveNetworkResource added in v0.65.0

func (mr *MockStoreMockRecorder) SaveNetworkResource(ctx, resource interface{}) *gomock.Call

SaveNetworkResource indicates an expected call of SaveNetworkResource.

func (*MockStoreMockRecorder) SaveNetworkRouter added in v0.65.0

func (mr *MockStoreMockRecorder) SaveNetworkRouter(ctx, router interface{}) *gomock.Call

SaveNetworkRouter indicates an expected call of SaveNetworkRouter.

func (*MockStoreMockRecorder) SavePAT added in v0.65.0

func (mr *MockStoreMockRecorder) SavePAT(ctx, pat interface{}) *gomock.Call

SavePAT indicates an expected call of SavePAT.

func (*MockStoreMockRecorder) SavePeer added in v0.65.0

func (mr *MockStoreMockRecorder) SavePeer(ctx, accountID, peer interface{}) *gomock.Call

SavePeer indicates an expected call of SavePeer.

func (*MockStoreMockRecorder) SavePeerLocation added in v0.65.0

func (mr *MockStoreMockRecorder) SavePeerLocation(ctx, accountID, peer interface{}) *gomock.Call

SavePeerLocation indicates an expected call of SavePeerLocation.

func (*MockStoreMockRecorder) SavePeerStatus added in v0.65.0

func (mr *MockStoreMockRecorder) SavePeerStatus(ctx, accountID, peerID, status interface{}) *gomock.Call

SavePeerStatus indicates an expected call of SavePeerStatus.

func (*MockStoreMockRecorder) SavePolicy added in v0.65.0

func (mr *MockStoreMockRecorder) SavePolicy(ctx, policy interface{}) *gomock.Call

SavePolicy indicates an expected call of SavePolicy.

func (*MockStoreMockRecorder) SavePostureChecks added in v0.65.0

func (mr *MockStoreMockRecorder) SavePostureChecks(ctx, postureCheck interface{}) *gomock.Call

SavePostureChecks indicates an expected call of SavePostureChecks.

func (*MockStoreMockRecorder) SaveProxyAccessToken added in v0.65.0

func (mr *MockStoreMockRecorder) SaveProxyAccessToken(ctx, token interface{}) *gomock.Call

SaveProxyAccessToken indicates an expected call of SaveProxyAccessToken.

func (*MockStoreMockRecorder) SaveRoute added in v0.65.0

func (mr *MockStoreMockRecorder) SaveRoute(ctx, route interface{}) *gomock.Call

SaveRoute indicates an expected call of SaveRoute.

func (*MockStoreMockRecorder) SaveSetupKey added in v0.65.0

func (mr *MockStoreMockRecorder) SaveSetupKey(ctx, setupKey interface{}) *gomock.Call

SaveSetupKey indicates an expected call of SaveSetupKey.

func (*MockStoreMockRecorder) SaveUser added in v0.65.0

func (mr *MockStoreMockRecorder) SaveUser(ctx, user interface{}) *gomock.Call

SaveUser indicates an expected call of SaveUser.

func (*MockStoreMockRecorder) SaveUserInvite added in v0.65.0

func (mr *MockStoreMockRecorder) SaveUserInvite(ctx, invite interface{}) *gomock.Call

SaveUserInvite indicates an expected call of SaveUserInvite.

func (*MockStoreMockRecorder) SaveUserLastLogin added in v0.65.0

func (mr *MockStoreMockRecorder) SaveUserLastLogin(ctx, accountID, userID, lastLogin interface{}) *gomock.Call

SaveUserLastLogin indicates an expected call of SaveUserLastLogin.

func (*MockStoreMockRecorder) SaveUsers added in v0.65.0

func (mr *MockStoreMockRecorder) SaveUsers(ctx, users interface{}) *gomock.Call

SaveUsers indicates an expected call of SaveUsers.

func (*MockStoreMockRecorder) SetFieldEncrypt added in v0.65.0

func (mr *MockStoreMockRecorder) SetFieldEncrypt(enc interface{}) *gomock.Call

SetFieldEncrypt indicates an expected call of SetFieldEncrypt.

func (*MockStoreMockRecorder) UpdateAccountDomainAttributes added in v0.65.0

func (mr *MockStoreMockRecorder) UpdateAccountDomainAttributes(ctx, accountID, domain, category, isPrimaryDomain interface{}) *gomock.Call

UpdateAccountDomainAttributes indicates an expected call of UpdateAccountDomainAttributes.

func (*MockStoreMockRecorder) UpdateAccountNetwork added in v0.65.0

func (mr *MockStoreMockRecorder) UpdateAccountNetwork(ctx, accountID, ipNet interface{}) *gomock.Call

UpdateAccountNetwork indicates an expected call of UpdateAccountNetwork.

func (*MockStoreMockRecorder) UpdateCustomDomain added in v0.65.0

func (mr *MockStoreMockRecorder) UpdateCustomDomain(ctx, accountID, d interface{}) *gomock.Call

UpdateCustomDomain indicates an expected call of UpdateCustomDomain.

func (*MockStoreMockRecorder) UpdateDNSRecord added in v0.65.0

func (mr *MockStoreMockRecorder) UpdateDNSRecord(ctx, record interface{}) *gomock.Call

UpdateDNSRecord indicates an expected call of UpdateDNSRecord.

func (*MockStoreMockRecorder) UpdateGroup added in v0.65.0

func (mr *MockStoreMockRecorder) UpdateGroup(ctx, group interface{}) *gomock.Call

UpdateGroup indicates an expected call of UpdateGroup.

func (*MockStoreMockRecorder) UpdateGroups added in v0.65.0

func (mr *MockStoreMockRecorder) UpdateGroups(ctx, accountID, groups interface{}) *gomock.Call

UpdateGroups indicates an expected call of UpdateGroups.

func (*MockStoreMockRecorder) UpdateService added in v0.65.0

func (mr *MockStoreMockRecorder) UpdateService(ctx, service interface{}) *gomock.Call

UpdateService indicates an expected call of UpdateService.

func (*MockStoreMockRecorder) UpdateZone added in v0.65.0

func (mr *MockStoreMockRecorder) UpdateZone(ctx, zone interface{}) *gomock.Call

UpdateZone indicates an expected call of UpdateZone.

type SqlStore

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

SqlStore represents an account storage backed by a Sql DB persisted to disk

func NewMysqlStore added in v0.36.0

func NewMysqlStore(ctx context.Context, dsn string, metrics telemetry.AppMetrics, skipMigration bool) (*SqlStore, error)

NewMysqlStore creates a new MySQL store.

func NewMysqlStoreFromSqlStore added in v0.36.0

func NewMysqlStoreFromSqlStore(ctx context.Context, sqliteStore *SqlStore, dsn string, metrics telemetry.AppMetrics) (*SqlStore, error)

NewMysqlStoreFromSqlStore restores a store from SqlStore and stores MySQL DB.

func NewPostgresqlStore

func NewPostgresqlStore(ctx context.Context, dsn string, metrics telemetry.AppMetrics, skipMigration bool) (*SqlStore, error)

NewPostgresqlStore creates a new Postgres store.

func NewPostgresqlStoreForTests added in v0.59.13

func NewPostgresqlStoreForTests(ctx context.Context, dsn string, metrics telemetry.AppMetrics, skipMigration bool) (*SqlStore, error)

used for tests only

func NewPostgresqlStoreFromSqlStore

func NewPostgresqlStoreFromSqlStore(ctx context.Context, sqliteStore *SqlStore, dsn string, metrics telemetry.AppMetrics) (*SqlStore, error)

NewPostgresqlStoreFromSqlStore restores a store from SqlStore and stores Postgres DB.

func NewSqlStore

func NewSqlStore(ctx context.Context, db *gorm.DB, storeEngine types.Engine, metrics telemetry.AppMetrics, skipMigration bool) (*SqlStore, error)

NewSqlStore creates a new SqlStore instance.

func NewSqliteStore

func NewSqliteStore(ctx context.Context, dataDir string, metrics telemetry.AppMetrics, skipMigration bool) (*SqlStore, error)

NewSqliteStore creates a new SQLite store.

func NewSqliteStoreFromFileStore

func NewSqliteStoreFromFileStore(ctx context.Context, fileStore *FileStore, dataDir string, metrics telemetry.AppMetrics, skipMigration bool) (*SqlStore, error)

NewSqliteStoreFromFileStore restores a store from FileStore and stores SQLite DB in the file located in datadir.

func (*SqlStore) AccountExists

func (s *SqlStore) AccountExists(ctx context.Context, lockStrength LockingStrength, id string) (bool, error)

AccountExists checks whether an account exists by the given ID.

func (*SqlStore) AcquireGlobalLock

func (s *SqlStore) AcquireGlobalLock(ctx context.Context) (unlock func())

AcquireGlobalLock acquires global lock across all the accounts and returns a function that releases the lock

func (*SqlStore) AddPeerToAccount

func (s *SqlStore) AddPeerToAccount(ctx context.Context, peer *nbpeer.Peer) error

func (*SqlStore) AddPeerToAllGroup

func (s *SqlStore) AddPeerToAllGroup(ctx context.Context, accountID string, peerID string) error

AddPeerToAllGroup adds a peer to the 'All' group. Method always needs to run in a transaction

func (*SqlStore) AddPeerToGroup

func (s *SqlStore) AddPeerToGroup(ctx context.Context, accountID, peerID, groupID string) error

AddPeerToGroup adds a peer to a group

func (*SqlStore) AddResourceToGroup

func (s *SqlStore) AddResourceToGroup(ctx context.Context, accountId string, groupID string, resource *types.Resource) error

AddResourceToGroup adds a resource to a group. Method always needs to run n a transaction

func (*SqlStore) ApproveAccountPeers added in v0.60.8

func (s *SqlStore) ApproveAccountPeers(ctx context.Context, accountID string) (int, error)

ApproveAccountPeers marks all peers that currently require approval in the given account as approved.

func (*SqlStore) Close

func (s *SqlStore) Close(_ context.Context) error

Close closes the underlying DB connection

func (*SqlStore) CompletePeerJob added in v0.64.0

func (s *SqlStore) CompletePeerJob(ctx context.Context, job *types.Job) error

func (*SqlStore) CountAccountsByPrivateDomain added in v0.40.0

func (s *SqlStore) CountAccountsByPrivateDomain(ctx context.Context, domain string) (int64, error)

func (*SqlStore) CreateAccessLog added in v0.65.0

func (s *SqlStore) CreateAccessLog(ctx context.Context, logEntry *accesslogs.AccessLogEntry) error

CreateAccessLog creates a new access log entry in the database

func (*SqlStore) CreateCustomDomain added in v0.65.0

func (s *SqlStore) CreateCustomDomain(ctx context.Context, accountID string, domainName string, targetCluster string, validated bool) (*domain.Domain, error)

func (*SqlStore) CreateDNSRecord added in v0.63.0

func (s *SqlStore) CreateDNSRecord(ctx context.Context, record *records.Record) error

func (*SqlStore) CreateGroup added in v0.53.0

func (s *SqlStore) CreateGroup(ctx context.Context, group *types.Group) error

CreateGroup creates a group in the store.

func (*SqlStore) CreateGroups added in v0.53.0

func (s *SqlStore) CreateGroups(ctx context.Context, accountID string, groups []*types.Group) error

CreateGroups creates the given list of groups to the database.

func (*SqlStore) CreatePeerJob added in v0.64.0

func (s *SqlStore) CreatePeerJob(ctx context.Context, job *types.Job) error

SaveJob persists a job in DB

func (*SqlStore) CreatePolicy

func (s *SqlStore) CreatePolicy(ctx context.Context, policy *types.Policy) error

func (*SqlStore) CreateService added in v0.65.0

func (s *SqlStore) CreateService(ctx context.Context, service *reverseproxy.Service) error

func (*SqlStore) CreateZone added in v0.63.0

func (s *SqlStore) CreateZone(ctx context.Context, zone *zones.Zone) error

func (*SqlStore) DeleteAccount

func (s *SqlStore) DeleteAccount(ctx context.Context, account *types.Account) error

func (*SqlStore) DeleteCustomDomain added in v0.65.0

func (s *SqlStore) DeleteCustomDomain(ctx context.Context, accountID string, domainID string) error

func (*SqlStore) DeleteDNSRecord added in v0.63.0

func (s *SqlStore) DeleteDNSRecord(ctx context.Context, accountID, zoneID, recordID string) error

func (*SqlStore) DeleteGroup

func (s *SqlStore) DeleteGroup(ctx context.Context, accountID, groupID string) error

DeleteGroup deletes a group from the database.

func (*SqlStore) DeleteGroups

func (s *SqlStore) DeleteGroups(ctx context.Context, accountID string, groupIDs []string) error

DeleteGroups deletes groups from the database.

func (*SqlStore) DeleteHashedPAT2TokenIDIndex

func (s *SqlStore) DeleteHashedPAT2TokenIDIndex(hashedToken string) error

DeleteHashedPAT2TokenIDIndex is noop in SqlStore

func (*SqlStore) DeleteNameServerGroup

func (s *SqlStore) DeleteNameServerGroup(ctx context.Context, accountID, nsGroupID string) error

DeleteNameServerGroup deletes a name server group from the database.

func (*SqlStore) DeleteNetwork

func (s *SqlStore) DeleteNetwork(ctx context.Context, accountID, networkID string) error

func (*SqlStore) DeleteNetworkResource

func (s *SqlStore) DeleteNetworkResource(ctx context.Context, accountID, resourceID string) error

func (*SqlStore) DeleteNetworkRouter

func (s *SqlStore) DeleteNetworkRouter(ctx context.Context, accountID, routerID string) error

func (*SqlStore) DeleteOldAccessLogs added in v0.66.0

func (s *SqlStore) DeleteOldAccessLogs(ctx context.Context, olderThan time.Time) (int64, error)

DeleteOldAccessLogs deletes all access logs older than the specified time

func (*SqlStore) DeletePAT added in v0.37.0

func (s *SqlStore) DeletePAT(ctx context.Context, userID, patID string) error

DeletePAT deletes a personal access token from the database.

func (*SqlStore) DeletePeer added in v0.36.4

func (s *SqlStore) DeletePeer(ctx context.Context, accountID string, peerID string) error

DeletePeer removes a peer from the store.

func (*SqlStore) DeletePolicy

func (s *SqlStore) DeletePolicy(ctx context.Context, accountID, policyID string) error

func (*SqlStore) DeletePostureChecks

func (s *SqlStore) DeletePostureChecks(ctx context.Context, accountID, postureChecksID string) error

DeletePostureChecks deletes a posture checks from the database.

func (*SqlStore) DeleteRoute added in v0.48.0

func (s *SqlStore) DeleteRoute(ctx context.Context, accountID, routeID string) error

DeleteRoute deletes a route from the database.

func (*SqlStore) DeleteService added in v0.65.0

func (s *SqlStore) DeleteService(ctx context.Context, accountID, serviceID string) error

func (*SqlStore) DeleteSetupKey

func (s *SqlStore) DeleteSetupKey(ctx context.Context, accountID, keyID string) error

DeleteSetupKey deletes a setup key from the database.

func (*SqlStore) DeleteTokenID2UserIDIndex

func (s *SqlStore) DeleteTokenID2UserIDIndex(tokenID string) error

DeleteTokenID2UserIDIndex is noop in SqlStore

func (*SqlStore) DeleteUser added in v0.37.0

func (s *SqlStore) DeleteUser(ctx context.Context, accountID, userID string) error

func (*SqlStore) DeleteUserInvite added in v0.64.2

func (s *SqlStore) DeleteUserInvite(ctx context.Context, inviteID string) error

DeleteUserInvite deletes a user invite by its ID

func (*SqlStore) DeleteZone added in v0.63.0

func (s *SqlStore) DeleteZone(ctx context.Context, accountID, zoneID string) error

func (*SqlStore) DeleteZoneDNSRecords added in v0.63.0

func (s *SqlStore) DeleteZoneDNSRecords(ctx context.Context, accountID, zoneID string) error

func (*SqlStore) ExecuteInTransaction

func (s *SqlStore) ExecuteInTransaction(ctx context.Context, operation func(store Store) error) error

func (*SqlStore) GetAccount

func (s *SqlStore) GetAccount(ctx context.Context, accountID string) (*types.Account, error)

func (*SqlStore) GetAccountAccessLogs added in v0.65.0

func (s *SqlStore) GetAccountAccessLogs(ctx context.Context, lockStrength LockingStrength, accountID string, filter accesslogs.AccessLogFilter) ([]*accesslogs.AccessLogEntry, int64, error)

GetAccountAccessLogs retrieves access logs for a given account with pagination and filtering

func (*SqlStore) GetAccountByPeerID

func (s *SqlStore) GetAccountByPeerID(ctx context.Context, peerID string) (*types.Account, error)

func (*SqlStore) GetAccountByPeerPubKey

func (s *SqlStore) GetAccountByPeerPubKey(ctx context.Context, peerKey string) (*types.Account, error)

func (*SqlStore) GetAccountByPrivateDomain

func (s *SqlStore) GetAccountByPrivateDomain(ctx context.Context, domain string) (*types.Account, error)

func (*SqlStore) GetAccountBySetupKey

func (s *SqlStore) GetAccountBySetupKey(ctx context.Context, setupKey string) (*types.Account, error)

func (*SqlStore) GetAccountByUser

func (s *SqlStore) GetAccountByUser(ctx context.Context, userID string) (*types.Account, error)

func (*SqlStore) GetAccountCreatedBy added in v0.37.0

func (s *SqlStore) GetAccountCreatedBy(ctx context.Context, lockStrength LockingStrength, accountID string) (string, error)

func (*SqlStore) GetAccountDNSSettings

func (s *SqlStore) GetAccountDNSSettings(ctx context.Context, lockStrength LockingStrength, accountID string) (*types.DNSSettings, error)

func (*SqlStore) GetAccountDomainAndCategory

func (s *SqlStore) GetAccountDomainAndCategory(ctx context.Context, lockStrength LockingStrength, accountID string) (string, string, error)

GetAccountDomainAndCategory retrieves the Domain and DomainCategory fields for an account based on the given accountID.

func (*SqlStore) GetAccountGroupPeers added in v0.53.0

func (s *SqlStore) GetAccountGroupPeers(ctx context.Context, lockStrength LockingStrength, accountID string) (map[string]map[string]struct{}, error)

func (*SqlStore) GetAccountGroups

func (s *SqlStore) GetAccountGroups(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.Group, error)

func (*SqlStore) GetAccountIDByPeerID added in v0.36.4

func (s *SqlStore) GetAccountIDByPeerID(ctx context.Context, lockStrength LockingStrength, peerID string) (string, error)

func (*SqlStore) GetAccountIDByPeerPubKey

func (s *SqlStore) GetAccountIDByPeerPubKey(ctx context.Context, peerKey string) (string, error)

func (*SqlStore) GetAccountIDByPrivateDomain

func (s *SqlStore) GetAccountIDByPrivateDomain(ctx context.Context, lockStrength LockingStrength, domain string) (string, error)

func (*SqlStore) GetAccountIDBySetupKey

func (s *SqlStore) GetAccountIDBySetupKey(ctx context.Context, setupKey string) (string, error)

func (*SqlStore) GetAccountIDByUserID

func (s *SqlStore) GetAccountIDByUserID(ctx context.Context, lockStrength LockingStrength, userID string) (string, error)

func (*SqlStore) GetAccountMeta added in v0.42.0

func (s *SqlStore) GetAccountMeta(ctx context.Context, lockStrength LockingStrength, accountID string) (*types.AccountMeta, error)

func (*SqlStore) GetAccountNameServerGroups

func (s *SqlStore) GetAccountNameServerGroups(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*nbdns.NameServerGroup, error)

GetAccountNameServerGroups retrieves name server groups for an account.

func (*SqlStore) GetAccountNetwork

func (s *SqlStore) GetAccountNetwork(ctx context.Context, lockStrength LockingStrength, accountID string) (*types.Network, error)

func (*SqlStore) GetAccountNetworks

func (s *SqlStore) GetAccountNetworks(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*networkTypes.Network, error)

func (*SqlStore) GetAccountOnboarding added in v0.50.0

func (s *SqlStore) GetAccountOnboarding(ctx context.Context, accountID string) (*types.AccountOnboarding, error)

GetAccountOnboarding retrieves the onboarding information for a specific account.

func (*SqlStore) GetAccountOwner added in v0.40.0

func (s *SqlStore) GetAccountOwner(ctx context.Context, lockStrength LockingStrength, accountID string) (*types.User, error)

func (*SqlStore) GetAccountPeers added in v0.36.4

func (s *SqlStore) GetAccountPeers(ctx context.Context, lockStrength LockingStrength, accountID, nameFilter, ipFilter string) ([]*nbpeer.Peer, error)

GetAccountPeers retrieves peers for an account.

func (*SqlStore) GetAccountPeersWithExpiration added in v0.36.4

func (s *SqlStore) GetAccountPeersWithExpiration(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*nbpeer.Peer, error)

GetAccountPeersWithExpiration retrieves a list of peers that have login expiration enabled and added by a user.

func (*SqlStore) GetAccountPeersWithInactivity added in v0.36.4

func (s *SqlStore) GetAccountPeersWithInactivity(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*nbpeer.Peer, error)

GetAccountPeersWithInactivity retrieves a list of peers that have login expiration enabled and added by a user.

func (*SqlStore) GetAccountPolicies

func (s *SqlStore) GetAccountPolicies(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.Policy, error)

GetAccountPolicies retrieves policies for an account.

func (*SqlStore) GetAccountPostureChecks

func (s *SqlStore) GetAccountPostureChecks(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*posture.Checks, error)

GetAccountPostureChecks retrieves posture checks for an account.

func (*SqlStore) GetAccountRoutes

func (s *SqlStore) GetAccountRoutes(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*route.Route, error)

GetAccountRoutes retrieves network routes for an account.

func (*SqlStore) GetAccountServices added in v0.65.0

func (s *SqlStore) GetAccountServices(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*reverseproxy.Service, error)

func (*SqlStore) GetAccountSettings

func (s *SqlStore) GetAccountSettings(ctx context.Context, lockStrength LockingStrength, accountID string) (*types.Settings, error)

func (*SqlStore) GetAccountSetupKeys

func (s *SqlStore) GetAccountSetupKeys(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.SetupKey, error)

GetAccountSetupKeys retrieves setup keys for an account.

func (*SqlStore) GetAccountUserInvites added in v0.64.2

func (s *SqlStore) GetAccountUserInvites(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.UserInviteRecord, error)

GetAccountUserInvites retrieves all user invites for an account

func (*SqlStore) GetAccountUsers

func (s *SqlStore) GetAccountUsers(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.User, error)

func (*SqlStore) GetAccountZones added in v0.63.0

func (s *SqlStore) GetAccountZones(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*zones.Zone, error)

func (*SqlStore) GetAccountsCounter added in v0.37.1

func (s *SqlStore) GetAccountsCounter(ctx context.Context) (int64, error)

func (*SqlStore) GetAllAccounts

func (s *SqlStore) GetAllAccounts(ctx context.Context) (all []*types.Account)

func (*SqlStore) GetAllEphemeralPeers added in v0.36.4

func (s *SqlStore) GetAllEphemeralPeers(ctx context.Context, lockStrength LockingStrength) ([]*nbpeer.Peer, error)

GetAllEphemeralPeers retrieves all peers with Ephemeral set to true across all accounts, optimized for batch processing.

func (*SqlStore) GetAllProxyAccessTokens added in v0.65.0

func (s *SqlStore) GetAllProxyAccessTokens(ctx context.Context, lockStrength LockingStrength) ([]*types.ProxyAccessToken, error)

GetAllProxyAccessTokens retrieves all proxy access tokens.

func (*SqlStore) GetAnyAccountID added in v0.43.1

func (s *SqlStore) GetAnyAccountID(ctx context.Context) (string, error)

func (*SqlStore) GetCustomDomain added in v0.65.0

func (s *SqlStore) GetCustomDomain(ctx context.Context, accountID string, domainID string) (*domain.Domain, error)

func (*SqlStore) GetCustomDomainsCounts added in v0.66.0

func (s *SqlStore) GetCustomDomainsCounts(ctx context.Context) (int64, int64, error)

GetCustomDomainsCounts returns the total and validated custom domain counts.

func (*SqlStore) GetDB

func (s *SqlStore) GetDB() *gorm.DB

func (*SqlStore) GetDNSRecordByID added in v0.63.0

func (s *SqlStore) GetDNSRecordByID(ctx context.Context, lockStrength LockingStrength, accountID, zoneID, recordID string) (*records.Record, error)

func (*SqlStore) GetGroupByID

func (s *SqlStore) GetGroupByID(ctx context.Context, lockStrength LockingStrength, accountID, groupID string) (*types.Group, error)

GetGroupByID retrieves a group by ID and account ID.

func (*SqlStore) GetGroupByName

func (s *SqlStore) GetGroupByName(ctx context.Context, lockStrength LockingStrength, accountID, groupName string) (*types.Group, error)

GetGroupByName retrieves a group by name and account ID.

func (*SqlStore) GetGroupsByIDs

func (s *SqlStore) GetGroupsByIDs(ctx context.Context, lockStrength LockingStrength, accountID string, groupIDs []string) (map[string]*types.Group, error)

GetGroupsByIDs retrieves groups by their IDs and account ID.

func (*SqlStore) GetInstallationID

func (s *SqlStore) GetInstallationID() string

func (*SqlStore) GetNameServerGroupByID

func (s *SqlStore) GetNameServerGroupByID(ctx context.Context, lockStrength LockingStrength, accountID, nsGroupID string) (*nbdns.NameServerGroup, error)

GetNameServerGroupByID retrieves a name server group by its ID and account ID.

func (*SqlStore) GetNetworkByID

func (s *SqlStore) GetNetworkByID(ctx context.Context, lockStrength LockingStrength, accountID, networkID string) (*networkTypes.Network, error)

func (*SqlStore) GetNetworkResourceByID

func (s *SqlStore) GetNetworkResourceByID(ctx context.Context, lockStrength LockingStrength, accountID, resourceID string) (*resourceTypes.NetworkResource, error)

func (*SqlStore) GetNetworkResourceByName

func (s *SqlStore) GetNetworkResourceByName(ctx context.Context, lockStrength LockingStrength, accountID, resourceName string) (*resourceTypes.NetworkResource, error)

func (*SqlStore) GetNetworkResourcesByAccountID

func (s *SqlStore) GetNetworkResourcesByAccountID(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*resourceTypes.NetworkResource, error)

func (*SqlStore) GetNetworkResourcesByNetID

func (s *SqlStore) GetNetworkResourcesByNetID(ctx context.Context, lockStrength LockingStrength, accountID, networkID string) ([]*resourceTypes.NetworkResource, error)

func (*SqlStore) GetNetworkRouterByID

func (s *SqlStore) GetNetworkRouterByID(ctx context.Context, lockStrength LockingStrength, accountID, routerID string) (*routerTypes.NetworkRouter, error)

func (*SqlStore) GetNetworkRoutersByAccountID

func (s *SqlStore) GetNetworkRoutersByAccountID(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*routerTypes.NetworkRouter, error)

func (*SqlStore) GetNetworkRoutersByNetID

func (s *SqlStore) GetNetworkRoutersByNetID(ctx context.Context, lockStrength LockingStrength, accountID, netID string) ([]*routerTypes.NetworkRouter, error)

func (*SqlStore) GetPATByHashedToken added in v0.37.0

func (s *SqlStore) GetPATByHashedToken(ctx context.Context, lockStrength LockingStrength, hashedToken string) (*types.PersonalAccessToken, error)

GetPATByHashedToken returns a PersonalAccessToken by its hashed token.

func (*SqlStore) GetPATByID added in v0.37.0

func (s *SqlStore) GetPATByID(ctx context.Context, lockStrength LockingStrength, userID string, patID string) (*types.PersonalAccessToken, error)

GetPATByID retrieves a personal access token by its ID and user ID.

func (*SqlStore) GetPeerByID

func (s *SqlStore) GetPeerByID(ctx context.Context, lockStrength LockingStrength, accountID, peerID string) (*nbpeer.Peer, error)

GetPeerByID retrieves a peer by its ID and account ID.

func (*SqlStore) GetPeerByIP added in v0.39.0

func (s *SqlStore) GetPeerByIP(ctx context.Context, lockStrength LockingStrength, accountID string, ip net.IP) (*nbpeer.Peer, error)

func (*SqlStore) GetPeerByPeerPubKey

func (s *SqlStore) GetPeerByPeerPubKey(ctx context.Context, lockStrength LockingStrength, peerKey string) (*nbpeer.Peer, error)

func (*SqlStore) GetPeerGroupIDs added in v0.53.0

func (s *SqlStore) GetPeerGroupIDs(ctx context.Context, lockStrength LockingStrength, accountId string, peerId string) ([]string, error)

GetPeerGroupIDs retrieves all group IDs assigned to a specific peer in a given account.

func (*SqlStore) GetPeerGroups added in v0.36.4

func (s *SqlStore) GetPeerGroups(ctx context.Context, lockStrength LockingStrength, accountId string, peerId string) ([]*types.Group, error)

GetPeerGroups retrieves all groups assigned to a specific peer in a given account.

func (*SqlStore) GetPeerIDByKey added in v0.64.0

func (s *SqlStore) GetPeerIDByKey(ctx context.Context, lockStrength LockingStrength, key string) (string, error)

func (*SqlStore) GetPeerIdByLabel added in v0.50.0

func (s *SqlStore) GetPeerIdByLabel(ctx context.Context, lockStrength LockingStrength, accountID string, hostname string) (string, error)

func (*SqlStore) GetPeerJobByID added in v0.64.0

func (s *SqlStore) GetPeerJobByID(ctx context.Context, accountID, jobID string) (*types.Job, error)

GetJobByID fetches job by ID

func (*SqlStore) GetPeerJobs added in v0.64.0

func (s *SqlStore) GetPeerJobs(ctx context.Context, accountID, peerID string) ([]*types.Job, error)

get all jobs

func (*SqlStore) GetPeerLabelsInAccount

func (s *SqlStore) GetPeerLabelsInAccount(ctx context.Context, lockStrength LockingStrength, accountID string, dnsLabel string) ([]string, error)

func (*SqlStore) GetPeersByGroupIDs added in v0.56.1

func (s *SqlStore) GetPeersByGroupIDs(ctx context.Context, accountID string, groupIDs []string) ([]*nbpeer.Peer, error)

func (*SqlStore) GetPeersByIDs

func (s *SqlStore) GetPeersByIDs(ctx context.Context, lockStrength LockingStrength, accountID string, peerIDs []string) (map[string]*nbpeer.Peer, error)

GetPeersByIDs retrieves peers by their IDs and account ID.

func (*SqlStore) GetPolicyByID

func (s *SqlStore) GetPolicyByID(ctx context.Context, lockStrength LockingStrength, accountID, policyID string) (*types.Policy, error)

GetPolicyByID retrieves a policy by its ID and account ID.

func (*SqlStore) GetPolicyRulesByResourceID added in v0.59.0

func (s *SqlStore) GetPolicyRulesByResourceID(ctx context.Context, lockStrength LockingStrength, accountID string, resourceID string) ([]*types.PolicyRule, error)

func (*SqlStore) GetPostureCheckByChecksDefinition

func (s *SqlStore) GetPostureCheckByChecksDefinition(accountID string, checks *posture.ChecksDefinition) (*posture.Checks, error)

func (*SqlStore) GetPostureChecksByID

func (s *SqlStore) GetPostureChecksByID(ctx context.Context, lockStrength LockingStrength, accountID, postureChecksID string) (*posture.Checks, error)

GetPostureChecksByID retrieves posture checks by their ID and account ID.

func (*SqlStore) GetPostureChecksByIDs

func (s *SqlStore) GetPostureChecksByIDs(ctx context.Context, lockStrength LockingStrength, accountID string, postureChecksIDs []string) (map[string]*posture.Checks, error)

GetPostureChecksByIDs retrieves posture checks by their IDs and account ID.

func (*SqlStore) GetProxyAccessTokenByHashedToken added in v0.65.0

func (s *SqlStore) GetProxyAccessTokenByHashedToken(ctx context.Context, lockStrength LockingStrength, hashedToken types.HashedProxyToken) (*types.ProxyAccessToken, error)

GetProxyAccessTokenByHashedToken retrieves a proxy access token by its hashed value.

func (*SqlStore) GetResourceGroups

func (s *SqlStore) GetResourceGroups(ctx context.Context, lockStrength LockingStrength, accountID, resourceID string) ([]*types.Group, error)

func (*SqlStore) GetRouteByID

func (s *SqlStore) GetRouteByID(ctx context.Context, lockStrength LockingStrength, accountID string, routeID string) (*route.Route, error)

GetRouteByID retrieves a route by its ID and account ID.

func (*SqlStore) GetServiceByDomain added in v0.65.0

func (s *SqlStore) GetServiceByDomain(ctx context.Context, accountID, domain string) (*reverseproxy.Service, error)

func (*SqlStore) GetServiceByID added in v0.65.0

func (s *SqlStore) GetServiceByID(ctx context.Context, lockStrength LockingStrength, accountID, serviceID string) (*reverseproxy.Service, error)

func (*SqlStore) GetServiceTargetByTargetID added in v0.65.0

func (s *SqlStore) GetServiceTargetByTargetID(ctx context.Context, lockStrength LockingStrength, accountID string, targetID string) (*reverseproxy.Target, error)

func (*SqlStore) GetServices added in v0.65.0

func (s *SqlStore) GetServices(ctx context.Context, lockStrength LockingStrength) ([]*reverseproxy.Service, error)

func (*SqlStore) GetServicesByAccountID added in v0.66.0

func (s *SqlStore) GetServicesByAccountID(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*reverseproxy.Service, error)

func (*SqlStore) GetSetupKeyByID

func (s *SqlStore) GetSetupKeyByID(ctx context.Context, lockStrength LockingStrength, accountID, setupKeyID string) (*types.SetupKey, error)

GetSetupKeyByID retrieves a setup key by its ID and account ID.

func (*SqlStore) GetSetupKeyBySecret

func (s *SqlStore) GetSetupKeyBySecret(ctx context.Context, lockStrength LockingStrength, key string) (*types.SetupKey, error)

func (*SqlStore) GetStoreEngine

func (s *SqlStore) GetStoreEngine() types.Engine

GetStoreEngine returns underlying store engine

func (*SqlStore) GetTakenIPs

func (s *SqlStore) GetTakenIPs(ctx context.Context, lockStrength LockingStrength, accountID string) ([]net.IP, error)

func (*SqlStore) GetTokenIDByHashedToken

func (s *SqlStore) GetTokenIDByHashedToken(ctx context.Context, hashedToken string) (string, error)

func (*SqlStore) GetUserByPATID added in v0.37.0

func (s *SqlStore) GetUserByPATID(ctx context.Context, lockStrength LockingStrength, patID string) (*types.User, error)

func (*SqlStore) GetUserByUserID

func (s *SqlStore) GetUserByUserID(ctx context.Context, lockStrength LockingStrength, userID string) (*types.User, error)

func (*SqlStore) GetUserIDByPeerKey added in v0.61.1

func (s *SqlStore) GetUserIDByPeerKey(ctx context.Context, lockStrength LockingStrength, peerKey string) (string, error)

func (*SqlStore) GetUserInviteByEmail added in v0.64.2

func (s *SqlStore) GetUserInviteByEmail(ctx context.Context, lockStrength LockingStrength, accountID, email string) (*types.UserInviteRecord, error)

GetUserInviteByEmail retrieves a user invite by account ID and email. Since email is encrypted with random IVs, we fetch all invites for the account and compare emails in memory after decryption.

func (*SqlStore) GetUserInviteByHashedToken added in v0.64.2

func (s *SqlStore) GetUserInviteByHashedToken(ctx context.Context, lockStrength LockingStrength, hashedToken string) (*types.UserInviteRecord, error)

GetUserInviteByHashedToken retrieves a user invite by its hashed token

func (*SqlStore) GetUserInviteByID added in v0.64.2

func (s *SqlStore) GetUserInviteByID(ctx context.Context, lockStrength LockingStrength, accountID, inviteID string) (*types.UserInviteRecord, error)

GetUserInviteByID retrieves a user invite by its ID and account ID

func (*SqlStore) GetUserPATs added in v0.37.0

func (s *SqlStore) GetUserPATs(ctx context.Context, lockStrength LockingStrength, userID string) ([]*types.PersonalAccessToken, error)

GetUserPATs retrieves personal access tokens for a user.

func (*SqlStore) GetUserPeers

func (s *SqlStore) GetUserPeers(ctx context.Context, lockStrength LockingStrength, accountID, userID string) ([]*nbpeer.Peer, error)

GetUserPeers retrieves peers for a user.

func (*SqlStore) GetZoneByDomain added in v0.63.0

func (s *SqlStore) GetZoneByDomain(ctx context.Context, accountID, domain string) (*zones.Zone, error)

func (*SqlStore) GetZoneByID added in v0.63.0

func (s *SqlStore) GetZoneByID(ctx context.Context, lockStrength LockingStrength, accountID, zoneID string) (*zones.Zone, error)

func (*SqlStore) GetZoneDNSRecords added in v0.63.0

func (s *SqlStore) GetZoneDNSRecords(ctx context.Context, lockStrength LockingStrength, accountID, zoneID string) ([]*records.Record, error)

func (*SqlStore) GetZoneDNSRecordsByName added in v0.63.0

func (s *SqlStore) GetZoneDNSRecordsByName(ctx context.Context, lockStrength LockingStrength, accountID, zoneID, name string) ([]*records.Record, error)

func (*SqlStore) IncrementNetworkSerial

func (s *SqlStore) IncrementNetworkSerial(ctx context.Context, accountId string) error

func (*SqlStore) IncrementSetupKeyUsage

func (s *SqlStore) IncrementSetupKeyUsage(ctx context.Context, setupKeyID string) error

func (*SqlStore) IsPrimaryAccount added in v0.55.0

func (s *SqlStore) IsPrimaryAccount(ctx context.Context, accountID string) (bool, string, error)

func (*SqlStore) ListCustomDomains added in v0.65.0

func (s *SqlStore) ListCustomDomains(ctx context.Context, accountID string) ([]*domain.Domain, error)

func (*SqlStore) ListFreeDomains added in v0.65.0

func (s *SqlStore) ListFreeDomains(ctx context.Context, accountID string) ([]string, error)

func (*SqlStore) MarkAccountPrimary added in v0.55.0

func (s *SqlStore) MarkAccountPrimary(ctx context.Context, accountID string) error

func (*SqlStore) MarkAllPendingJobsAsFailed added in v0.64.0

func (s *SqlStore) MarkAllPendingJobsAsFailed(ctx context.Context, accountID, peerID, reason string) error

job was pending for too long and has been cancelled

func (*SqlStore) MarkPATUsed added in v0.37.0

func (s *SqlStore) MarkPATUsed(ctx context.Context, patID string) error

MarkPATUsed marks a personal access token as used.

func (*SqlStore) MarkPendingJobsAsFailed added in v0.64.0

func (s *SqlStore) MarkPendingJobsAsFailed(ctx context.Context, accountID, peerID, jobID, reason string) error

job was pending for too long and has been cancelled

func (*SqlStore) MarkProxyAccessTokenUsed added in v0.65.0

func (s *SqlStore) MarkProxyAccessTokenUsed(ctx context.Context, tokenID string) error

MarkProxyAccessTokenUsed updates the last used timestamp for a proxy access token.

func (*SqlStore) RemovePeerFromAllGroups added in v0.53.0

func (s *SqlStore) RemovePeerFromAllGroups(ctx context.Context, peerID string) error

RemovePeerFromAllGroups removes a peer from all groups

func (*SqlStore) RemovePeerFromGroup added in v0.53.0

func (s *SqlStore) RemovePeerFromGroup(ctx context.Context, peerID string, groupID string) error

RemovePeerFromGroup removes a peer from a group

func (*SqlStore) RemoveResourceFromGroup

func (s *SqlStore) RemoveResourceFromGroup(ctx context.Context, accountId string, groupID string, resourceID string) error

RemoveResourceFromGroup removes a resource from a group. Method always needs to run in a transaction

func (*SqlStore) RevokeProxyAccessToken added in v0.65.0

func (s *SqlStore) RevokeProxyAccessToken(ctx context.Context, tokenID string) error

RevokeProxyAccessToken revokes a proxy access token by its ID.

func (*SqlStore) SaveAccount deprecated

func (s *SqlStore) SaveAccount(ctx context.Context, account *types.Account) error

Deprecated: Full account operations are no longer supported

func (*SqlStore) SaveAccountOnboarding added in v0.50.0

func (s *SqlStore) SaveAccountOnboarding(ctx context.Context, onboarding *types.AccountOnboarding) error

SaveAccountOnboarding updates the onboarding information for a specific account.

func (*SqlStore) SaveAccountSettings added in v0.47.0

func (s *SqlStore) SaveAccountSettings(ctx context.Context, accountID string, settings *types.Settings) error

SaveAccountSettings stores the account settings in DB.

func (*SqlStore) SaveDNSSettings

func (s *SqlStore) SaveDNSSettings(ctx context.Context, accountID string, settings *types.DNSSettings) error

SaveDNSSettings saves the DNS settings to the store.

func (*SqlStore) SaveInstallationID

func (s *SqlStore) SaveInstallationID(_ context.Context, ID string) error

func (*SqlStore) SaveNameServerGroup

func (s *SqlStore) SaveNameServerGroup(ctx context.Context, nameServerGroup *nbdns.NameServerGroup) error

SaveNameServerGroup saves a name server group to the database.

func (*SqlStore) SaveNetwork

func (s *SqlStore) SaveNetwork(ctx context.Context, network *networkTypes.Network) error

func (*SqlStore) SaveNetworkResource

func (s *SqlStore) SaveNetworkResource(ctx context.Context, resource *resourceTypes.NetworkResource) error

func (*SqlStore) SaveNetworkRouter

func (s *SqlStore) SaveNetworkRouter(ctx context.Context, router *routerTypes.NetworkRouter) error

func (*SqlStore) SavePAT added in v0.37.0

func (s *SqlStore) SavePAT(ctx context.Context, pat *types.PersonalAccessToken) error

SavePAT saves a personal access token to the database.

func (*SqlStore) SavePeer

func (s *SqlStore) SavePeer(ctx context.Context, accountID string, peer *nbpeer.Peer) error

func (*SqlStore) SavePeerLocation

func (s *SqlStore) SavePeerLocation(ctx context.Context, accountID string, peerWithLocation *nbpeer.Peer) error

func (*SqlStore) SavePeerStatus

func (s *SqlStore) SavePeerStatus(ctx context.Context, accountID, peerID string, peerStatus nbpeer.PeerStatus) error

func (*SqlStore) SavePolicy

func (s *SqlStore) SavePolicy(ctx context.Context, policy *types.Policy) error

SavePolicy saves a policy to the database.

func (*SqlStore) SavePostureChecks

func (s *SqlStore) SavePostureChecks(ctx context.Context, postureCheck *posture.Checks) error

SavePostureChecks saves a posture checks to the database.

func (*SqlStore) SaveProxyAccessToken added in v0.65.0

func (s *SqlStore) SaveProxyAccessToken(ctx context.Context, token *types.ProxyAccessToken) error

SaveProxyAccessToken saves a proxy access token to the database.

func (*SqlStore) SaveRoute added in v0.48.0

func (s *SqlStore) SaveRoute(ctx context.Context, route *route.Route) error

SaveRoute saves a route to the database.

func (*SqlStore) SaveSetupKey

func (s *SqlStore) SaveSetupKey(ctx context.Context, setupKey *types.SetupKey) error

SaveSetupKey saves a setup key to the database.

func (*SqlStore) SaveUser

func (s *SqlStore) SaveUser(ctx context.Context, user *types.User) error

SaveUser saves the given user to the database.

func (*SqlStore) SaveUserInvite added in v0.64.2

func (s *SqlStore) SaveUserInvite(ctx context.Context, invite *types.UserInviteRecord) error

SaveUserInvite saves a user invite to the database

func (*SqlStore) SaveUserLastLogin

func (s *SqlStore) SaveUserLastLogin(ctx context.Context, accountID, userID string, lastLogin time.Time) error

SaveUserLastLogin stores the last login time for a user in DB.

func (*SqlStore) SaveUsers

func (s *SqlStore) SaveUsers(ctx context.Context, users []*types.User) error

SaveUsers saves the given list of users to the database.

func (*SqlStore) SetFieldEncrypt added in v0.62.0

func (s *SqlStore) SetFieldEncrypt(enc *crypt.FieldEncrypt)

SetFieldEncrypt sets the field encryptor for encrypting sensitive user data.

func (*SqlStore) UpdateAccountDomainAttributes

func (s *SqlStore) UpdateAccountDomainAttributes(ctx context.Context, accountID string, domain string, category string, isPrimaryDomain bool) error

func (*SqlStore) UpdateAccountNetwork added in v0.55.0

func (s *SqlStore) UpdateAccountNetwork(ctx context.Context, accountID string, ipNet net.IPNet) error

func (*SqlStore) UpdateCustomDomain added in v0.65.0

func (s *SqlStore) UpdateCustomDomain(ctx context.Context, accountID string, d *domain.Domain) (*domain.Domain, error)

func (*SqlStore) UpdateDNSRecord added in v0.63.0

func (s *SqlStore) UpdateDNSRecord(ctx context.Context, record *records.Record) error

func (*SqlStore) UpdateGroup added in v0.53.0

func (s *SqlStore) UpdateGroup(ctx context.Context, group *types.Group) error

UpdateGroup updates a group in the store.

func (*SqlStore) UpdateGroups added in v0.53.0

func (s *SqlStore) UpdateGroups(ctx context.Context, accountID string, groups []*types.Group) error

UpdateGroups updates the given list of groups to the database.

func (*SqlStore) UpdateService added in v0.65.0

func (s *SqlStore) UpdateService(ctx context.Context, service *reverseproxy.Service) error

func (*SqlStore) UpdateZone added in v0.63.0

func (s *SqlStore) UpdateZone(ctx context.Context, zone *zones.Zone) error

type Store

type Store interface {
	GetAccountsCounter(ctx context.Context) (int64, error)
	GetAllAccounts(ctx context.Context) []*types.Account
	GetAccount(ctx context.Context, accountID string) (*types.Account, error)
	GetAccountMeta(ctx context.Context, lockStrength LockingStrength, accountID string) (*types.AccountMeta, error)
	GetAccountOnboarding(ctx context.Context, accountID string) (*types.AccountOnboarding, error)
	AccountExists(ctx context.Context, lockStrength LockingStrength, id string) (bool, error)
	GetAccountDomainAndCategory(ctx context.Context, lockStrength LockingStrength, accountID string) (string, string, error)
	GetAccountByUser(ctx context.Context, userID string) (*types.Account, error)
	GetAccountByPeerPubKey(ctx context.Context, peerKey string) (*types.Account, error)
	GetAnyAccountID(ctx context.Context) (string, error)
	GetAccountIDByPeerPubKey(ctx context.Context, peerKey string) (string, error)
	GetAccountIDByUserID(ctx context.Context, lockStrength LockingStrength, userID string) (string, error)
	GetAccountIDBySetupKey(ctx context.Context, peerKey string) (string, error)
	GetAccountIDByPeerID(ctx context.Context, lockStrength LockingStrength, peerID string) (string, error)
	GetAccountByPeerID(ctx context.Context, peerID string) (*types.Account, error)
	GetAccountBySetupKey(ctx context.Context, setupKey string) (*types.Account, error) // todo use key hash later
	GetAccountByPrivateDomain(ctx context.Context, domain string) (*types.Account, error)
	GetAccountIDByPrivateDomain(ctx context.Context, lockStrength LockingStrength, domain string) (string, error)
	GetAccountSettings(ctx context.Context, lockStrength LockingStrength, accountID string) (*types.Settings, error)
	GetAccountDNSSettings(ctx context.Context, lockStrength LockingStrength, accountID string) (*types.DNSSettings, error)
	GetAccountCreatedBy(ctx context.Context, lockStrength LockingStrength, accountID string) (string, error)
	SaveAccount(ctx context.Context, account *types.Account) error
	DeleteAccount(ctx context.Context, account *types.Account) error
	UpdateAccountDomainAttributes(ctx context.Context, accountID string, domain string, category string, isPrimaryDomain bool) error
	SaveDNSSettings(ctx context.Context, accountID string, settings *types.DNSSettings) error
	SaveAccountSettings(ctx context.Context, accountID string, settings *types.Settings) error
	CountAccountsByPrivateDomain(ctx context.Context, domain string) (int64, error)
	SaveAccountOnboarding(ctx context.Context, onboarding *types.AccountOnboarding) error

	GetUserByPATID(ctx context.Context, lockStrength LockingStrength, patID string) (*types.User, error)
	GetUserByUserID(ctx context.Context, lockStrength LockingStrength, userID string) (*types.User, error)
	GetAccountUsers(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.User, error)
	GetAccountOwner(ctx context.Context, lockStrength LockingStrength, accountID string) (*types.User, error)
	SaveUsers(ctx context.Context, users []*types.User) error
	SaveUser(ctx context.Context, user *types.User) error
	SaveUserLastLogin(ctx context.Context, accountID, userID string, lastLogin time.Time) error
	DeleteUser(ctx context.Context, accountID, userID string) error
	GetTokenIDByHashedToken(ctx context.Context, secret string) (string, error)
	DeleteHashedPAT2TokenIDIndex(hashedToken string) error
	DeleteTokenID2UserIDIndex(tokenID string) error

	SaveUserInvite(ctx context.Context, invite *types.UserInviteRecord) error
	GetUserInviteByID(ctx context.Context, lockStrength LockingStrength, accountID, inviteID string) (*types.UserInviteRecord, error)
	GetUserInviteByHashedToken(ctx context.Context, lockStrength LockingStrength, hashedToken string) (*types.UserInviteRecord, error)
	GetUserInviteByEmail(ctx context.Context, lockStrength LockingStrength, accountID, email string) (*types.UserInviteRecord, error)
	GetAccountUserInvites(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.UserInviteRecord, error)
	DeleteUserInvite(ctx context.Context, inviteID string) error

	GetPATByID(ctx context.Context, lockStrength LockingStrength, userID, patID string) (*types.PersonalAccessToken, error)
	GetUserPATs(ctx context.Context, lockStrength LockingStrength, userID string) ([]*types.PersonalAccessToken, error)
	GetPATByHashedToken(ctx context.Context, lockStrength LockingStrength, hashedToken string) (*types.PersonalAccessToken, error)
	MarkPATUsed(ctx context.Context, patID string) error
	SavePAT(ctx context.Context, pat *types.PersonalAccessToken) error
	DeletePAT(ctx context.Context, userID, patID string) error

	GetProxyAccessTokenByHashedToken(ctx context.Context, lockStrength LockingStrength, hashedToken types.HashedProxyToken) (*types.ProxyAccessToken, error)
	GetAllProxyAccessTokens(ctx context.Context, lockStrength LockingStrength) ([]*types.ProxyAccessToken, error)
	SaveProxyAccessToken(ctx context.Context, token *types.ProxyAccessToken) error
	RevokeProxyAccessToken(ctx context.Context, tokenID string) error
	MarkProxyAccessTokenUsed(ctx context.Context, tokenID string) error

	GetAccountGroups(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.Group, error)
	GetResourceGroups(ctx context.Context, lockStrength LockingStrength, accountID, resourceID string) ([]*types.Group, error)
	GetGroupByID(ctx context.Context, lockStrength LockingStrength, accountID, groupID string) (*types.Group, error)
	GetGroupByName(ctx context.Context, lockStrength LockingStrength, groupName, accountID string) (*types.Group, error)
	GetGroupsByIDs(ctx context.Context, lockStrength LockingStrength, accountID string, groupIDs []string) (map[string]*types.Group, error)
	CreateGroups(ctx context.Context, accountID string, groups []*types.Group) error
	UpdateGroups(ctx context.Context, accountID string, groups []*types.Group) error
	CreateGroup(ctx context.Context, group *types.Group) error
	UpdateGroup(ctx context.Context, group *types.Group) error
	DeleteGroup(ctx context.Context, accountID, groupID string) error
	DeleteGroups(ctx context.Context, accountID string, groupIDs []string) error

	GetAccountPolicies(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.Policy, error)
	GetPolicyByID(ctx context.Context, lockStrength LockingStrength, accountID, policyID string) (*types.Policy, error)
	CreatePolicy(ctx context.Context, policy *types.Policy) error
	SavePolicy(ctx context.Context, policy *types.Policy) error
	DeletePolicy(ctx context.Context, accountID, policyID string) error

	GetPostureCheckByChecksDefinition(accountID string, checks *posture.ChecksDefinition) (*posture.Checks, error)
	GetAccountPostureChecks(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*posture.Checks, error)
	GetPostureChecksByID(ctx context.Context, lockStrength LockingStrength, accountID, postureCheckID string) (*posture.Checks, error)
	GetPostureChecksByIDs(ctx context.Context, lockStrength LockingStrength, accountID string, postureChecksIDs []string) (map[string]*posture.Checks, error)
	SavePostureChecks(ctx context.Context, postureCheck *posture.Checks) error
	DeletePostureChecks(ctx context.Context, accountID, postureChecksID string) error

	GetPeerLabelsInAccount(ctx context.Context, lockStrength LockingStrength, accountId string, hostname string) ([]string, error)
	AddPeerToAllGroup(ctx context.Context, accountID string, peerID string) error
	AddPeerToGroup(ctx context.Context, accountID, peerId string, groupID string) error
	RemovePeerFromGroup(ctx context.Context, peerID string, groupID string) error
	RemovePeerFromAllGroups(ctx context.Context, peerID string) error
	GetPeerGroups(ctx context.Context, lockStrength LockingStrength, accountId string, peerId string) ([]*types.Group, error)
	GetPeerGroupIDs(ctx context.Context, lockStrength LockingStrength, accountId string, peerId string) ([]string, error)
	AddResourceToGroup(ctx context.Context, accountId string, groupID string, resource *types.Resource) error
	RemoveResourceFromGroup(ctx context.Context, accountId string, groupID string, resourceID string) error
	AddPeerToAccount(ctx context.Context, peer *nbpeer.Peer) error
	GetPeerByPeerPubKey(ctx context.Context, lockStrength LockingStrength, peerKey string) (*nbpeer.Peer, error)
	GetAccountPeers(ctx context.Context, lockStrength LockingStrength, accountID, nameFilter, ipFilter string) ([]*nbpeer.Peer, error)
	GetUserPeers(ctx context.Context, lockStrength LockingStrength, accountID, userID string) ([]*nbpeer.Peer, error)
	GetPeerByID(ctx context.Context, lockStrength LockingStrength, accountID string, peerID string) (*nbpeer.Peer, error)
	GetPeersByIDs(ctx context.Context, lockStrength LockingStrength, accountID string, peerIDs []string) (map[string]*nbpeer.Peer, error)
	GetPeersByGroupIDs(ctx context.Context, accountID string, groupIDs []string) ([]*nbpeer.Peer, error)
	GetAccountPeersWithExpiration(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*nbpeer.Peer, error)
	GetAccountPeersWithInactivity(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*nbpeer.Peer, error)
	GetAllEphemeralPeers(ctx context.Context, lockStrength LockingStrength) ([]*nbpeer.Peer, error)
	SavePeer(ctx context.Context, accountID string, peer *nbpeer.Peer) error
	SavePeerStatus(ctx context.Context, accountID, peerID string, status nbpeer.PeerStatus) error
	SavePeerLocation(ctx context.Context, accountID string, peer *nbpeer.Peer) error
	ApproveAccountPeers(ctx context.Context, accountID string) (int, error)
	DeletePeer(ctx context.Context, accountID string, peerID string) error

	GetSetupKeyBySecret(ctx context.Context, lockStrength LockingStrength, key string) (*types.SetupKey, error)
	IncrementSetupKeyUsage(ctx context.Context, setupKeyID string) error
	GetAccountSetupKeys(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*types.SetupKey, error)
	GetSetupKeyByID(ctx context.Context, lockStrength LockingStrength, accountID, setupKeyID string) (*types.SetupKey, error)
	SaveSetupKey(ctx context.Context, setupKey *types.SetupKey) error
	DeleteSetupKey(ctx context.Context, accountID, keyID string) error

	GetAccountRoutes(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*route.Route, error)
	GetRouteByID(ctx context.Context, lockStrength LockingStrength, accountID, routeID string) (*route.Route, error)
	SaveRoute(ctx context.Context, route *route.Route) error
	DeleteRoute(ctx context.Context, accountID, routeID string) error

	GetAccountNameServerGroups(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*dns.NameServerGroup, error)
	GetNameServerGroupByID(ctx context.Context, lockStrength LockingStrength, nameServerGroupID string, accountID string) (*dns.NameServerGroup, error)
	SaveNameServerGroup(ctx context.Context, nameServerGroup *dns.NameServerGroup) error
	DeleteNameServerGroup(ctx context.Context, accountID, nameServerGroupID string) error

	GetTakenIPs(ctx context.Context, lockStrength LockingStrength, accountId string) ([]net.IP, error)
	IncrementNetworkSerial(ctx context.Context, accountId string) error
	GetAccountNetwork(ctx context.Context, lockStrength LockingStrength, accountId string) (*types.Network, error)

	GetInstallationID() string
	SaveInstallationID(ctx context.Context, ID string) error

	// AcquireGlobalLock should attempt to acquire a global lock and return a function that releases the lock
	AcquireGlobalLock(ctx context.Context) func()

	// Close should close the store persisting all unsaved data.
	Close(ctx context.Context) error
	// GetStoreEngine should return Engine of the current store implementation.
	// This is also a method of metrics.DataSource interface.
	GetStoreEngine() types.Engine
	ExecuteInTransaction(ctx context.Context, f func(store Store) error) error

	GetAccountNetworks(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*networkTypes.Network, error)
	GetNetworkByID(ctx context.Context, lockStrength LockingStrength, accountID, networkID string) (*networkTypes.Network, error)
	SaveNetwork(ctx context.Context, network *networkTypes.Network) error
	DeleteNetwork(ctx context.Context, accountID, networkID string) error

	GetNetworkRoutersByNetID(ctx context.Context, lockStrength LockingStrength, accountID, netID string) ([]*routerTypes.NetworkRouter, error)
	GetNetworkRoutersByAccountID(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*routerTypes.NetworkRouter, error)
	GetNetworkRouterByID(ctx context.Context, lockStrength LockingStrength, accountID, routerID string) (*routerTypes.NetworkRouter, error)
	SaveNetworkRouter(ctx context.Context, router *routerTypes.NetworkRouter) error
	DeleteNetworkRouter(ctx context.Context, accountID, routerID string) error

	GetNetworkResourcesByNetID(ctx context.Context, lockStrength LockingStrength, accountID, netID string) ([]*resourceTypes.NetworkResource, error)
	GetNetworkResourcesByAccountID(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*resourceTypes.NetworkResource, error)
	GetNetworkResourceByID(ctx context.Context, lockStrength LockingStrength, accountID, resourceID string) (*resourceTypes.NetworkResource, error)
	GetNetworkResourceByName(ctx context.Context, lockStrength LockingStrength, accountID, resourceName string) (*resourceTypes.NetworkResource, error)
	SaveNetworkResource(ctx context.Context, resource *resourceTypes.NetworkResource) error
	DeleteNetworkResource(ctx context.Context, accountID, resourceID string) error
	GetPeerByIP(ctx context.Context, lockStrength LockingStrength, accountID string, ip net.IP) (*nbpeer.Peer, error)
	GetPeerIdByLabel(ctx context.Context, lockStrength LockingStrength, accountID string, hostname string) (string, error)
	GetAccountGroupPeers(ctx context.Context, lockStrength LockingStrength, accountID string) (map[string]map[string]struct{}, error)
	IsPrimaryAccount(ctx context.Context, accountID string) (bool, string, error)
	MarkAccountPrimary(ctx context.Context, accountID string) error
	UpdateAccountNetwork(ctx context.Context, accountID string, ipNet net.IPNet) error
	GetPolicyRulesByResourceID(ctx context.Context, lockStrength LockingStrength, accountID string, peerID string) ([]*types.PolicyRule, error)

	// SetFieldEncrypt sets the field encryptor for encrypting sensitive user data.
	SetFieldEncrypt(enc *crypt.FieldEncrypt)
	GetUserIDByPeerKey(ctx context.Context, lockStrength LockingStrength, peerKey string) (string, error)

	CreateZone(ctx context.Context, zone *zones.Zone) error
	UpdateZone(ctx context.Context, zone *zones.Zone) error
	DeleteZone(ctx context.Context, accountID, zoneID string) error
	GetZoneByID(ctx context.Context, lockStrength LockingStrength, accountID, zoneID string) (*zones.Zone, error)
	GetZoneByDomain(ctx context.Context, accountID, domain string) (*zones.Zone, error)
	GetAccountZones(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*zones.Zone, error)

	CreateDNSRecord(ctx context.Context, record *records.Record) error
	UpdateDNSRecord(ctx context.Context, record *records.Record) error
	DeleteDNSRecord(ctx context.Context, accountID, zoneID, recordID string) error
	GetDNSRecordByID(ctx context.Context, lockStrength LockingStrength, accountID, zoneID, recordID string) (*records.Record, error)
	GetZoneDNSRecords(ctx context.Context, lockStrength LockingStrength, accountID, zoneID string) ([]*records.Record, error)
	GetZoneDNSRecordsByName(ctx context.Context, lockStrength LockingStrength, accountID, zoneID, name string) ([]*records.Record, error)
	DeleteZoneDNSRecords(ctx context.Context, accountID, zoneID string) error
	CreatePeerJob(ctx context.Context, job *types.Job) error
	CompletePeerJob(ctx context.Context, job *types.Job) error
	GetPeerJobByID(ctx context.Context, accountID, jobID string) (*types.Job, error)
	GetPeerJobs(ctx context.Context, accountID, peerID string) ([]*types.Job, error)
	MarkPendingJobsAsFailed(ctx context.Context, accountID, peerID, jobID, reason string) error
	MarkAllPendingJobsAsFailed(ctx context.Context, accountID, peerID, reason string) error
	GetPeerIDByKey(ctx context.Context, lockStrength LockingStrength, key string) (string, error)

	CreateService(ctx context.Context, service *reverseproxy.Service) error
	UpdateService(ctx context.Context, service *reverseproxy.Service) error
	DeleteService(ctx context.Context, accountID, serviceID string) error
	GetServiceByID(ctx context.Context, lockStrength LockingStrength, accountID, serviceID string) (*reverseproxy.Service, error)
	GetServicesByAccountID(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*reverseproxy.Service, error)
	GetServiceByDomain(ctx context.Context, accountID, domain string) (*reverseproxy.Service, error)
	GetServices(ctx context.Context, lockStrength LockingStrength) ([]*reverseproxy.Service, error)
	GetAccountServices(ctx context.Context, lockStrength LockingStrength, accountID string) ([]*reverseproxy.Service, error)

	GetCustomDomain(ctx context.Context, accountID string, domainID string) (*domain.Domain, error)
	ListFreeDomains(ctx context.Context, accountID string) ([]string, error)
	ListCustomDomains(ctx context.Context, accountID string) ([]*domain.Domain, error)
	CreateCustomDomain(ctx context.Context, accountID string, domainName string, targetCluster string, validated bool) (*domain.Domain, error)
	UpdateCustomDomain(ctx context.Context, accountID string, d *domain.Domain) (*domain.Domain, error)
	DeleteCustomDomain(ctx context.Context, accountID string, domainID string) error

	CreateAccessLog(ctx context.Context, log *accesslogs.AccessLogEntry) error
	GetAccountAccessLogs(ctx context.Context, lockStrength LockingStrength, accountID string, filter accesslogs.AccessLogFilter) ([]*accesslogs.AccessLogEntry, int64, error)
	DeleteOldAccessLogs(ctx context.Context, olderThan time.Time) (int64, error)
	GetServiceTargetByTargetID(ctx context.Context, lockStrength LockingStrength, accountID string, targetID string) (*reverseproxy.Target, error)

	// GetCustomDomainsCounts returns the total and validated custom domain counts.
	GetCustomDomainsCounts(ctx context.Context) (total int64, validated int64, err error)
}

func NewStore

func NewStore(ctx context.Context, kind types.Engine, dataDir string, metrics telemetry.AppMetrics, skipMigration bool) (Store, error)

NewStore creates a new store based on the provided engine type, data directory, and telemetry metrics

func NewTestStoreFromSQL

func NewTestStoreFromSQL(ctx context.Context, filename string, dataDir string) (Store, func(), error)

NewTestStoreFromSQL is only used in tests. It will create a test database base of the store engine set in env. Optionally it can load a SQL file to the database. If the filename is empty it will return an empty database

Jump to

Keyboard shortcuts

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