util

package
v0.0.0-...-e9f0680 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnoredFlag

func IgnoredFlag(f *pflag.FlagSet, name, message string)

IgnoredFlag ignores set value, without any warning

func LoadConfig

func LoadConfig(filename string, pointer interface{}) error

LoadConfig read YAML-formatted config from filename into cfg.

func ParseConfigFileParameter

func ParseConfigFileParameter(args []string) (configFile string)

ParseConfigFileParameter Parse -config.file and -config.expand-env option via separate flag set, to avoid polluting default one and calling flag.Parse on it twice.

func ReadMultiFile

func ReadMultiFile(fileListStr string) ([]byte, error)

func ReadStreamFile

func ReadStreamFile(fileName string) ([]byte, error)

func RegisterExitHandlers

func RegisterExitHandlers(logger logger.Logger, cancelFunc func()) (stop chan struct{})

RegisterExitHandlers is used to register exit handlers

func SliceMapToStringMap

func SliceMapToStringMap(m map[string][]string) map[string]string

func StartServiceAsync

func StartServiceAsync(ctx *mbcontext.Context, log logger.Logger,
	serveFn func() error, stopFn func() error)

StartServiceAsync is used to start service async

func ToHttpHeader

func ToHttpHeader(headers map[string]interface{}) (httpHeader http.Header)

func ValidateConfigs

func ValidateConfigs(configs ...ValidatableConfig) error

ValidateConfigs is used to validate validatable configs

Types

type RegistrableConfig

type RegistrableConfig interface {
	// RegisterFlagsWithPrefix is used to registerer flag with prefix
	RegisterFlagsWithPrefix(prefix string, f *pflag.FlagSet)
}

RegistrableConfig defines the registrable config

type ValidatableConfig

type ValidatableConfig interface {
	// Validate is used to validate config and returns error on failure
	Validate() error
}

ValidatableConfig defines the validatable Config

Directories

Path Synopsis
Package goproxy HTTP(S)代理, 支持中间人代理解密HTTPS数据
Package goproxy HTTP(S)代理, 支持中间人代理解密HTTPS数据
cert
Package cert HTTPS证书
Package cert HTTPS证书
Package grpcurl provides the core functionality exposed by the grpcurl command, for dynamically connecting to a server, using the reflection service to inspect the server, and invoking RPCs.
Package grpcurl provides the core functionality exposed by the grpcurl command, for dynamically connecting to a server, using the reflection service to inspect the server, and invoking RPCs.
ext/ggrpcurl
Command grpcurl makes gRPC requests (a la cURL, but HTTP/2).
Command grpcurl makes gRPC requests (a la cURL, but HTTP/2).

Jump to

Keyboard shortcuts

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