Documentation ¶
Index ¶
- Constants
- Variables
- func NewConfig(editors ...ConfigEditor) config
- func NewPathBuilder(configPath string) pathBuilder
- func ToTomlBytes(config any) ([]byte, error)
- func ValidateBucketName(name string) error
- func ValidateFunctionSlug(slug string) error
- type AddressFamily
- type BucketConfig
- type ConfigEditor
- type ConfigUpdater
- type CustomClaims
- type FunctionConfig
- type LogflareBackend
- type PoolMode
- type RequestPolicy
Constants ¶
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 ¶
var JobImages = []string{ DifferImage, MigraImage, PgProveImage, }
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 ¶ added in v1.207.0
func ValidateBucketName ¶ added in v1.187.0
func ValidateFunctionSlug ¶ added in v1.187.0
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:
- Update init_config.toml (and init_config.test.toml) with the new key, default value, and comments to explain usage.
- Update config struct with new field and toml tag (spelled in snake_case).
- 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 ConfigUpdater ¶ added in v1.207.0
type ConfigUpdater struct {
// contains filtered or unexported fields
}
func NewConfigUpdater ¶ added in v1.207.0
func NewConfigUpdater(client v1API.ClientWithResponses) ConfigUpdater
func (*ConfigUpdater) UpdateApiConfig ¶ added in v1.207.0
func (u *ConfigUpdater) UpdateApiConfig(ctx context.Context, projectRef string, c api) error
func (*ConfigUpdater) UpdateRemoteConfig ¶ added in v1.207.0
func (u *ConfigUpdater) UpdateRemoteConfig(ctx context.Context, remote baseConfig) 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 ¶ added in v1.187.0
type FunctionConfig map[string]function
We follow these rules when adding new config:
- Update init_config.toml (and init_config.test.toml) with the new key, default value, and comments to explain usage.
- Update config struct with new field and toml tag (spelled in snake_case).
- 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 RequestPolicy ¶
type RequestPolicy string
const ( PolicyPerWorker RequestPolicy = "per_worker" PolicyOneshot RequestPolicy = "oneshot" )