config

package
v0.0.0-...-5d7a24c Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 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) any

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 any) 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() any

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