conf

package
v0.0.0-...-d36f3aa Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegistMarshaller

func RegistMarshaller(input Marshaller)

registe your marshaller implementation

Types

type ConfigureParser

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

func NewConfigureParser

func NewConfigureParser(home string, fileName string) *ConfigureParser

func (*ConfigureParser) Load

func (cnf *ConfigureParser) Load(ouput interface{}) error

load config to output

func (*ConfigureParser) LoadWithMerge

func (cnf *ConfigureParser) LoadWithMerge(output interface{}, toMerge interface{}) error

load with default value

func (*ConfigureParser) Save

func (cnf *ConfigureParser) Save(input interface{}) error

save input to config file

type Json

type Json struct {
}

func NewJson

func NewJson() *Json

func (*Json) Marshal

func (js *Json) Marshal(input interface{}) ([]byte, error)

func (*Json) Type

func (js *Json) Type() string

func (*Json) Unmarshal

func (js *Json) Unmarshal(input []byte, output interface{}) error

type Marshaller

type Marshaller interface {
	Marshal(interface{}) ([]byte, error)
	Unmarshal([]byte, interface{}) error
	Type() string
}

func GetMarshaller

func GetMarshaller(name string) Marshaller

get marshaller implementation by type name

type Toml

type Toml struct {
}

func NewToml

func NewToml() *Toml

func (*Toml) Marshal

func (tm *Toml) Marshal(input interface{}) ([]byte, error)

func (*Toml) Type

func (tm *Toml) Type() string

func (*Toml) Unmarshal

func (tm *Toml) Unmarshal(input []byte, output interface{}) error

type Yaml

type Yaml struct {
}

func NewYaml

func NewYaml() *Yaml

func (*Yaml) Marshal

func (ym *Yaml) Marshal(input interface{}) ([]byte, error)

func (*Yaml) Type

func (ym *Yaml) Type() string

func (*Yaml) Unmarshal

func (ym *Yaml) Unmarshal(input []byte, output interface{}) error

Jump to

Keyboard shortcuts

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