Documentation
¶
Index ¶
- Constants
- Variables
- func CollectOneRowForSqlite[T any](rows *sql.Rows) (T, error)
- func CollectRowsForSqlite[T any](rows *sql.Rows) ([]T, error)
- type SqliteStore
- type SqliteStoreConn
- func (sc *SqliteStoreConn) CommitTx(ctx context.Context) error
- func (sc *SqliteStoreConn) GetAccountSettings(ctx context.Context, accountId string) (nmdata.AccountSettingsInfo, error)
- func (sc *SqliteStoreConn) GetAllowedUsers(ctx context.Context, accountId string) (map[string]struct{}, map[string][]string, error)
- func (sc *SqliteStoreConn) GetAppliedZoneCandidates(ctx context.Context, accountId string) ([]networkmap.AppliedZoneCandidate, error)
- func (sc *SqliteStoreConn) GetDnsSettings(ctx context.Context, accountId string) (nmdata.DNSSettings, error)
- func (sc *SqliteStoreConn) GetDomains(ctx context.Context, accountId string) ([]networkmapdb.Domain, error)
- func (sc *SqliteStoreConn) GetGroups(ctx context.Context, accountId string) ([]nmdata.Group, map[string]map[string]any, error)
- func (sc *SqliteStoreConn) GetNameServerGroups(ctx context.Context, accountId string) ([]nmdata.NameServerGroup, error)
- func (sc *SqliteStoreConn) GetNetwork(ctx context.Context, accountId string) (nmdata.Network, error)
- func (sc *SqliteStoreConn) GetNetworkResources(ctx context.Context, accountId string) ([]nmdata.NetworkResource, error)
- func (sc *SqliteStoreConn) GetNetworkRouters(ctx context.Context, accountId string) (map[string]map[string]*nmdata.NetworkRouter, error)
- func (sc *SqliteStoreConn) GetNetworkXIDToPublicIdMap(ctx context.Context, accountId string) (map[string]string, error)
- func (sc *SqliteStoreConn) GetPeers(ctx context.Context, accountId string) ([]nmdata.Peer, map[string][]*nmdata.Peer, error)
- func (sc *SqliteStoreConn) GetPolicies(ctx context.Context, accountId string) ([]nmdata.Policy, map[string]map[string]any, map[string]map[string]any, error)
- func (sc *SqliteStoreConn) GetPostureChecks(ctx context.Context, accountId string) ([]nmdata.PostureChecks, map[string]string, error)
- func (sc *SqliteStoreConn) GetPrivateServices(ctx context.Context, accountId string) ([]networkmapdb.Service, error)
- func (sc *SqliteStoreConn) GetProxyTargetedDomainResourceIDs(ctx context.Context, accountId string) (map[string]struct{}, error)
- func (sc *SqliteStoreConn) GetRoutes(ctx context.Context, accountId string) ([]nmdata.Route, error)
- func (sc *SqliteStoreConn) RollbackTx(ctx context.Context) error
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 ¶
Types ¶
type SqliteStore ¶
func NewSqliteStore ¶
func NewSqliteStore(storeFile, dataDir string) (*SqliteStore, error)
func (*SqliteStore) BeginTx ¶
func (s *SqliteStore) BeginTx(ctx context.Context) (networkmapdb.NetworkMapDBStoreConn, error)
func (*SqliteStore) UsingConn ¶
func (s *SqliteStore) UsingConn() *SqliteStoreConn
type SqliteStoreConn ¶
type SqliteStoreConn struct {
Conn sqliteInterface
}
func (*SqliteStoreConn) GetAccountSettings ¶
func (sc *SqliteStoreConn) GetAccountSettings(ctx context.Context, accountId string) (nmdata.AccountSettingsInfo, error)
func (*SqliteStoreConn) GetAllowedUsers ¶
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 (*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 (*SqliteStoreConn) GetPolicies ¶
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 (*SqliteStoreConn) RollbackTx ¶
func (sc *SqliteStoreConn) RollbackTx(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.