config

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context, name string) interface{}

FromContext extracts config from a context

func RegisterConfigCreator

func RegisterConfigCreator(name string, creator Creator)

RegisterConfigCreator registers a config struct for parsing

func WithConfig

func WithConfig(ctx context.Context, name string, cfg interface{}) context.Context

func WithJSONConfig

func WithJSONConfig(ctx context.Context, data []byte) (context.Context, error)

func WithYAMLConfig

func WithYAMLConfig(ctx context.Context, data []byte) (context.Context, error)

Types

type Creator

type Creator func() interface{}

Creator creates default config struct for a module

Jump to

Keyboard shortcuts

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