yaml

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenKey   = 1
	TokenIndex = 2
)

Token types.

Variables

This section is empty.

Functions

func Exist

func Exist(key string, yaml *simpleyaml.Yaml) (bool, error)

Exist returns true if the key exists.

func Get

func Get(key string, yaml *simpleyaml.Yaml) (string, error)

Get returns the value from a key, if it exists.

The value of the key is determined by its content:

hello - the value is a string 12 - the value is a number 1.2 - the value is a float true|false - the value is a boolean nil - the value is nil, not found or its type could not be parsed {...} - the value is an object [...] - the value is an array

Types

type Token

type Token struct {
	Type  int
	Key   string
	Index int
}

Token presents the token by its type and values.

Jump to

Keyboard shortcuts

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