config

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actions

type Actions []string

The Allowed Http-Methods for this resource. If empty, all methods are allowed. Allowed aliases are "read-only" (GET, HEAD) and "read-change" (GET, HEAD, PATCH).

func (Actions) GetAllowedList

func (a Actions) GetAllowedList() []string

type LMSConfig

type LMSConfig struct {
	Enabled  bool   `json:"enabled"`
	BasePath string `json:"basePath"`
}

type OpenapiConfig

type OpenapiConfig struct {
	Title       string          `json:"name"`
	Description string          `json:"description"`
	Version     string          `json:"version"`
	Servers     []OpenapiServer `json:"servers"`
}

type OpenapiServer

type OpenapiServer struct {
	URL         string `json:"url"`
	Description string `json:"description"`
}

type PProfConfig

type PProfConfig struct {
	Enabled bool `json:"enabled"`
	Port    int  `json:"port"`
}

type PredefinedConfig

type PredefinedConfig struct {
	Ref     string         `json:"ref"`
	Name    string         `json:"name"`
	Filters []store.Filter `json:"filters,omitempty"`
	Patches []store.Patch  `json:"patches,omitempty"`
}

type ResourceConfig

type ResourceConfig struct {
	Id           string    `json:"id"`
	Group        string    `json:"group"`
	Version      string    `json:"version"`
	Resource     string    `json:"resource"`
	AllowedSorts []string  `yaml:"allowedSorts" json:"allowedSorts"`
	Owns         []string  `json:"owns"`
	References   []string  `json:"references"`
	Secrets      []string  `json:"secrets"`
	Actions      Actions   `json:"actions"`
	Store        StoreOpts `json:"store"`
}

type SecurityConfig

type SecurityConfig struct {
	Enabled        bool `json:"enabled"`
	LMS            LMSConfig
	TrustedIssuers []string `yaml:"trustedIssuers" json:"trustedIssuers"`
	DefaultScope   string   `yaml:"defaultScope" json:"defaultScope"`
	ScopePrefix    string   `yaml:"scopePrefix" json:"scopePrefix"`
}

type ServerConfig

type ServerConfig struct {
	Address  string `json:"address"`
	BasePath string `json:"basepath"`

	AddGroupToPath bool               `yaml:"addGroupToPath" json:"addGroupToPath"`
	Resources      []ResourceConfig   `json:"resources"`
	Predefined     []PredefinedConfig `json:"predefined"`

	Openapi  OpenapiConfig  `json:"openapi"`
	Security SecurityConfig `json:"security"`

	Tree  TreeConfig  `json:"tree"`
	Pprof PProfConfig `json:"pprof"`
}

func ReadConfig

func ReadConfig(filepath string) (*ServerConfig, error)

func (*ServerConfig) BuildServer

func (c *ServerConfig) BuildServer(ctx context.Context, dynamicClient dynamic.Interface, log logr.Logger) (*server.Server, error)

type StoreOpts

type StoreOpts struct {
	// DisableInformerCache if true, the informer will not use a local cache and will directly forward events to the event handler.
	DisableInformerCache bool `json:"disableInformerCache" yaml:"disableInformerCache"`
	// DatabaseFilepath is the filepath where the badger database will be stored. If empty, the database will be in-memory only.
	DatabaseFilepath string `json:"databaseFilepath" yaml:"databaseFilepath"`
	// OptimizeMemoryUsage if true, the database will be optimized for memory usage.
	OptimizeMemoryUsage bool `json:"optimizeMemoryUsage" yaml:"optimizeMemoryUsage"`
}

type TreeConfig

type TreeConfig struct {
	Enabled bool `json:"enabled"`
}

Jump to

Keyboard shortcuts

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