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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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