ucfgwrap

package module
v0.0.0-...-375b5fb Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 5

README

ucfgwrap

A small wrapper for ucfg that passes a slice of ucfg.Options to every function, so you don't have to.

Documentation

Overview

Small wrapper for ucfg that passes a slice of ucfg.Options to every unpack function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config bundles a ucfg.Config with a slice of ucfg.Options.

func FromJSON

func FromJSON(data []byte, opts ...ucfg.Option) (Config, error)

FromJSON parses the given json into a ucfgwrap.Config using the given options.

func FromJSONFile

func FromJSONFile(path string, opts ...ucfg.Option) (Config, error)

FromJSONFile parses the given file into a ucfgwrap.Config using the given options.

func FromYAML

func FromYAML(data []byte, opts ...ucfg.Option) (Config, error)

FromYAML parses the given yaml into a ucfgwrap.Config using the given options.

func FromYAMLFile

func FromYAMLFile(path string, opts ...ucfg.Option) (Config, error)

FromYAMLFile parses the given file into a ucfgwrap.Config using the given options.

func (*Config) Unpack

func (c *Config) Unpack(to interface{}) error

Unpack unpacks to the given pointer.

func (*Config) Wrap

func (c *Config) Wrap(config *ucfg.Config) Config

Wrap wraps a ucfg.Config together with the options contained in the parent ucfgwrap.Config. This handy when parsing into ucfg.Configs but passing around ucfgwrap.Configs.

Jump to

Keyboard shortcuts

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