hocon

package
v0.1.32 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MimeType = "application/hocon"
)

Variables

View Source
var (
	SpecialCase = map[string]func(v *ho.HoconValue, w Writer){
		"time/Time": func(v *ho.HoconValue, w Writer) {
			fn.Panic1(w.Write(fn.Panic1(json.Marshal(fn.Panic1(time.Parse(time.RFC3339, v.GetString()))))))
		},
		"time/Duration": func(v *ho.HoconValue, w Writer) {
			w.Int(v.GetTimeDuration(false).Milliseconds())
		},
	}
)

Functions

func Marshal

func Marshal(obj any) (*configuration.Config, error)

func Unmarshal

func Unmarshal(c *configuration.Config, p any) (err error)

Types

type Decoder

type Decoder struct {
	io.Reader
}

type Encoder

type Encoder struct {
	io.Writer
}

type Writer added in v0.1.30

type Writer struct {
	*bytes.Buffer
}

func (Writer) ArrayBegin added in v0.1.30

func (w Writer) ArrayBegin()

func (Writer) ArrayEnd added in v0.1.30

func (w Writer) ArrayEnd()

func (Writer) Bool added in v0.1.30

func (w Writer) Bool(boolean bool)

func (Writer) Colon added in v0.1.30

func (w Writer) Colon()

func (Writer) Comma added in v0.1.30

func (w Writer) Comma()

func (Writer) Float added in v0.1.30

func (w Writer) Float(v float64)

func (Writer) Int added in v0.1.30

func (w Writer) Int(v int64)

func (Writer) Null added in v0.1.30

func (w Writer) Null()

func (Writer) ObjectBegin added in v0.1.30

func (w Writer) ObjectBegin()

func (Writer) ObjectEnd added in v0.1.30

func (w Writer) ObjectEnd()

func (Writer) Quote added in v0.1.30

func (w Writer) Quote(text string)

Jump to

Keyboard shortcuts

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