Documentation
¶
Index ¶
- type Address
- type Command
- type Config
- type Core
- type Database
- type DriverConfig
- type ErrKeyNotFound
- type FieldByIndex
- type FieldByKey
- type GRPC
- type HTTP
- type Interceptor
- type InterceptorFunc
- type Log
- type Lookuper
- type Serverless
- type Service
- type ServiceFunc
- type ServicesConfig
- type Shared
- type Vars
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address string
Address is the data structure holding an address.
type Command ¶
type Command interface {
// contains filtered or unexported methods
}
Command is the command to execute after parsing the template.
type Config ¶
type Config struct {
GRPC *GRPC `default:"{}" key:"grpc" mapstructure:"-"`
HTTP *HTTP `default:"{}" key:"http" mapstructure:"-"`
Serverless *Serverless `default:"{}" key:"serverless" mapstructure:"-"`
Log *Log `default:"{}" key:"log" mapstructure:"log" template:"-"`
Core *Core `default:"{}" key:"core" mapstructure:"core" template:"-"`
Vars Vars `default:"{}" key:"vars" mapstructure:"vars" template:"-"`
}
Config holds the reva configuration.
func (*Config) ApplyTemplates ¶
ApplyTemplates applies the templates defined in the configuration, replacing the template string with the value pointed by the given key.
func (*Config) Lookup ¶
Lookup gets the value associated to the given key in the config. The key is in the form <subkey1>.<subkey2>[<index>], allowing accessing recursively the config on subfields, in case of maps or structs or types implementing the Getter interface, or elements in a list by the given index.
type Core ¶
type Core struct {
MaxCPUs string `key:"max_cpus" mapstructure:"max_cpus"`
ConfigDumpFile string `key:"config_dump_file" mapstructure:"config_dump_file"`
TracingEnabled bool `default:"true" key:"tracing_enabled" mapstructure:"tracing_enabled"`
TracingEndpoint string `default:"localhost:6831" key:"tracing_endpoint" mapstructure:"tracing_endpoint"`
TracingCollector string `key:"tracing_collector" mapstructure:"tracing_collector"`
TracingServiceName string `key:"tracing_service_name" mapstructure:"tracing_service_name"`
TracingService string `key:"tracing_service" mapstructure:"tracing_service"`
}
Core holds the core configuration.
type DriverConfig ¶
type DriverConfig struct {
Address Address `key:"address"`
Network string `key:"network"`
Label string `key:"-"`
Config map[string]any `key:",squash"` // this must be at the bottom!
}
DriverConfig holds the configuration for a driver.
type ErrKeyNotFound ¶
type ErrKeyNotFound struct {
Key string
}
ErrKeyNotFound is the error returned when a key does not exist in the configuration.
func (ErrKeyNotFound) Error ¶
func (e ErrKeyNotFound) Error() string
Error returns a string representation of the ErrKeyNotFound error.
type FieldByIndex ¶
type FieldByIndex struct{ Index int }
FieldByIndex instructs the template runner to get a field by an index.
type FieldByKey ¶
type FieldByKey struct{ Key string }
FieldByKey instructs the template runner to get a field by a key.
type GRPC ¶
type GRPC struct {
Address Address `key:"address" mapstructure:"address"`
Network string `default:"tcp" key:"network" mapstructure:"network"`
ShutdownDeadline int `key:"shutdown_deadline" mapstructure:"shutdown_deadline"`
EnableReflection bool `key:"enable_reflection" mapstructure:"enable_reflection"`
Services map[string]ServicesConfig `key:"services" mapstructure:"-"`
Interceptors map[string]map[string]any `key:"interceptors" mapstructure:"-"`
// contains filtered or unexported fields
}
GRPC holds the configuration for the GRPC services.
func (GRPC) ForEachInterceptor ¶
func (i GRPC) ForEachInterceptor(f InterceptorFunc)
ForEachInterceptor iterates to each middleware calling the function f.
func (GRPC) ForEachService ¶
func (i GRPC) ForEachService(f ServiceFunc)
ForEachService iterates to each service/driver calling the function f.
type HTTP ¶
type HTTP struct {
Network string `default:"tcp" key:"network" mapstructure:"network"`
Address Address `key:"address" mapstructure:"address"`
CertFile string `key:"certfile" mapstructure:"certfile"`
KeyFile string `key:"keyfile" mapstructure:"keyfile"`
Services map[string]ServicesConfig `key:"services" mapstructure:"-"`
Middlewares map[string]map[string]any `key:"middlewares" mapstructure:"-"`
// contains filtered or unexported fields
}
HTTP holds the configuration for the HTTP services.
func (HTTP) ForEachInterceptor ¶
func (i HTTP) ForEachInterceptor(f InterceptorFunc)
ForEachInterceptor iterates to each middleware calling the function f.
func (HTTP) ForEachService ¶
func (i HTTP) ForEachService(f ServiceFunc)
ForEachService iterates to each service/driver calling the function f.
type Interceptor ¶
Interceptor contains the configuration for an interceptor.
type InterceptorFunc ¶
type InterceptorFunc func(*Interceptor)
InterceptorFunc is an helper function used to pass the interface config to the ForEachInterceptor func.
type Log ¶
type Log struct {
Output string `default:"stdout" key:"output" mapstructure:"output"`
Mode string `default:"console" key:"mode" mapstructure:"mode"`
Level string `default:"trace" key:"level" mapstructure:"level"`
}
Log holds the configuration for the logger.
type Lookuper ¶
type Lookuper interface {
// Lookup get the value associated to thye given key.
// It returns ErrKeyNotFound if the key does not exists.
Lookup(key string) (any, error)
}
Lookuper is the interface for getting the value associated with a given key.
type Serverless ¶
type Serverless struct {
Services map[string]map[string]any `key:"services" mapstructure:"services"`
}
Serverless holds the configuration for the serverless services.
type Service ¶
type Service struct {
Address Address
Network string
Name string
Label string
Config map[string]any
// contains filtered or unexported fields
}
Service contains the configuration for a service.
func (*Service) SetAddress ¶
SetAddress sets the address for the service in the configuration.
type ServiceFunc ¶
type ServiceFunc func(*Service)
ServiceFunc is an helper function used to pass the service config to the ForEachService func.
type ServicesConfig ¶
type ServicesConfig []*DriverConfig
ServicesConfig holds the configuration for reva services.
func (*ServicesConfig) Add ¶
func (s *ServicesConfig) Add(domain, svc string, c *DriverConfig)
Add appends the driver configuration to the given list of services.
func (ServicesConfig) DriversNumber ¶
func (s ServicesConfig) DriversNumber() int
DriversNumber return the number of driver configured for the service.