Documentation
¶
Index ¶
- func ConnectToConfigDB(ctx context.Context, opts ...dbopen.Options) (*pgxpool.Pool, error)
- type AdminApiKey
- type BucketConfiguration
- type BucketPrefixMapping
- type CCollector
- type COrganization
- type COrganizationApiKey
- type CStorageProfile
- type CheckOrgBucketAccessParams
- type CreateAdminAPIKeyParams
- type CreateBucketConfigurationParams
- type CreateBucketPrefixMappingParams
- type CreateOrganizationAPIKeyMappingParams
- type CreateOrganizationAPIKeyParams
- type CreateOrganizationBucketParams
- type DBTX
- type DeleteOrgConfigParams
- type DeleteOrganizationAPIKeyMappingByHashParams
- type DeleteOrganizationBucketMappingsParams
- type DeleteOrganizationBucketParams
- type ExpiryRunTracking
- type GetActiveOrganizationsRow
- type GetAllBucketConfigurationsRow
- type GetAllCBucketDataRow
- type GetAllCOrganizationAPIKeysForSyncRow
- type GetAllCOrganizationAPIKeysRow
- type GetAllCOrganizationsRow
- type GetAllCStorageProfilesForSyncRow
- type GetAllOrganizationAPIKeyMappingsRow
- type GetAllOrganizationAPIKeysRow
- type GetAllOrganizationBucketMappingsRow
- type GetAllOrganizationsRow
- type GetBucketPrefixMappingsRow
- type GetDefaultOrganizationBucketRow
- type GetExpiryLastRunParams
- type GetLongestPrefixMatchParams
- type GetLongestPrefixMatchRow
- type GetLowestInstanceOrganizationBucketParams
- type GetLowestInstanceOrganizationBucketRow
- type GetOrgConfigParams
- type GetOrganizationAPIKeyByHashRow
- type GetOrganizationAPIKeyByIDRow
- type GetOrganizationBucketByCollectorParams
- type GetOrganizationBucketByCollectorRow
- type GetOrganizationBucketByInstanceParams
- type GetOrganizationBucketByInstanceRow
- type GetOrganizationExpiryParams
- type GetStorageProfileByCollectorNameRow
- type GetStorageProfileParams
- type GetStorageProfileRow
- type GetStorageProfilesByBucketNameRow
- type ListBucketPrefixMappingsRow
- type ListOrgConfigsRow
- type ListOrganizationAPIKeysByOrgRow
- type ListOrganizationBucketsByOrgRow
- type Organization
- type OrganizationApiKey
- type OrganizationApiKeyMapping
- type OrganizationBucket
- type OrganizationConfig
- type OrganizationSignalExpiry
- type Querier
- type QuerierFull
- type Queries
- func (q *Queries) CheckOrgBucketAccess(ctx context.Context, arg CheckOrgBucketAccessParams) (bool, error)
- func (q *Queries) ClearAdminAPIKeys(ctx context.Context) error
- func (q *Queries) ClearBucketConfigurations(ctx context.Context) error
- func (q *Queries) ClearBucketPrefixMappings(ctx context.Context) error
- func (q *Queries) ClearOrganizationAPIKeyMappings(ctx context.Context) error
- func (q *Queries) ClearOrganizationAPIKeys(ctx context.Context) error
- func (q *Queries) ClearOrganizationBuckets(ctx context.Context) error
- func (q *Queries) ClearOrganizations(ctx context.Context) error
- func (q *Queries) CreateAdminAPIKey(ctx context.Context, arg CreateAdminAPIKeyParams) (AdminApiKey, error)
- func (q *Queries) CreateBucketConfiguration(ctx context.Context, arg CreateBucketConfigurationParams) (BucketConfiguration, error)
- func (q *Queries) CreateBucketPrefixMapping(ctx context.Context, arg CreateBucketPrefixMappingParams) (BucketPrefixMapping, error)
- func (q *Queries) CreateOrganizationAPIKey(ctx context.Context, arg CreateOrganizationAPIKeyParams) (OrganizationApiKey, error)
- func (q *Queries) CreateOrganizationAPIKeyMapping(ctx context.Context, arg CreateOrganizationAPIKeyMappingParams) (OrganizationApiKeyMapping, error)
- func (q *Queries) CreateOrganizationBucket(ctx context.Context, arg CreateOrganizationBucketParams) (OrganizationBucket, error)
- func (q *Queries) DeleteAdminAPIKey(ctx context.Context, apiKeyID uuid.UUID) error
- func (q *Queries) DeleteBucketConfiguration(ctx context.Context, bucketName string) error
- func (q *Queries) DeleteBucketPrefixMapping(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteOrgConfig(ctx context.Context, arg DeleteOrgConfigParams) error
- func (q *Queries) DeleteOrganization(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteOrganizationAPIKey(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteOrganizationAPIKeyMapping(ctx context.Context, apiKeyID uuid.UUID) error
- func (q *Queries) DeleteOrganizationAPIKeyMappingByHash(ctx context.Context, arg DeleteOrganizationAPIKeyMappingByHashParams) error
- func (q *Queries) DeleteOrganizationBucket(ctx context.Context, arg DeleteOrganizationBucketParams) error
- func (q *Queries) DeleteOrganizationBucketMappings(ctx context.Context, arg DeleteOrganizationBucketMappingsParams) error
- func (q *Queries) DeleteOrganizationsNotInList(ctx context.Context, idsToDelete []uuid.UUID) error
- func (q *Queries) GetActiveOrganizations(ctx context.Context) ([]GetActiveOrganizationsRow, error)
- func (q *Queries) GetAdminAPIKeyByHash(ctx context.Context, keyHash string) (AdminApiKey, error)
- func (q *Queries) GetAdminAPIKeyByID(ctx context.Context, apiKeyID uuid.UUID) (AdminApiKey, error)
- func (q *Queries) GetAllAdminAPIKeys(ctx context.Context) ([]AdminApiKey, error)
- func (q *Queries) GetAllBucketConfigurations(ctx context.Context) ([]GetAllBucketConfigurationsRow, error)
- func (q *Queries) GetAllCBucketData(ctx context.Context) ([]GetAllCBucketDataRow, error)
- func (q *Queries) GetAllCOrganizationAPIKeys(ctx context.Context) ([]GetAllCOrganizationAPIKeysRow, error)
- func (q *Queries) GetAllCOrganizationAPIKeysForSync(ctx context.Context) ([]GetAllCOrganizationAPIKeysForSyncRow, error)
- func (q *Queries) GetAllCOrganizations(ctx context.Context) ([]GetAllCOrganizationsRow, error)
- func (q *Queries) GetAllCStorageProfilesForSync(ctx context.Context) ([]GetAllCStorageProfilesForSyncRow, error)
- func (q *Queries) GetAllOrganizationAPIKeyMappings(ctx context.Context) ([]GetAllOrganizationAPIKeyMappingsRow, error)
- func (q *Queries) GetAllOrganizationAPIKeys(ctx context.Context) ([]GetAllOrganizationAPIKeysRow, error)
- func (q *Queries) GetAllOrganizationBucketMappings(ctx context.Context) ([]GetAllOrganizationBucketMappingsRow, error)
- func (q *Queries) GetAllOrganizations(ctx context.Context) ([]GetAllOrganizationsRow, error)
- func (q *Queries) GetBucketByOrganization(ctx context.Context, organizationID uuid.UUID) (string, error)
- func (q *Queries) GetBucketConfiguration(ctx context.Context, bucketName string) (BucketConfiguration, error)
- func (q *Queries) GetBucketConfigurationByName(ctx context.Context, bucketName string) (BucketConfiguration, error)
- func (q *Queries) GetBucketPrefixMappings(ctx context.Context, bucketName string) ([]GetBucketPrefixMappingsRow, error)
- func (q *Queries) GetDefaultOrganizationBucket(ctx context.Context, organizationID uuid.UUID) (GetDefaultOrganizationBucketRow, error)
- func (q *Queries) GetExpiryLastRun(ctx context.Context, arg GetExpiryLastRunParams) (ExpiryRunTracking, error)
- func (q *Queries) GetLongestPrefixMatch(ctx context.Context, arg GetLongestPrefixMatchParams) (GetLongestPrefixMatchRow, error)
- func (q *Queries) GetLowestInstanceOrganizationBucket(ctx context.Context, arg GetLowestInstanceOrganizationBucketParams) (GetLowestInstanceOrganizationBucketRow, error)
- func (q *Queries) GetOrgConfig(ctx context.Context, arg GetOrgConfigParams) (json.RawMessage, error)
- func (q *Queries) GetOrganization(ctx context.Context, id uuid.UUID) (Organization, error)
- func (q *Queries) GetOrganizationAPIKeyByHash(ctx context.Context, keyHash string) (GetOrganizationAPIKeyByHashRow, error)
- func (q *Queries) GetOrganizationAPIKeyByID(ctx context.Context, apiKeyID uuid.UUID) (GetOrganizationAPIKeyByIDRow, error)
- func (q *Queries) GetOrganizationBucketByCollector(ctx context.Context, arg GetOrganizationBucketByCollectorParams) (GetOrganizationBucketByCollectorRow, error)
- func (q *Queries) GetOrganizationBucketByInstance(ctx context.Context, arg GetOrganizationBucketByInstanceParams) (GetOrganizationBucketByInstanceRow, error)
- func (q *Queries) GetOrganizationByName(ctx context.Context, name string) (Organization, error)
- func (q *Queries) GetOrganizationExpiry(ctx context.Context, arg GetOrganizationExpiryParams) (OrganizationSignalExpiry, error)
- func (q *Queries) GetOrganizationsByBucket(ctx context.Context, bucketName string) ([]uuid.UUID, error)
- func (q *Queries) GetStorageProfileByCollectorNameUncached(ctx context.Context, organizationID pgtype.UUID) (GetStorageProfileByCollectorNameRow, error)
- func (q *Queries) GetStorageProfileUncached(ctx context.Context, arg GetStorageProfileParams) (GetStorageProfileRow, error)
- func (q *Queries) GetStorageProfilesByBucketNameUncached(ctx context.Context, bucketName string) ([]GetStorageProfilesByBucketNameRow, error)
- func (q *Queries) HasExistingStorageProfiles(ctx context.Context) (bool, error)
- func (q *Queries) ListBucketConfigurations(ctx context.Context) ([]BucketConfiguration, error)
- func (q *Queries) ListBucketPrefixMappings(ctx context.Context) ([]ListBucketPrefixMappingsRow, error)
- func (q *Queries) ListEnabledOrganizations(ctx context.Context) ([]Organization, error)
- func (q *Queries) ListOrgConfigs(ctx context.Context, organizationID uuid.UUID) ([]ListOrgConfigsRow, error)
- func (q *Queries) ListOrganizationAPIKeysByOrg(ctx context.Context, organizationID uuid.UUID) ([]ListOrganizationAPIKeysByOrgRow, error)
- func (q *Queries) ListOrganizationBucketsByOrg(ctx context.Context, organizationID uuid.UUID) ([]ListOrganizationBucketsByOrgRow, error)
- func (q *Queries) ListOrganizations(ctx context.Context) ([]Organization, error)
- func (q *Queries) UpsertAdminAPIKey(ctx context.Context, arg UpsertAdminAPIKeyParams) (AdminApiKey, error)
- func (q *Queries) UpsertBucketConfiguration(ctx context.Context, arg UpsertBucketConfigurationParams) (BucketConfiguration, error)
- func (q *Queries) UpsertExpiryRunTracking(ctx context.Context, arg UpsertExpiryRunTrackingParams) error
- func (q *Queries) UpsertOrgConfig(ctx context.Context, arg UpsertOrgConfigParams) error
- func (q *Queries) UpsertOrganization(ctx context.Context, arg UpsertOrganizationParams) (Organization, error)
- func (q *Queries) UpsertOrganizationAPIKey(ctx context.Context, arg UpsertOrganizationAPIKeyParams) (OrganizationApiKey, error)
- func (q *Queries) UpsertOrganizationAPIKeyMapping(ctx context.Context, arg UpsertOrganizationAPIKeyMappingParams) error
- func (q *Queries) UpsertOrganizationBucket(ctx context.Context, arg UpsertOrganizationBucketParams) error
- func (q *Queries) UpsertOrganizationExpiry(ctx context.Context, arg UpsertOrganizationExpiryParams) error
- func (q *Queries) UpsertOrganizationSync(ctx context.Context, arg UpsertOrganizationSyncParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Store
- func (store *Store) AddOrganizationBucket(ctx context.Context, orgID uuid.UUID, bucketName string, instanceNum int16, ...) error
- func (s *Store) Close()
- func (store *Store) CreateBucketPrefixMappingForOrg(ctx context.Context, bucketName string, orgID uuid.UUID, pathPrefix string, ...) (*BucketPrefixMapping, error)
- func (store *Store) CreateOrganizationAPIKeyWithMapping(ctx context.Context, params CreateOrganizationAPIKeyParams, orgID uuid.UUID) (*OrganizationApiKey, error)
- func (store *Store) DeleteOrganizationAPIKeyWithMappings(ctx context.Context, keyID uuid.UUID) error
- func (s *Store) GetPool() *pgxpool.Pool
- func (store *Store) GetStorageProfile(ctx context.Context, params GetStorageProfileParams) (GetStorageProfileRow, error)
- func (store *Store) GetStorageProfileByCollectorName(ctx context.Context, organizationID uuid.UUID) (GetStorageProfileByCollectorNameRow, error)
- func (store *Store) GetStorageProfilesByBucketName(ctx context.Context, bucketName string) ([]GetStorageProfilesByBucketNameRow, error)
- type StoreFull
- type UpsertAdminAPIKeyParams
- type UpsertBucketConfigurationParams
- type UpsertExpiryRunTrackingParams
- type UpsertOrgConfigParams
- type UpsertOrganizationAPIKeyMappingParams
- type UpsertOrganizationAPIKeyParams
- type UpsertOrganizationBucketParams
- type UpsertOrganizationExpiryParams
- type UpsertOrganizationParams
- type UpsertOrganizationSyncParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdminApiKey ¶
type BucketConfiguration ¶
type BucketConfiguration struct {
ID uuid.UUID `json:"id"`
BucketName string `json:"bucket_name"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Endpoint *string `json:"endpoint"`
Role *string `json:"role"`
UsePathStyle bool `json:"use_path_style"`
InsecureTls bool `json:"insecure_tls"`
}
type BucketPrefixMapping ¶
type CCollector ¶
type CCollector struct {
ID uuid.UUID `json:"id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
CreatedBy *string `json:"created_by"`
UpdatedBy *string `json:"updated_by"`
OrganizationID pgtype.UUID `json:"organization_id"`
StorageProfileID pgtype.UUID `json:"storage_profile_id"`
InstanceNum int16 `json:"instance_num"`
ExternalID string `json:"external_id"`
DeletedAt pgtype.Timestamp `json:"deleted_at"`
DeletedBy *string `json:"deleted_by"`
Type int32 `json:"type"`
Trusted pgtype.Bool `json:"trusted"`
Version *string `json:"version"`
Saas pgtype.Bool `json:"saas"`
Style *string `json:"style"`
DagHashSeed pgtype.Int4 `json:"dag_hash_seed"`
ConfigHashSeed pgtype.Int4 `json:"config_hash_seed"`
CollectorGroup string `json:"collector_group"`
Flags map[string]any `json:"flags"`
}
type COrganization ¶
type COrganization struct {
ID uuid.UUID `json:"id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
CreatedBy *string `json:"created_by"`
UpdatedBy *string `json:"updated_by"`
Name *string `json:"name"`
Enabled pgtype.Bool `json:"enabled"`
NotificationSlack *string `json:"notification_slack"`
NotificationEmail *string `json:"notification_email"`
NotificationPagerDutyService *string `json:"notification_pager_duty_service"`
Features map[string]any `json:"features"`
}
type COrganizationApiKey ¶
type COrganizationApiKey struct {
ID uuid.UUID `json:"id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
CreatedBy *string `json:"created_by"`
UpdatedBy *string `json:"updated_by"`
OrganizationID pgtype.UUID `json:"organization_id"`
Name *string `json:"name"`
ApiKey *string `json:"api_key"`
Enabled pgtype.Bool `json:"enabled"`
}
type CStorageProfile ¶
type CreateAdminAPIKeyParams ¶
type CreateBucketConfigurationParams ¶
type CreateBucketConfigurationParams struct {
BucketName string `json:"bucket_name"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Endpoint *string `json:"endpoint"`
Role *string `json:"role"`
UsePathStyle bool `json:"use_path_style"`
InsecureTls bool `json:"insecure_tls"`
}
type DeleteOrgConfigParams ¶ added in v1.7.0
type DeleteOrganizationAPIKeyMappingByHashParams ¶ added in v1.4.0
type DeleteOrganizationBucketMappingsParams ¶ added in v1.4.0
type DeleteOrganizationBucketParams ¶ added in v1.4.0
type ExpiryRunTracking ¶ added in v1.4.1
type ExpiryRunTracking struct {
OrganizationID uuid.UUID `json:"organization_id"`
SignalType string `json:"signal_type"`
LastRunAt pgtype.Timestamp `json:"last_run_at"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
}
Tracks when expiry cleanup was last run for each organization and signal type. Separate from policy to avoid creating policy records just for tracking.
type GetActiveOrganizationsRow ¶ added in v1.4.1
type GetAllBucketConfigurationsRow ¶ added in v1.4.0
type GetAllCBucketDataRow ¶ added in v1.4.0
type GetAllCBucketDataRow struct {
BucketName string `json:"bucket_name"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Role *string `json:"role"`
OrganizationID pgtype.UUID `json:"organization_id"`
InstanceNum pgtype.Int2 `json:"instance_num"`
CollectorName *string `json:"collector_name"`
}
type GetAllCOrganizationAPIKeysRow ¶ added in v1.4.0
type GetAllCOrganizationsRow ¶ added in v1.4.0
type GetAllOrganizationAPIKeyMappingsRow ¶ added in v1.4.0
type GetAllOrganizationBucketMappingsRow ¶ added in v1.4.0
type GetAllOrganizationsRow ¶ added in v1.4.0
type GetBucketPrefixMappingsRow ¶ added in v1.4.0
type GetDefaultOrganizationBucketRow ¶
type GetDefaultOrganizationBucketRow struct {
OrganizationID uuid.UUID `json:"organization_id"`
InstanceNum int16 `json:"instance_num"`
CollectorName string `json:"collector_name"`
BucketName string `json:"bucket_name"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Role *string `json:"role"`
Endpoint *string `json:"endpoint"`
UsePathStyle bool `json:"use_path_style"`
InsecureTls bool `json:"insecure_tls"`
}
type GetExpiryLastRunParams ¶ added in v1.4.1
type GetLongestPrefixMatchRow ¶ added in v1.4.0
type GetLowestInstanceOrganizationBucketParams ¶ added in v1.3.0
type GetLowestInstanceOrganizationBucketRow ¶ added in v1.3.0
type GetLowestInstanceOrganizationBucketRow struct {
OrganizationID uuid.UUID `json:"organization_id"`
InstanceNum int16 `json:"instance_num"`
CollectorName string `json:"collector_name"`
BucketName string `json:"bucket_name"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Role *string `json:"role"`
Endpoint *string `json:"endpoint"`
UsePathStyle bool `json:"use_path_style"`
InsecureTls bool `json:"insecure_tls"`
}
type GetOrgConfigParams ¶ added in v1.7.0
type GetOrganizationBucketByCollectorRow ¶
type GetOrganizationBucketByCollectorRow struct {
OrganizationID uuid.UUID `json:"organization_id"`
InstanceNum int16 `json:"instance_num"`
CollectorName string `json:"collector_name"`
BucketName string `json:"bucket_name"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Role *string `json:"role"`
Endpoint *string `json:"endpoint"`
UsePathStyle bool `json:"use_path_style"`
InsecureTls bool `json:"insecure_tls"`
}
type GetOrganizationBucketByInstanceRow ¶
type GetOrganizationBucketByInstanceRow struct {
OrganizationID uuid.UUID `json:"organization_id"`
InstanceNum int16 `json:"instance_num"`
CollectorName string `json:"collector_name"`
BucketName string `json:"bucket_name"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Role *string `json:"role"`
Endpoint *string `json:"endpoint"`
UsePathStyle bool `json:"use_path_style"`
InsecureTls bool `json:"insecure_tls"`
}
type GetOrganizationExpiryParams ¶ added in v1.4.1
type GetStorageProfileByCollectorNameRow ¶
type GetStorageProfileByCollectorNameRow struct {
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Role *string `json:"role"`
Bucket string `json:"bucket"`
InstanceNum int16 `json:"instance_num"`
OrganizationID uuid.UUID `json:"organization_id"`
ExternalID string `json:"external_id"`
}
type GetStorageProfileParams ¶
type GetStorageProfileRow ¶
type GetStorageProfilesByBucketNameRow ¶
type GetStorageProfilesByBucketNameRow struct {
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Role *string `json:"role"`
Bucket string `json:"bucket"`
InstanceNum int16 `json:"instance_num"`
OrganizationID uuid.UUID `json:"organization_id"`
ExternalID string `json:"external_id"`
}
type ListOrgConfigsRow ¶ added in v1.7.0
type ListOrganizationAPIKeysByOrgRow ¶ added in v1.4.0
type ListOrganizationBucketsByOrgRow ¶ added in v1.4.0
type Organization ¶
type OrganizationApiKey ¶
type OrganizationBucket ¶
type OrganizationConfig ¶ added in v1.7.0
type OrganizationSignalExpiry ¶ added in v1.4.1
type OrganizationSignalExpiry struct {
OrganizationID uuid.UUID `json:"organization_id"`
SignalType string `json:"signal_type"`
MaxAgeDays int32 `json:"max_age_days"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Stores data retention policies for each organization and signal type. A value of -1 means use system default, 0 means never expire, >0 means specific retention days.
type Querier ¶
type Querier interface {
CheckOrgBucketAccess(ctx context.Context, arg CheckOrgBucketAccessParams) (bool, error)
ClearAdminAPIKeys(ctx context.Context) error
ClearBucketConfigurations(ctx context.Context) error
ClearBucketPrefixMappings(ctx context.Context) error
ClearOrganizationAPIKeyMappings(ctx context.Context) error
ClearOrganizationAPIKeys(ctx context.Context) error
ClearOrganizationBuckets(ctx context.Context) error
ClearOrganizations(ctx context.Context) error
CreateAdminAPIKey(ctx context.Context, arg CreateAdminAPIKeyParams) (AdminApiKey, error)
CreateBucketConfiguration(ctx context.Context, arg CreateBucketConfigurationParams) (BucketConfiguration, error)
CreateBucketPrefixMapping(ctx context.Context, arg CreateBucketPrefixMappingParams) (BucketPrefixMapping, error)
CreateOrganizationAPIKey(ctx context.Context, arg CreateOrganizationAPIKeyParams) (OrganizationApiKey, error)
CreateOrganizationAPIKeyMapping(ctx context.Context, arg CreateOrganizationAPIKeyMappingParams) (OrganizationApiKeyMapping, error)
CreateOrganizationBucket(ctx context.Context, arg CreateOrganizationBucketParams) (OrganizationBucket, error)
DeleteAdminAPIKey(ctx context.Context, apiKeyID uuid.UUID) error
DeleteBucketConfiguration(ctx context.Context, bucketName string) error
DeleteBucketPrefixMapping(ctx context.Context, id uuid.UUID) error
// Delete a specific config for an org.
DeleteOrgConfig(ctx context.Context, arg DeleteOrgConfigParams) error
DeleteOrganization(ctx context.Context, id uuid.UUID) error
DeleteOrganizationAPIKey(ctx context.Context, id uuid.UUID) error
DeleteOrganizationAPIKeyMapping(ctx context.Context, apiKeyID uuid.UUID) error
// Delete API key mapping by hash
DeleteOrganizationAPIKeyMappingByHash(ctx context.Context, arg DeleteOrganizationAPIKeyMappingByHashParams) error
DeleteOrganizationBucket(ctx context.Context, arg DeleteOrganizationBucketParams) error
// Delete organization bucket mappings not in c_ tables
DeleteOrganizationBucketMappings(ctx context.Context, arg DeleteOrganizationBucketMappingsParams) error
// Delete organizations not in c_ tables
DeleteOrganizationsNotInList(ctx context.Context, idsToDelete []uuid.UUID) error
GetActiveOrganizations(ctx context.Context) ([]GetActiveOrganizationsRow, error)
GetAdminAPIKeyByHash(ctx context.Context, keyHash string) (AdminApiKey, error)
GetAdminAPIKeyByID(ctx context.Context, apiKeyID uuid.UUID) (AdminApiKey, error)
GetAllAdminAPIKeys(ctx context.Context) ([]AdminApiKey, error)
// Get all our bucket configurations
GetAllBucketConfigurations(ctx context.Context) ([]GetAllBucketConfigurationsRow, error)
// Get all bucket configurations from c_ tables with org mappings
GetAllCBucketData(ctx context.Context) ([]GetAllCBucketDataRow, error)
// Get all API keys from c_ tables
GetAllCOrganizationAPIKeys(ctx context.Context) ([]GetAllCOrganizationAPIKeysRow, error)
GetAllCOrganizationAPIKeysForSync(ctx context.Context) ([]GetAllCOrganizationAPIKeysForSyncRow, error)
// This file contains queries for syncing data from legacy c_ tables (managed externally)
// to our own tables that we control.
// Fetch all organizations from c_ tables
GetAllCOrganizations(ctx context.Context) ([]GetAllCOrganizationsRow, error)
// Legacy table sync operations
GetAllCStorageProfilesForSync(ctx context.Context) ([]GetAllCStorageProfilesForSyncRow, error)
// Get all our API key mappings
GetAllOrganizationAPIKeyMappings(ctx context.Context) ([]GetAllOrganizationAPIKeyMappingsRow, error)
GetAllOrganizationAPIKeys(ctx context.Context) ([]GetAllOrganizationAPIKeysRow, error)
// Get all our organization bucket mappings
GetAllOrganizationBucketMappings(ctx context.Context) ([]GetAllOrganizationBucketMappingsRow, error)
// Fetch all our organizations
GetAllOrganizations(ctx context.Context) ([]GetAllOrganizationsRow, error)
GetBucketByOrganization(ctx context.Context, organizationID uuid.UUID) (string, error)
GetBucketConfiguration(ctx context.Context, bucketName string) (BucketConfiguration, error)
GetBucketConfigurationByName(ctx context.Context, bucketName string) (BucketConfiguration, error)
GetBucketPrefixMappings(ctx context.Context, bucketName string) ([]GetBucketPrefixMappingsRow, error)
GetDefaultOrganizationBucket(ctx context.Context, organizationID uuid.UUID) (GetDefaultOrganizationBucketRow, error)
GetExpiryLastRun(ctx context.Context, arg GetExpiryLastRunParams) (ExpiryRunTracking, error)
GetLongestPrefixMatch(ctx context.Context, arg GetLongestPrefixMatchParams) (GetLongestPrefixMatchRow, error)
GetLowestInstanceOrganizationBucket(ctx context.Context, arg GetLowestInstanceOrganizationBucketParams) (GetLowestInstanceOrganizationBucketRow, error)
// Get config for a specific org and key. Returns NULL if not found.
GetOrgConfig(ctx context.Context, arg GetOrgConfigParams) (json.RawMessage, error)
GetOrganization(ctx context.Context, id uuid.UUID) (Organization, error)
GetOrganizationAPIKeyByHash(ctx context.Context, keyHash string) (GetOrganizationAPIKeyByHashRow, error)
GetOrganizationAPIKeyByID(ctx context.Context, apiKeyID uuid.UUID) (GetOrganizationAPIKeyByIDRow, error)
GetOrganizationBucketByCollector(ctx context.Context, arg GetOrganizationBucketByCollectorParams) (GetOrganizationBucketByCollectorRow, error)
GetOrganizationBucketByInstance(ctx context.Context, arg GetOrganizationBucketByInstanceParams) (GetOrganizationBucketByInstanceRow, error)
GetOrganizationByName(ctx context.Context, name string) (Organization, error)
GetOrganizationExpiry(ctx context.Context, arg GetOrganizationExpiryParams) (OrganizationSignalExpiry, error)
GetOrganizationsByBucket(ctx context.Context, bucketName string) ([]uuid.UUID, error)
GetStorageProfileByCollectorNameUncached(ctx context.Context, organizationID pgtype.UUID) (GetStorageProfileByCollectorNameRow, error)
GetStorageProfileUncached(ctx context.Context, arg GetStorageProfileParams) (GetStorageProfileRow, error)
GetStorageProfilesByBucketNameUncached(ctx context.Context, bucketName string) ([]GetStorageProfilesByBucketNameRow, error)
HasExistingStorageProfiles(ctx context.Context) (bool, error)
ListBucketConfigurations(ctx context.Context) ([]BucketConfiguration, error)
ListBucketPrefixMappings(ctx context.Context) ([]ListBucketPrefixMappingsRow, error)
ListEnabledOrganizations(ctx context.Context) ([]Organization, error)
// List all config keys/values for an org.
ListOrgConfigs(ctx context.Context, organizationID uuid.UUID) ([]ListOrgConfigsRow, error)
ListOrganizationAPIKeysByOrg(ctx context.Context, organizationID uuid.UUID) ([]ListOrganizationAPIKeysByOrgRow, error)
ListOrganizationBucketsByOrg(ctx context.Context, organizationID uuid.UUID) ([]ListOrganizationBucketsByOrgRow, error)
ListOrganizations(ctx context.Context) ([]Organization, error)
UpsertAdminAPIKey(ctx context.Context, arg UpsertAdminAPIKeyParams) (AdminApiKey, error)
UpsertBucketConfiguration(ctx context.Context, arg UpsertBucketConfigurationParams) (BucketConfiguration, error)
UpsertExpiryRunTracking(ctx context.Context, arg UpsertExpiryRunTrackingParams) error
// Insert or update a config value for an org.
UpsertOrgConfig(ctx context.Context, arg UpsertOrgConfigParams) error
UpsertOrganization(ctx context.Context, arg UpsertOrganizationParams) (Organization, error)
UpsertOrganizationAPIKey(ctx context.Context, arg UpsertOrganizationAPIKeyParams) (OrganizationApiKey, error)
UpsertOrganizationAPIKeyMapping(ctx context.Context, arg UpsertOrganizationAPIKeyMappingParams) error
UpsertOrganizationBucket(ctx context.Context, arg UpsertOrganizationBucketParams) error
UpsertOrganizationExpiry(ctx context.Context, arg UpsertOrganizationExpiryParams) error
// Upsert organization
UpsertOrganizationSync(ctx context.Context, arg UpsertOrganizationSyncParams) error
}
type QuerierFull ¶
type QuerierFull = StoreFull
QuerierFull is deprecated, use StoreFull instead
func ConfigDBStore ¶ added in v1.4.0
func ConfigDBStore(ctx context.Context) (QuerierFull, error)
func ConfigDBStoreForAdmin ¶ added in v1.4.0
func ConfigDBStoreForAdmin(ctx context.Context) (QuerierFull, error)
ConfigDBStoreForAdmin connects to ConfigDB with admin-friendly migration checking that warns and continues instead of failing on migration mismatches
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CheckOrgBucketAccess ¶
func (*Queries) ClearBucketConfigurations ¶
func (*Queries) ClearBucketPrefixMappings ¶
func (*Queries) ClearOrganizationAPIKeyMappings ¶
func (*Queries) ClearOrganizationAPIKeys ¶
func (*Queries) ClearOrganizationBuckets ¶
func (*Queries) ClearOrganizations ¶
func (*Queries) CreateAdminAPIKey ¶
func (q *Queries) CreateAdminAPIKey(ctx context.Context, arg CreateAdminAPIKeyParams) (AdminApiKey, error)
func (*Queries) CreateBucketConfiguration ¶
func (q *Queries) CreateBucketConfiguration(ctx context.Context, arg CreateBucketConfigurationParams) (BucketConfiguration, error)
func (*Queries) CreateBucketPrefixMapping ¶
func (q *Queries) CreateBucketPrefixMapping(ctx context.Context, arg CreateBucketPrefixMappingParams) (BucketPrefixMapping, error)
func (*Queries) CreateOrganizationAPIKey ¶
func (q *Queries) CreateOrganizationAPIKey(ctx context.Context, arg CreateOrganizationAPIKeyParams) (OrganizationApiKey, error)
func (*Queries) CreateOrganizationAPIKeyMapping ¶
func (q *Queries) CreateOrganizationAPIKeyMapping(ctx context.Context, arg CreateOrganizationAPIKeyMappingParams) (OrganizationApiKeyMapping, error)
func (*Queries) CreateOrganizationBucket ¶
func (q *Queries) CreateOrganizationBucket(ctx context.Context, arg CreateOrganizationBucketParams) (OrganizationBucket, error)
func (*Queries) DeleteAdminAPIKey ¶
func (*Queries) DeleteBucketConfiguration ¶
func (*Queries) DeleteBucketPrefixMapping ¶
func (*Queries) DeleteOrgConfig ¶ added in v1.7.0
func (q *Queries) DeleteOrgConfig(ctx context.Context, arg DeleteOrgConfigParams) error
Delete a specific config for an org.
func (*Queries) DeleteOrganization ¶
func (*Queries) DeleteOrganizationAPIKey ¶
func (*Queries) DeleteOrganizationAPIKeyMapping ¶ added in v1.4.0
func (*Queries) DeleteOrganizationAPIKeyMappingByHash ¶ added in v1.4.0
func (q *Queries) DeleteOrganizationAPIKeyMappingByHash(ctx context.Context, arg DeleteOrganizationAPIKeyMappingByHashParams) error
Delete API key mapping by hash
func (*Queries) DeleteOrganizationBucket ¶ added in v1.4.0
func (q *Queries) DeleteOrganizationBucket(ctx context.Context, arg DeleteOrganizationBucketParams) error
func (*Queries) DeleteOrganizationBucketMappings ¶ added in v1.4.0
func (q *Queries) DeleteOrganizationBucketMappings(ctx context.Context, arg DeleteOrganizationBucketMappingsParams) error
Delete organization bucket mappings not in c_ tables
func (*Queries) DeleteOrganizationsNotInList ¶ added in v1.4.0
Delete organizations not in c_ tables
func (*Queries) GetActiveOrganizations ¶ added in v1.4.1
func (q *Queries) GetActiveOrganizations(ctx context.Context) ([]GetActiveOrganizationsRow, error)
func (*Queries) GetAdminAPIKeyByHash ¶
func (*Queries) GetAdminAPIKeyByID ¶
func (*Queries) GetAllAdminAPIKeys ¶
func (q *Queries) GetAllAdminAPIKeys(ctx context.Context) ([]AdminApiKey, error)
func (*Queries) GetAllBucketConfigurations ¶ added in v1.4.0
func (q *Queries) GetAllBucketConfigurations(ctx context.Context) ([]GetAllBucketConfigurationsRow, error)
Get all our bucket configurations
func (*Queries) GetAllCBucketData ¶ added in v1.4.0
func (q *Queries) GetAllCBucketData(ctx context.Context) ([]GetAllCBucketDataRow, error)
Get all bucket configurations from c_ tables with org mappings
func (*Queries) GetAllCOrganizationAPIKeys ¶ added in v1.4.0
func (q *Queries) GetAllCOrganizationAPIKeys(ctx context.Context) ([]GetAllCOrganizationAPIKeysRow, error)
Get all API keys from c_ tables
func (*Queries) GetAllCOrganizationAPIKeysForSync ¶
func (q *Queries) GetAllCOrganizationAPIKeysForSync(ctx context.Context) ([]GetAllCOrganizationAPIKeysForSyncRow, error)
func (*Queries) GetAllCOrganizations ¶ added in v1.4.0
func (q *Queries) GetAllCOrganizations(ctx context.Context) ([]GetAllCOrganizationsRow, error)
This file contains queries for syncing data from legacy c_ tables (managed externally) to our own tables that we control. Fetch all organizations from c_ tables
func (*Queries) GetAllCStorageProfilesForSync ¶
func (q *Queries) GetAllCStorageProfilesForSync(ctx context.Context) ([]GetAllCStorageProfilesForSyncRow, error)
Legacy table sync operations
func (*Queries) GetAllOrganizationAPIKeyMappings ¶ added in v1.4.0
func (q *Queries) GetAllOrganizationAPIKeyMappings(ctx context.Context) ([]GetAllOrganizationAPIKeyMappingsRow, error)
Get all our API key mappings
func (*Queries) GetAllOrganizationAPIKeys ¶
func (q *Queries) GetAllOrganizationAPIKeys(ctx context.Context) ([]GetAllOrganizationAPIKeysRow, error)
func (*Queries) GetAllOrganizationBucketMappings ¶ added in v1.4.0
func (q *Queries) GetAllOrganizationBucketMappings(ctx context.Context) ([]GetAllOrganizationBucketMappingsRow, error)
Get all our organization bucket mappings
func (*Queries) GetAllOrganizations ¶ added in v1.4.0
func (q *Queries) GetAllOrganizations(ctx context.Context) ([]GetAllOrganizationsRow, error)
Fetch all our organizations
func (*Queries) GetBucketByOrganization ¶
func (*Queries) GetBucketConfiguration ¶
func (*Queries) GetBucketConfigurationByName ¶ added in v1.4.0
func (*Queries) GetBucketPrefixMappings ¶ added in v1.4.0
func (*Queries) GetDefaultOrganizationBucket ¶
func (*Queries) GetExpiryLastRun ¶ added in v1.4.1
func (q *Queries) GetExpiryLastRun(ctx context.Context, arg GetExpiryLastRunParams) (ExpiryRunTracking, error)
func (*Queries) GetLongestPrefixMatch ¶
func (q *Queries) GetLongestPrefixMatch(ctx context.Context, arg GetLongestPrefixMatchParams) (GetLongestPrefixMatchRow, error)
func (*Queries) GetLowestInstanceOrganizationBucket ¶ added in v1.3.0
func (q *Queries) GetLowestInstanceOrganizationBucket(ctx context.Context, arg GetLowestInstanceOrganizationBucketParams) (GetLowestInstanceOrganizationBucketRow, error)
func (*Queries) GetOrgConfig ¶ added in v1.7.0
func (q *Queries) GetOrgConfig(ctx context.Context, arg GetOrgConfigParams) (json.RawMessage, error)
Get config for a specific org and key. Returns NULL if not found.
func (*Queries) GetOrganization ¶
func (*Queries) GetOrganizationAPIKeyByHash ¶
func (*Queries) GetOrganizationAPIKeyByID ¶
func (*Queries) GetOrganizationBucketByCollector ¶
func (q *Queries) GetOrganizationBucketByCollector(ctx context.Context, arg GetOrganizationBucketByCollectorParams) (GetOrganizationBucketByCollectorRow, error)
func (*Queries) GetOrganizationBucketByInstance ¶
func (q *Queries) GetOrganizationBucketByInstance(ctx context.Context, arg GetOrganizationBucketByInstanceParams) (GetOrganizationBucketByInstanceRow, error)
func (*Queries) GetOrganizationByName ¶
func (*Queries) GetOrganizationExpiry ¶ added in v1.4.1
func (q *Queries) GetOrganizationExpiry(ctx context.Context, arg GetOrganizationExpiryParams) (OrganizationSignalExpiry, error)
func (*Queries) GetOrganizationsByBucket ¶
func (*Queries) GetStorageProfileByCollectorNameUncached ¶
func (*Queries) GetStorageProfileUncached ¶
func (q *Queries) GetStorageProfileUncached(ctx context.Context, arg GetStorageProfileParams) (GetStorageProfileRow, error)
func (*Queries) GetStorageProfilesByBucketNameUncached ¶
func (*Queries) HasExistingStorageProfiles ¶
func (*Queries) ListBucketConfigurations ¶
func (q *Queries) ListBucketConfigurations(ctx context.Context) ([]BucketConfiguration, error)
func (*Queries) ListBucketPrefixMappings ¶
func (q *Queries) ListBucketPrefixMappings(ctx context.Context) ([]ListBucketPrefixMappingsRow, error)
func (*Queries) ListEnabledOrganizations ¶
func (q *Queries) ListEnabledOrganizations(ctx context.Context) ([]Organization, error)
func (*Queries) ListOrgConfigs ¶ added in v1.7.0
func (q *Queries) ListOrgConfigs(ctx context.Context, organizationID uuid.UUID) ([]ListOrgConfigsRow, error)
List all config keys/values for an org.
func (*Queries) ListOrganizationAPIKeysByOrg ¶ added in v1.4.0
func (*Queries) ListOrganizationBucketsByOrg ¶ added in v1.4.0
func (*Queries) ListOrganizations ¶
func (q *Queries) ListOrganizations(ctx context.Context) ([]Organization, error)
func (*Queries) UpsertAdminAPIKey ¶
func (q *Queries) UpsertAdminAPIKey(ctx context.Context, arg UpsertAdminAPIKeyParams) (AdminApiKey, error)
func (*Queries) UpsertBucketConfiguration ¶
func (q *Queries) UpsertBucketConfiguration(ctx context.Context, arg UpsertBucketConfigurationParams) (BucketConfiguration, error)
func (*Queries) UpsertExpiryRunTracking ¶ added in v1.4.1
func (q *Queries) UpsertExpiryRunTracking(ctx context.Context, arg UpsertExpiryRunTrackingParams) error
func (*Queries) UpsertOrgConfig ¶ added in v1.7.0
func (q *Queries) UpsertOrgConfig(ctx context.Context, arg UpsertOrgConfigParams) error
Insert or update a config value for an org.
func (*Queries) UpsertOrganization ¶
func (q *Queries) UpsertOrganization(ctx context.Context, arg UpsertOrganizationParams) (Organization, error)
func (*Queries) UpsertOrganizationAPIKey ¶
func (q *Queries) UpsertOrganizationAPIKey(ctx context.Context, arg UpsertOrganizationAPIKeyParams) (OrganizationApiKey, error)
func (*Queries) UpsertOrganizationAPIKeyMapping ¶
func (q *Queries) UpsertOrganizationAPIKeyMapping(ctx context.Context, arg UpsertOrganizationAPIKeyMappingParams) error
func (*Queries) UpsertOrganizationBucket ¶
func (q *Queries) UpsertOrganizationBucket(ctx context.Context, arg UpsertOrganizationBucketParams) error
func (*Queries) UpsertOrganizationExpiry ¶ added in v1.4.1
func (q *Queries) UpsertOrganizationExpiry(ctx context.Context, arg UpsertOrganizationExpiryParams) error
func (*Queries) UpsertOrganizationSync ¶ added in v1.4.0
func (q *Queries) UpsertOrganizationSync(ctx context.Context, arg UpsertOrganizationSyncParams) error
Upsert organization
type Store ¶
type Store struct {
*Queries
// contains filtered or unexported fields
}
Store provides all functions to execute db queries and transactions
func (*Store) AddOrganizationBucket ¶ added in v1.4.0
func (store *Store) AddOrganizationBucket(ctx context.Context, orgID uuid.UUID, bucketName string, instanceNum int16, collectorName string) error
AddOrganizationBucket adds a bucket to an organization in a transaction
func (*Store) Close ¶ added in v1.8.0
func (s *Store) Close()
Close stops the cache background goroutines and closes the connection pool.
func (*Store) CreateBucketPrefixMappingForOrg ¶ added in v1.4.0
func (store *Store) CreateBucketPrefixMappingForOrg(ctx context.Context, bucketName string, orgID uuid.UUID, pathPrefix string, signal string) (*BucketPrefixMapping, error)
CreateBucketPrefixMappingForOrg creates a bucket prefix mapping in a transaction
func (*Store) CreateOrganizationAPIKeyWithMapping ¶ added in v1.4.0
func (store *Store) CreateOrganizationAPIKeyWithMapping(ctx context.Context, params CreateOrganizationAPIKeyParams, orgID uuid.UUID) (*OrganizationApiKey, error)
CreateOrganizationAPIKeyWithMapping creates an API key and its organization mapping in a transaction
func (*Store) DeleteOrganizationAPIKeyWithMappings ¶ added in v1.4.0
func (store *Store) DeleteOrganizationAPIKeyWithMappings(ctx context.Context, keyID uuid.UUID) error
DeleteOrganizationAPIKeyWithMappings deletes an API key and its mappings in a transaction
func (*Store) GetStorageProfile ¶
func (store *Store) GetStorageProfile(ctx context.Context, params GetStorageProfileParams) (GetStorageProfileRow, error)
func (*Store) GetStorageProfileByCollectorName ¶
func (*Store) GetStorageProfilesByBucketName ¶
type StoreFull ¶ added in v1.4.0
type StoreFull interface {
Querier
GetStorageProfile(ctx context.Context, arg GetStorageProfileParams) (GetStorageProfileRow, error)
GetStorageProfileByCollectorName(ctx context.Context, organizationID uuid.UUID) (GetStorageProfileByCollectorNameRow, error)
GetStorageProfilesByBucketName(ctx context.Context, bucketName string) ([]GetStorageProfilesByBucketNameRow, error)
// High-level transactional operations
CreateOrganizationAPIKeyWithMapping(ctx context.Context, params CreateOrganizationAPIKeyParams, orgID uuid.UUID) (*OrganizationApiKey, error)
DeleteOrganizationAPIKeyWithMappings(ctx context.Context, keyID uuid.UUID) error
AddOrganizationBucket(ctx context.Context, orgID uuid.UUID, bucketName string, instanceNum int16, collectorName string) error
CreateBucketPrefixMappingForOrg(ctx context.Context, bucketName string, orgID uuid.UUID, pathPrefix string, signal string) (*BucketPrefixMapping, error)
// Close stops background goroutines and closes the connection pool.
Close()
}
type UpsertAdminAPIKeyParams ¶
type UpsertBucketConfigurationParams ¶
type UpsertBucketConfigurationParams struct {
BucketName string `json:"bucket_name"`
CloudProvider string `json:"cloud_provider"`
Region string `json:"region"`
Endpoint *string `json:"endpoint"`
Role *string `json:"role"`
UsePathStyle bool `json:"use_path_style"`
InsecureTls bool `json:"insecure_tls"`
}
type UpsertExpiryRunTrackingParams ¶ added in v1.4.1
type UpsertOrgConfigParams ¶ added in v1.7.0
type UpsertOrgConfigParams struct {
OrganizationID uuid.UUID `json:"organization_id"`
Key string `json:"key"`
Value json.RawMessage `json:"value"`
}
type UpsertOrganizationExpiryParams ¶ added in v1.4.1
Source Files
¶
- admin_api_keys.sql.go
- bucket_management.sql.go
- c_tables.sql.go
- connect.go
- db.go
- doc.go
- expiry.sql.go
- models.go
- org_api_keys.sql.go
- org_config.sql.go
- organizations.sql.go
- pool.go
- querier.go
- querier_upscale.go
- storage_profile_cache.go
- store.go
- store_bucket_prefix_mappings.go
- store_org_api_keys.go
- store_org_buckets.go
- sync_chris_tables.sql.go