keyvalue

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package keyvalue implements parsed key/value information.

Index

Constants

This section is empty.

Variables

View Source
var BooleanValues = []string{
	"true",
	"false",
}

Functions

This section is empty.

Types

type ErrInvalidType

type ErrInvalidType struct {
	ExpectedType ValueType
}

func (ErrInvalidType) Error

func (e ErrInvalidType) Error() string

type KeyValue

type KeyValue struct {
	Key   string
	Value Value
}

KeyValue is the key/value of a parameter from the parsed amod code.

type Value

type Value struct {
	ID     *string
	Str    *string
	Number *float64
	Fields *[]KeyValue
}

Value stores an ID, string, number, or another KeyValue (recursive).

func (Value) AsBool

func (v Value) AsBool() (bool, error)

func (Value) IsSet

func (v Value) IsSet() bool

func (Value) String

func (v Value) String() string

func (Value) Type

func (v Value) Type() string

type ValueType

type ValueType int

ValueType is used when outputting "invalid type" errors

const (
	Boolean ValueType = iota
	Number
)

func (ValueType) String

func (v ValueType) String() string

Jump to

Keyboard shortcuts

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