config

package
v0.11.0-alpha.0.pre.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndpointRead      EndpointType = "read"
	EndpointWrite     EndpointType = "write"
	EndpointMetrics   EndpointType = "metrics"
	EndpointOPLSyntax EndpointType = "opl"

	KeyDSN = "dsn"

	KeyLimitMaxReadDepth = "limit.max_read_depth"

	KeyReadAPIHost      = "serve." + string(EndpointRead) + ".host"
	KeyReadAPIPort      = "serve." + string(EndpointRead) + ".port"
	KeyWriteAPIHost     = "serve." + string(EndpointWrite) + ".host"
	KeyWriteAPIPort     = "serve." + string(EndpointWrite) + ".port"
	KeyOPLSyntaxAPIHost = "serve." + string(EndpointOPLSyntax) + ".host"
	KeyOPLSyntaxAPIPort = "serve." + string(EndpointOPLSyntax) + ".port"
	KeyMetricsHost      = "serve." + string(EndpointMetrics) + ".host"
	KeyMetricsPort      = "serve." + string(EndpointMetrics) + ".port"

	KeyNamespaces                       = "namespaces"
	KeyNamespacesExperimentalStrictMode = KeyNamespaces + ".experimental_strict_mode"

	DSNMemory = "sqlite://file::memory:?_fk=true&cache=shared"
)

Variables

View Source
var (
	Version = "master"
	Date    = "undefined"
	Commit  = "undefined"
)

Functions

func NewMemoryNamespaceManager

func NewMemoryNamespaceManager(nn ...*namespace.Namespace) *memoryNamespaceManager

func NewProvider

func NewProvider(ctx context.Context, flags *pflag.FlagSet, config *Config, opts ...configx.OptionModifier) (*configx.Provider, error)

Types

type Config

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

func New

func NewDefault

func NewDefault(ctx context.Context, flags *pflag.FlagSet, l *logrusx.Logger, opts ...configx.OptionModifier) (*Config, error)

func (*Config) CORS

func (k *Config) CORS(iface string) (cors.Options, bool)

func (*Config) DSN

func (k *Config) DSN() string

func (*Config) Fetcher

func (k *Config) Fetcher() *fetcher.Fetcher

func (*Config) MaxReadDepth

func (k *Config) MaxReadDepth() int

func (*Config) MetricsListenOn

func (k *Config) MetricsListenOn() string

func (*Config) NamespaceManager

func (k *Config) NamespaceManager() (namespace.Manager, error)

func (*Config) OPLSyntaxAPIListenOn

func (k *Config) OPLSyntaxAPIListenOn() string

func (*Config) ReadAPIListenOn

func (k *Config) ReadAPIListenOn() string

func (*Config) Set

func (k *Config) Set(key string, v any) error

func (*Config) Source

func (k *Config) Source() *configx.Provider

func (*Config) StrictMode

func (k *Config) StrictMode() bool

func (*Config) TracingConfig

func (k *Config) TracingConfig() *otelx.Config

func (*Config) TracingProvider

func (k *Config) TracingProvider() string

func (*Config) TracingServiceName

func (k *Config) TracingServiceName() string

func (*Config) WithSource

func (k *Config) WithSource(p *configx.Provider)

func (*Config) WriteAPIListenOn

func (k *Config) WriteAPIListenOn() string

type EndpointType

type EndpointType string

type NamespaceFile

type NamespaceFile struct {
	Name     string
	Contents []byte
	Parser   Parser
	// contains filtered or unexported fields
}

type NamespaceWatcher

type NamespaceWatcher struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewNamespaceWatcher

func NewNamespaceWatcher(ctx context.Context, l *logrusx.Logger, target string) (*NamespaceWatcher, error)

func (*NamespaceWatcher) GetNamespaceByConfigID

func (nw *NamespaceWatcher) GetNamespaceByConfigID(_ context.Context, id int32) (*namespace.Namespace, error)

func (*NamespaceWatcher) GetNamespaceByName

func (nw *NamespaceWatcher) GetNamespaceByName(_ context.Context, name string) (*namespace.Namespace, error)

func (*NamespaceWatcher) NamespaceFiles

func (nw *NamespaceWatcher) NamespaceFiles() []*NamespaceFile

func (*NamespaceWatcher) Namespaces

func (nw *NamespaceWatcher) Namespaces(_ context.Context) ([]*namespace.Namespace, error)

func (*NamespaceWatcher) ShouldReload

func (nw *NamespaceWatcher) ShouldReload(newValue interface{}) bool

type Parser

type Parser func([]byte, interface{}) error

func GetParser

func GetParser(fn string) (Parser, error)

type Provider

type Provider interface {
	Config(ctx context.Context) *Config
}

Jump to

Keyboard shortcuts

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