apiconfig

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig

type ApiConfig struct {
	Rest    RestConfig    `json:"rest"`
	GraphQL GraphQLConfig `json:"graphql"`
}

ApiConfig is the top-level config persisted and served by the admin API.

func DefaultApiConfig

func DefaultApiConfig() ApiConfig

DefaultApiConfig returns the out-of-the-box API configuration.

type FileStore

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

FileStore persists ApiConfig as JSON in a local file. If the file does not exist, DefaultApiConfig() is returned.

func NewFileStore

func NewFileStore(path string) *FileStore

NewFileStore creates a FileStore that reads/writes path.

func (*FileStore) Get

func (s *FileStore) Get(_ context.Context) (ApiConfig, error)

func (*FileStore) Set

func (s *FileStore) Set(_ context.Context, cfg ApiConfig) error

type GraphQLConfig

type GraphQLConfig struct {
	Introspection bool `json:"introspection"`
	MaxQueryDepth int  `json:"max_query_depth"`
	MaxRows       int  `json:"max_rows"`
}

GraphQLConfig holds runtime configuration for the pg_graphql proxy.

type RestConfig

type RestConfig struct {
	Schema      string                          `json:"schema"`
	MaxRows     int                             `json:"max_rows"`
	CacheMaxTTL int                             `json:"cache_max_ttl"`
	CacheTables map[string]RestTableCacheConfig `json:"cache_tables"`
}

RestConfig holds runtime configuration for the PostgREST proxy.

func (RestConfig) TableCacheAllowed

func (r RestConfig) TableCacheAllowed(table string) (RestTableCacheConfig, bool)

TableCacheAllowed reports whether server REST cache may run for table.

type RestTableCacheConfig

type RestTableCacheConfig struct {
	Enabled     bool `json:"enabled"`
	AllowPublic bool `json:"allow_public"`
}

RestTableCacheConfig controls server-side REST GET caching for one table.

type Store

type Store interface {
	Get(ctx context.Context) (ApiConfig, error)
	Set(ctx context.Context, cfg ApiConfig) error
}

Store is the interface for reading and writing ApiConfig.

Jump to

Keyboard shortcuts

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