toml

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Position

type Position struct {
	Line int // line within the document
	Col  int // column within the line
}

Position of a document element within a TOML document.

Line and Col are both 1-indexed positions for the element's line number and column number, respectively. Values of zero or less will cause Invalid(), to return true.

func (Position) Invalid

func (p Position) Invalid() bool

Invalid returns whether or not the position is valid (i.e. with negative or null values)

func (Position) String

func (p Position) String() string

String representation of the position. Displays 1-indexed line and column numbers.

type Toml

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

Toml is a struct

func NewToml

func NewToml(path string) (Toml, error)

NewToml returns the Toml

func (*Toml) Get

func (t *Toml) Get(query string) interface{}

Get the value at key in the Tree. [Wrapped function go-toml.]

func (*Toml) Out

func (t *Toml) Out(path string)

Dest set output given path

func (*Toml) Set

func (t *Toml) Set(query string, data interface{}) error

Set the value at key in the Tree. [Wrapped function go-toml.]

func (*Toml) Write

func (t *Toml) Write() error

Write edited toml tree given path. if dest is not setted, overwrite it.

Jump to

Keyboard shortcuts

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