toml

package
v0.0.0-...-d47e5ee Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenEqual         TokenType = "'='"
	TokenDot           TokenType = "'.'"
	TokenComma         TokenType = "','"
	TokenLBrace        TokenType = "'{'"
	TokenRBrace        TokenType = "'}'"
	TokenLSquare       TokenType = "'['"
	TokenRSquare       TokenType = "']'"
	TokenDoubleLSquare TokenType = "'[['"
	TokenDoubleRSquare TokenType = "']]'"
	TokenDateTime      TokenType = "<datetime>"
)

Variables

This section is empty.

Functions

func Load

func Load(path string, v interface{}) error

Load is a convenience function to load a JSON5 document into the value pointed at by v. It is functionally equivalent to NewDecoder(<file at path>).Decode(v).

func Marshal

func Marshal(v interface{}) ([]byte, error)

func NewDecoder

func NewDecoder(rd io.Reader) encoding.Decoder

func NewEncoder

func NewEncoder(out io.Writer) encoding.Encoder

func Save

func Save(path string, v interface{}) error

Save is a convenience function to save the value pointed at by v into a TOML document at path. It is functionally equivalent to NewEncoder(<file at path>).Encode(v).

Types

type DuplicateKeyError

type DuplicateKeyError struct {
	Kind     string
	Prefix   []interface{}
	Path     []interface{}
	Position Cursor
}

func (*DuplicateKeyError) Error

func (e *DuplicateKeyError) Error() string

type LocalDate

type LocalDate struct {
	Year  int
	Month time.Month
	Day   int
}

func MakeLocalDate

func MakeLocalDate(t time.Time) LocalDate

func (LocalDate) String

func (date LocalDate) String() string

func (LocalDate) Time

func (date LocalDate) Time(hour, min, sec, nsec int, loc *time.Location) time.Time

type LocalDateTime

type LocalDateTime struct {
	LocalDate
	LocalTime
}

func MakeLocalDateTime

func MakeLocalDateTime(t time.Time) LocalDateTime

func (LocalDateTime) String

func (dt LocalDateTime) String() string

func (LocalDateTime) Time

func (dt LocalDateTime) Time(loc *time.Location) time.Time

type LocalTime

type LocalTime struct {
	Hour       int
	Minute     int
	Second     int
	Nanosecond int
}

func MakeLocalTime

func MakeLocalTime(t time.Time) LocalTime

func (LocalTime) String

func (t LocalTime) String() string

func (LocalTime) Time

func (t LocalTime) Time(year int, month time.Month, day int, loc *time.Location) time.Time

Jump to

Keyboard shortcuts

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