cfg

package
v0.0.0-...-39e813e Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Unlicense Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapConfig

func MapConfig(cfg gjson.Result, models map[string]Unmarshaler) (err error)

MapConfig is a tool function wrap MapTo in go-ini read config in .ini, map them to given struct

func ReadConfigFile

func ReadConfigFile(path string) (res gjson.Result, err error)

ReadConfigFile is a tool function "path" is path to *.json file get gjson.Result through *.json path

Types

type Unmarshaler

type Unmarshaler interface {
	Unmarshal(res gjson.Result)
}

Unmarshaler is an interface

func (v interface{}) Unmarshal(res gjson.Result) turn gjson.Result => v(interface{})

Jump to

Keyboard shortcuts

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