config

package
v2.0.5-0...-bd0d250 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Pg15Image = "supabase/postgres:15.6.1.143"

	// Append to JobImages when adding new dependencies below
	DifferImage  = "supabase/pgadmin-schema-diff:cli-0.0.5"
	MigraImage   = "supabase/migra:3.0.1663481299"
	PgProveImage = "supabase/pg_prove:3.36"
)

Variables

View Source
var ServiceImages = []string{
	gotrueImage,
	realtimeImage,
	storageImage,
	imageProxyImage,
	kongImage,
	inbucketImage,
	postgrestImage,
	pgmetaImage,
	studioImage,
	edgeRuntimeImage,
	logflareImage,
	vectorImage,
	supavisorImage,
}

Functions

func NewConfig

func NewConfig(editors ...ConfigEditor) config

func NewPathBuilder

func NewPathBuilder(configPath string) pathBuilder

func ToTomlBytes

func ToTomlBytes(config any) ([]byte, error)

func ValidateBucketName

func ValidateBucketName(name string) error

func ValidateFunctionSlug

func ValidateFunctionSlug(slug string) error

Types

type AddressFamily

type AddressFamily string
const (
	AddressIPv6 AddressFamily = "IPv6"
	AddressIPv4 AddressFamily = "IPv4"
)

type BucketConfig

type BucketConfig map[string]bucket

type ConfigEditor

type ConfigEditor func(*config)

func WithHostname

func WithHostname(hostname string) ConfigEditor

type ConfigUpdater

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

func NewConfigUpdater

func NewConfigUpdater(client v1API.ClientWithResponses) ConfigUpdater

func (*ConfigUpdater) UpdateApiConfig

func (u *ConfigUpdater) UpdateApiConfig(ctx context.Context, projectRef string, c api, filter ...func(string) bool) error

func (*ConfigUpdater) UpdateAuthConfig

func (u *ConfigUpdater) UpdateAuthConfig(ctx context.Context, projectRef string, c auth, filter ...func(string) bool) error

func (*ConfigUpdater) UpdateDbConfig

func (u *ConfigUpdater) UpdateDbConfig(ctx context.Context, projectRef string, c db, filter ...func(string) bool) error

func (*ConfigUpdater) UpdateDbSettingsConfig

func (u *ConfigUpdater) UpdateDbSettingsConfig(ctx context.Context, projectRef string, s settings, filter ...func(string) bool) error

func (*ConfigUpdater) UpdateExperimentalConfig

func (u *ConfigUpdater) UpdateExperimentalConfig(ctx context.Context, projectRef string, exp experimental, filter ...func(string) bool) error

func (*ConfigUpdater) UpdateRemoteConfig

func (u *ConfigUpdater) UpdateRemoteConfig(ctx context.Context, remote baseConfig, filter ...func(string) bool) error

func (*ConfigUpdater) UpdateStorageConfig

func (u *ConfigUpdater) UpdateStorageConfig(ctx context.Context, projectRef string, c storage, filter ...func(string) bool) error

type CustomClaims

type CustomClaims struct {
	// Overrides Issuer to maintain json order when marshalling
	Issuer string `json:"iss,omitempty"`
	Ref    string `json:"ref,omitempty"`
	Role   string `json:"role"`
	jwt.RegisteredClaims
}

func (CustomClaims) NewToken

func (c CustomClaims) NewToken() *jwt.Token

type FunctionConfig

type FunctionConfig map[string]function

We follow these rules when adding new config:

  1. Update init_config.toml (and init_config.test.toml) with the new key, default value, and comments to explain usage.
  2. Update config struct with new field and toml tag (spelled in snake_case).
  3. Add custom field validations to LoadConfigFS function for eg. integer range checks.

If you are adding new user defined secrets, such as OAuth provider secret, the default value in init_config.toml should be an env var substitution. For example,

> secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)"

If you are adding an internal config or secret that doesn't need to be overridden by the user, exclude the field from toml serialization. For example,

type auth struct {
	AnonKey string `toml:"-" mapstructure:"anon_key"`
}

Use `mapstructure:"anon_key"` tag only if you want inject values from a predictable environment variable, such as SUPABASE_AUTH_ANON_KEY.

Default values for internal configs should be added to `var Config` initializer.

type LogflareBackend

type LogflareBackend string
const (
	LogflarePostgres LogflareBackend = "postgres"
	LogflareBigQuery LogflareBackend = "bigquery"
)

type PasswordRequirements

type PasswordRequirements string
const (
	NoRequirements                 PasswordRequirements = ""
	LettersDigits                  PasswordRequirements = "letters_digits"
	LowerUpperLettersDigits        PasswordRequirements = "lower_upper_letters_digits"
	LowerUpperLettersDigitsSymbols PasswordRequirements = "lower_upper_letters_digits_symbols"
)

type PoolMode

type PoolMode string
const (
	TransactionMode PoolMode = "transaction"
	SessionMode     PoolMode = "session"
)

type RequestPolicy

type RequestPolicy string
const (
	PolicyPerWorker RequestPolicy = "per_worker"
	PolicyOneshot   RequestPolicy = "oneshot"
)

type SessionReplicationRole

type SessionReplicationRole string
const (
	SessionReplicationRoleOrigin  SessionReplicationRole = "origin"
	SessionReplicationRoleReplica SessionReplicationRole = "replica"
	SessionReplicationRoleLocal   SessionReplicationRole = "local"
)

Jump to

Keyboard shortcuts

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