toml

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

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

func ParseFile

func ParseFile(tomlFilePath string) Document

func (Document) Array

func (d Document) Array(name string, defaultValue ...[]Value) []Value

func (Document) Bool

func (d Document) Bool(name string, defaultValue ...bool) bool

func (Document) Date

func (d Document) Date(name string, defaultValue ...time.Time) time.Time

func (Document) Duration

func (d Document) Duration(name string, defaultValue ...time.Duration) time.Duration

func (Document) Float

func (d Document) Float(name string, defaultValue ...float64) float64

func (Document) Float32

func (d Document) Float32(name string, defaultValue ...float32) float32

func (Document) Float64

func (d Document) Float64(name string, defaultValue ...float64) float64

func (Document) Int

func (d Document) Int(name string, defaultValue ...int) int

func (Document) Int16

func (d Document) Int16(name string, defaultValue ...int16) int16

func (Document) Int32

func (d Document) Int32(name string, defaultValue ...int32) int32

func (Document) Int64

func (d Document) Int64(name string, defaultValue ...int64) int64

func (Document) Int8

func (d Document) Int8(name string, defaultValue ...int8) int8

func (Document) Section

func (d Document) Section(path string) (*Node, bool)

func (Document) String

func (d Document) String(name string, defaultValue ...string) string

func (Document) Strings

func (d Document) Strings(name string, defaultValues ...string) []string

func (Document) ToString

func (d Document) ToString() string

func (Document) Value

func (d Document) Value(path string) (Value, bool)

type Kind

type Kind int

type Node

type Node struct {
	Children map[string]*Node
	// contains filtered or unexported fields
}

func (*Node) FullName

func (n *Node) FullName() string

func (*Node) GetSection

func (n *Node) GetSection(path string) (*Node, bool)

func (*Node) GetValue

func (n *Node) GetValue(path string) (Value, bool)

func (*Node) String

func (n *Node) String() string

type Parser

type Parser struct{}

func (Parser) Parse

func (p Parser) Parse(tomlString string) Document

func (Parser) ParseFile

func (p Parser) ParseFile(tomlFilePath string) Document

type Value

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

func ParseDefaultArray

func ParseDefaultArray(s string) []Value

func (Value) AsArray

func (v Value) AsArray() []Value

func (Value) AsBool

func (v Value) AsBool() bool

func (Value) AsDate

func (v Value) AsDate() time.Time

func (Value) AsDuration

func (v Value) AsDuration() time.Duration

func (Value) AsFloat

func (v Value) AsFloat() float64

func (Value) AsFloat32

func (v Value) AsFloat32() float32

func (Value) AsFloat64

func (v Value) AsFloat64() float64

func (Value) AsInt

func (v Value) AsInt() int

func (Value) AsInt16

func (v Value) AsInt16() int16

func (Value) AsInt32

func (v Value) AsInt32() int32

func (Value) AsInt64

func (v Value) AsInt64() int64

func (Value) AsInt8

func (v Value) AsInt8() int8

func (Value) AsString

func (v Value) AsString() string

func (Value) AsStrings

func (v Value) AsStrings() []string

func (Value) String

func (v Value) String() string

Jump to

Keyboard shortcuts

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