bootstrap

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SupportedVersion = 2

Variables

This section is empty.

Functions

func ImportFromYAML

func ImportFromYAML(ctx context.Context, filePath string, configDBPool *pgxpool.Pool) error

ImportFromYAML imports configuration from a YAML file into the database

Types

type AdminAPIKey

type AdminAPIKey struct {
	ID          *uuid.UUID `yaml:"id,omitempty" json:"id,omitempty"`
	KeyHash     *string    `yaml:"key_hash,omitempty" json:"key_hash,omitempty"` // Will be computed from Key
	Key         string     `yaml:"key" json:"key"`                               // Plaintext for import only
	Name        string     `yaml:"name" json:"name"`
	Description *string    `yaml:"description,omitempty" json:"description,omitempty"`
}

AdminAPIKey matches admin_api_keys table

type BootstrapConfig

type BootstrapConfig struct {
	Version                   int                         `yaml:"version" json:"version"`
	BucketConfigurations      []BucketConfiguration       `yaml:"bucket_configurations,omitempty" json:"bucket_configurations,omitempty"`
	OrganizationBuckets       []OrganizationBucket        `yaml:"organization_buckets,omitempty" json:"organization_buckets,omitempty"`
	BucketPrefixMappings      []BucketPrefixMapping       `yaml:"bucket_prefix_mappings,omitempty" json:"bucket_prefix_mappings,omitempty"`
	AdminAPIKeys              []AdminAPIKey               `yaml:"admin_api_keys,omitempty" json:"admin_api_keys,omitempty"`
	OrganizationAPIKeys       []OrganizationAPIKey        `yaml:"organization_api_keys,omitempty" json:"organization_api_keys,omitempty"`
	OrganizationAPIKeyMapping []OrganizationAPIKeyMapping `yaml:"organization_api_key_mappings,omitempty" json:"organization_api_key_mappings,omitempty"`
}

BootstrapConfig represents the YAML structure for one-time import

type BucketConfiguration

type BucketConfiguration struct {
	ID            *uuid.UUID `yaml:"id,omitempty" json:"id,omitempty"`
	BucketName    string     `yaml:"bucket_name" json:"bucket_name"`
	CloudProvider string     `yaml:"cloud_provider" json:"cloud_provider"`
	Region        string     `yaml:"region" json:"region"`
	Endpoint      *string    `yaml:"endpoint,omitempty" json:"endpoint,omitempty"`
	Role          *string    `yaml:"role,omitempty" json:"role,omitempty"`
}

BucketConfiguration matches bucket_configurations table

type BucketPrefixMapping

type BucketPrefixMapping struct {
	ID             *uuid.UUID `yaml:"id,omitempty" json:"id,omitempty"`
	BucketID       uuid.UUID  `yaml:"bucket_id" json:"bucket_id"`
	OrganizationID uuid.UUID  `yaml:"organization_id" json:"organization_id"`
	PathPrefix     string     `yaml:"path_prefix" json:"path_prefix"`
	Signal         string     `yaml:"signal" json:"signal"` // logs, metrics, traces
}

BucketPrefixMapping matches bucket_prefix_mappings table

type OrganizationAPIKey

type OrganizationAPIKey struct {
	ID          *uuid.UUID `yaml:"id,omitempty" json:"id,omitempty"`
	KeyHash     *string    `yaml:"key_hash,omitempty" json:"key_hash,omitempty"` // Will be computed from Key
	Key         string     `yaml:"key" json:"key"`                               // Plaintext for import only
	Name        string     `yaml:"name" json:"name"`
	Description *string    `yaml:"description,omitempty" json:"description,omitempty"`
}

OrganizationAPIKey matches organization_api_keys table

type OrganizationAPIKeyMapping

type OrganizationAPIKeyMapping struct {
	ID             *uuid.UUID `yaml:"id,omitempty" json:"id,omitempty"`
	APIKeyID       uuid.UUID  `yaml:"api_key_id" json:"api_key_id"`
	OrganizationID uuid.UUID  `yaml:"organization_id" json:"organization_id"`
}

OrganizationAPIKeyMapping matches organization_api_key_mappings table

type OrganizationBucket

type OrganizationBucket struct {
	ID             *uuid.UUID `yaml:"id,omitempty" json:"id,omitempty"`
	OrganizationID uuid.UUID  `yaml:"organization_id" json:"organization_id"`
	BucketID       uuid.UUID  `yaml:"bucket_id" json:"bucket_id"`
	InstanceNum    *int16     `yaml:"instance_num,omitempty" json:"instance_num,omitempty"`
	CollectorName  *string    `yaml:"collector_name,omitempty" json:"collector_name,omitempty"`
}

OrganizationBucket matches organization_buckets table

Jump to

Keyboard shortcuts

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