...

Package env2config

import "github.com/johnstarich/env2config"
Overview
Index
Subdirectories

Overview ▾

func RegisterFormat

func RegisterFormat(format string, marshaler Marshaler)

type Config

type Config struct {
    Name   string
    Opts   Opts // NAME_OPTS_*
    Values Values
    // contains filtered or unexported fields
}

func New

func New(name string) (Config, error)

func (Config) Write

func (c Config) Write() error

type Marshaler

Marshaler serializes the given value and writes it to the writer

type Marshaler interface {
    Marshal(io.Writer, interface{}) error
}

type Opts

type Opts struct {
    File               string   `required:"true"`
    Format             string   `required:"true"`
    TemplateFile       string   `split_words:"true"`
    TemplateDeleteKeys []string `split_words:"true"`

    Inputs Values // NAME_OPTS_IN_*
}

type Unmarshaler

Unmarshaler deserializes contents of the reader into the provided value pointer. For a value to be mergeable, it must be of type map[string]interface{} or []interface{}.

type Unmarshaler interface {
    Unmarshal(io.Reader, interface{}) error
}

type Values

type Values map[string]string

func (Values) Set

func (v Values) Set(value string) error

Subdirectories