internal

package
v0.0.21-0...-b21de04 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Environment = EnvReader{
		GetEnv:    os.Getenv,
		Namespace: "OTEL",
	}
)

Functions

func GetScheme

func GetScheme(rawDSN string) (scheme, path string, err error)

Maybe rawDSN is of the form scheme:opts. (Scheme must be [a-zA-Z][a-zA-Z0-9+.-]*) If so, return scheme, opts; else return rawDSN, "".

func ParseDSN

func ParseDSN(rawDSN string) (path string, params map[string]string, err error)

PraseDSN format(s): - scheme:path[;param=[;paramN=]] - scheme://path[?param=[&paramN=]]

Types

type EnvOption

type EnvOption func(*EnvReader)

func EnvString

func EnvString(key string, eval func(string)) EnvOption

type EnvReader

type EnvReader struct {
	GetEnv    func(string) string
	Namespace string
}

func (*EnvReader) Apply

func (c *EnvReader) Apply(opts ...EnvOption)

func (*EnvReader) GetEnvValue

func (e *EnvReader) GetEnvValue(key string) (string, bool)

GetEnvValue gets an OTLP environment variable value of the specified key using the GetEnv function. This function prepends the OTLP specified namespace to all key lookups.

type FileWriter

type FileWriter = lumberjack.Logger

FileWriter with rotation

func FileDSN

func FileDSN(rawDSN string) (*FileWriter, error)

Jump to

Keyboard shortcuts

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