config

package
v0.1.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Nested

func Nested(target interface{}, fieldRules ...*validation.FieldRules) *validation.FieldRules

Types

type APIEndpoint

type APIEndpoint struct {
	Path     string         `yaml:"path"`
	Methods  []MethodDetail `yaml:"methods"`
	Resource string         `yaml:"resource"`
}

type Config

type Config struct {
	Endpoint struct {
		Management string `yaml:"management" env:"Management"`
		Check_REST string `yaml:"check_rest" env:"Check_REST"`
		Check_GRPC string `yaml:"check_grpc" env:"Check_GRPC"`
	} `yaml:"endpoint"`
	Auth struct {
		JWKS string `yaml:"jwks" env:"JWKS"`
	} `yaml:"auth"`
	Database struct {
		URL      string `yaml:"url" env:"URL,secret"`
		Name     string `yaml:"name" env:"Name,secret"`
		User     string `yaml:"user" env:"User,secret"`
		Password string `yaml:"password" env:"Password,secret"`
	} `yaml:"database"`
	RootOrganization struct {
		Name            string `yaml:"name" env:"Name"`
		AdminIdentifier string `yaml:"admin_identfier" env:"AdminIdentifier"`
		AdminName       string `yaml:"admin_name" env:"AdminName"`
		AdminRoleName   string `yaml:"admin_role_name" env:"AdminRoleName"`
	} `yaml:"root_organization"`
	SyetemResources struct {
		Organizations []string `yaml:"organizations"`
		Users         []string `yaml:"users"`
		Roles         []string `yaml:"roles"`
		Groups        []string `yaml:"groups"`
		Resources     []string `yaml:"resources"`
		Polices       []string `yaml:"policies"`
	} `yaml:"system_resources"`
	APIEndpoints []APIEndpoint `yaml:"endpoints"`
}

func Load

func Load(file string) (*Config, error)

Load the configuration from a file.

func (Config) Validate

func (c Config) Validate() error

Validate the configuration values.

type MethodDetail

type MethodDetail struct {
	Method              string   `yaml:"method"`
	RequiredPermissions []string `yaml:"required_permissions"`
}

Jump to

Keyboard shortcuts

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