networkmap_sqlite

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetServicesQuery = `
	select enabled, private, access_groups, proxy_cluster, domain
	from services
	where account_id=?
	`

	GetProxyTargetedDomainResourcesQuery = `` /* 228-byte string literal not displayed */

)
View Source
const (
	GetAllowedUserIdsQuery = `
	select id, auto_groups
	from users
	where account_id=? and not blocked and not is_service_user
	`

	GetAllGroupIdQuery = `
	select id from groups
	where account_id=? and name='All'
	`
)
View Source
const (
	GetAccountSettingsQuery = `` /* 719-byte string literal not displayed */

)
View Source
const (
	GetAccountZonesQuery = `` /* 324-byte string literal not displayed */

)
View Source
const (
	GetDnsSettingsQuery = `
	select dns_settings_disabled_management_groups
	from accounts
	where id=?
	`
)
View Source
const (
	GetDomainsQuery = `
	select domain, target_cluster
	from domains
	where account_id=? and domain<>'' and target_cluster<>''
	`
)
View Source
const (
	GetGroupsQuery = `` /* 193-byte string literal not displayed */

)
View Source
const (
	GetNameserversQuery = `` /* 163-byte string literal not displayed */

)
View Source
const (
	GetNetworkQuery = `` /* 162-byte string literal not displayed */

)
View Source
const (
	GetNetworkResourcesQuery = `` /* 142-byte string literal not displayed */

)
View Source
const (
	GetNetworkRouterQuery = `` /* 275-byte string literal not displayed */

)
View Source
const (
	GetNetworksQuery = `
	select id, public_id
	from networks where account_id=?
	`
)
View Source
const (
	GetPeersQuery = `` /* 486-byte string literal not displayed */

)
View Source
const (
	GetPoliciesQuery = `` /* 373-byte string literal not displayed */

)
View Source
const (
	GetPostureChecksQuery = `
	select id, public_id, checks
	from posture_checks
	where account_id=?
	`
)
View Source
const (
	GetRoutesQuery = `` /* 250-byte string literal not displayed */

)

Variables

View Source
var ErrNoRows = errors.New("no rows in result set")

Functions

func CollectOneRowForSqlite

func CollectOneRowForSqlite[T any](rows *sql.Rows) (T, error)

func CollectRowsForSqlite

func CollectRowsForSqlite[T any](rows *sql.Rows) ([]T, error)

Types

type SqliteStore

type SqliteStore struct {
	Db *sql.DB
}

func NewSqliteStore

func NewSqliteStore(storeFile, dataDir string) (*SqliteStore, error)

func (*SqliteStore) BeginTx

func (*SqliteStore) Exec

func (s *SqliteStore) Exec(_ context.Context, query string, args ...any) error

func (*SqliteStore) UsingConn

func (s *SqliteStore) UsingConn() *SqliteStoreConn

type SqliteStoreConn

type SqliteStoreConn struct {
	Conn sqliteInterface
}

func (*SqliteStoreConn) CommitTx

func (sc *SqliteStoreConn) CommitTx(ctx context.Context) error

func (*SqliteStoreConn) GetAccountSettings

func (sc *SqliteStoreConn) GetAccountSettings(ctx context.Context, accountId string) (nmdata.AccountSettingsInfo, error)

func (*SqliteStoreConn) GetAllowedUsers

func (sc *SqliteStoreConn) GetAllowedUsers(ctx context.Context, accountId string) (map[string]struct{}, map[string][]string, error)

func (*SqliteStoreConn) GetAppliedZoneCandidates

func (sc *SqliteStoreConn) GetAppliedZoneCandidates(ctx context.Context, accountId string) ([]networkmap.AppliedZoneCandidate, error)

func (*SqliteStoreConn) GetDnsSettings

func (sc *SqliteStoreConn) GetDnsSettings(ctx context.Context, accountId string) (nmdata.DNSSettings, error)

func (*SqliteStoreConn) GetDomains

func (sc *SqliteStoreConn) GetDomains(ctx context.Context, accountId string) ([]networkmapdb.Domain, error)

func (*SqliteStoreConn) GetGroups

func (sc *SqliteStoreConn) GetGroups(ctx context.Context, accountId string) ([]nmdata.Group, map[string]map[string]any, error)

we also return a resource-to-group index. an alternative is to add json indexes, query this directly. Not sure how expensive json indexes are. TODO (dmitri) verify and maybe change the implementation here.

func (*SqliteStoreConn) GetNameServerGroups

func (sc *SqliteStoreConn) GetNameServerGroups(ctx context.Context, accountId string) ([]nmdata.NameServerGroup, error)

func (*SqliteStoreConn) GetNetwork

func (sc *SqliteStoreConn) GetNetwork(ctx context.Context, accountId string) (nmdata.Network, error)

func (*SqliteStoreConn) GetNetworkResources

func (sc *SqliteStoreConn) GetNetworkResources(ctx context.Context, accountId string) ([]nmdata.NetworkResource, error)

func (*SqliteStoreConn) GetNetworkRouters

func (sc *SqliteStoreConn) GetNetworkRouters(ctx context.Context, accountId string) (map[string]map[string]*nmdata.NetworkRouter, error)

func (*SqliteStoreConn) GetNetworkXIDToPublicIdMap

func (sc *SqliteStoreConn) GetNetworkXIDToPublicIdMap(ctx context.Context, accountId string) (map[string]string, error)

func (*SqliteStoreConn) GetPeers

func (sc *SqliteStoreConn) GetPeers(ctx context.Context, accountId string) ([]nmdata.Peer, map[string][]*nmdata.Peer, error)

func (*SqliteStoreConn) GetPolicies

func (sc *SqliteStoreConn) GetPolicies(ctx context.Context, accountId string) ([]nmdata.Policy, map[string]map[string]any, map[string]map[string]any, error)

func (*SqliteStoreConn) GetPostureChecks

func (sc *SqliteStoreConn) GetPostureChecks(ctx context.Context, accountId string) ([]nmdata.PostureChecks, map[string]string, error)

func (*SqliteStoreConn) GetPrivateServices

func (sc *SqliteStoreConn) GetPrivateServices(ctx context.Context, accountId string) ([]networkmapdb.Service, error)

func (*SqliteStoreConn) GetProxyTargetedDomainResourceIDs

func (sc *SqliteStoreConn) GetProxyTargetedDomainResourceIDs(ctx context.Context, accountId string) (map[string]struct{}, error)

func (*SqliteStoreConn) GetRoutes

func (sc *SqliteStoreConn) GetRoutes(ctx context.Context, accountId string) ([]nmdata.Route, error)

func (*SqliteStoreConn) RollbackTx

func (sc *SqliteStoreConn) RollbackTx(ctx context.Context) error

Jump to

Keyboard shortcuts

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