config

package
v1.206.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

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

	// 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 ValidateBucketName added in v1.187.0

func ValidateBucketName(name string) error

func ValidateFunctionSlug added in v1.187.0

func ValidateFunctionSlug(slug string) error

Types

type AddressFamily

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

type BucketConfig added in v1.187.0

type BucketConfig map[string]bucket

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 ConfigEditor

type ConfigEditor func(*config)

func WithHostname

func WithHostname(hostname string) ConfigEditor

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 added in v1.187.0

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 PoolMode

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

type RequestPolicy

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

Jump to

Keyboard shortcuts

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