config

package
v0.7.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyDSN = "dsn"

	KeyReadAPIHost = "serve.read.host"
	KeyReadAPIPort = "serve.read.port"

	KeyWriteAPIHost = "serve.write.host"
	KeyWriteAPIPort = "serve.write.port"

	KeyNamespaces = "namespaces"

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

Variables

View Source
var (
	Version = "master"
	Date    = "undefined"
	Commit  = "undefined"
)
View Source
var Schema []byte

Functions

func NewMemoryNamespaceManager

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

Types

type Config

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

func New

func New(ctx context.Context, flags *pflag.FlagSet, l *logrusx.Logger) (*Config, error)

func (*Config) CORS

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

func (*Config) DSN

func (k *Config) DSN() string

func (*Config) NamespaceManager

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

func (*Config) ReadAPIListenOn

func (k *Config) ReadAPIListenOn() string

func (*Config) Set

func (k *Config) Set(key string, v interface{}) error

func (*Config) Source

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

func (*Config) TracingConfig

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

func (*Config) TracingProvider

func (k *Config) TracingProvider() string

func (*Config) TracingServiceName

func (k *Config) TracingServiceName() string

func (*Config) WriteAPIListenOn

func (k *Config) WriteAPIListenOn() 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 (n *NamespaceWatcher) GetNamespaceByConfigID(_ context.Context, id int32) (*namespace.Namespace, error)

func (*NamespaceWatcher) GetNamespaceByName

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

func (*NamespaceWatcher) NamespaceFiles

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

func (*NamespaceWatcher) Namespaces

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

func (*NamespaceWatcher) ShouldReload

func (n *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() *Config
}

Jump to

Keyboard shortcuts

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