config

package
v0.0.0-...-341c48f Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCP = "tcp"
)

Variables

This section is empty.

Functions

func GetVagrantTarget

func GetVagrantTarget(vagrantIP, port string) resolver.Target

GetVagrantTarget concatenates the vagrant private ip with the port posses it into ParseTarget and returns the result.

func LoadConfigFile

func LoadConfigFile(cm *ConfigManager, path string) error

LoadConfigFile updates ConfigManager with a config file if it can be read successfully.

func LogLevel

func LogLevel(l config.AgwD_LogLevel) log.Level

LogLevel translates protobuf defined config.AgwD_LogLevel to log.Level.

func ParseTarget

func ParseTarget(target string) resolver.Target

ParseTarget takes a target in string form and returns a resolved Target. Extends functionality in grpc/internal/grpcutil.ParseTarget to support ipv4 and ipv6 schemes. Return tcp4Scheme or tcp6Scheme so the Scheme can be passed directly to net.Listen.

Types

type ConfigManager

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

ConfigManager implements Configer via a loaded config.

func NewConfigManager

func NewConfigManager() *ConfigManager

NewConfigManager constructs a *ConfigManager with default config values.

func (*ConfigManager) Config

func (c *ConfigManager) Config() *config.AgwD

Config returns the current config.

func (*ConfigManager) Merge

func (c *ConfigManager) Merge(update *config.AgwD)

Merge updates the managed config.

func (*ConfigManager) Replace

func (c *ConfigManager) Replace(replace *config.AgwD)

Replace overwrites the managed config.

func (*ConfigManager) ReplaceConfig

func (cm *ConfigManager) ReplaceConfig(config *config.AgwD) error

ReplaceConfig overwites the CongfigManager with a config file. TODO: Add validation and error checks. Note: this can lead to a race condition.

func (*ConfigManager) UpdateConfig

func (cm *ConfigManager) UpdateConfig(config *config.AgwD) error

UpdateConfig updates CongfigManager with a config file. TODO: Add validation and error checks on fields being updated.

type Configer

type Configer interface {
	Config() *config.AgwD
	UpdateConfig(*config.AgwD) error
	ReplaceConfig(d *config.AgwD) error
}

Configer returns a parsed config.

Directories

Path Synopsis
internal
grpcutil
Package grpcutil provides a bunch of utility functions to be used across the gRPC codebase.
Package grpcutil provides a bunch of utility functions to be used across the gRPC codebase.
Package config is a generated GoMock package.
Package config is a generated GoMock package.

Jump to

Keyboard shortcuts

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