gotty: github.com/yubo/gotty/hcl/hcl Index | Files

package hcl

import "github.com/yubo/gotty/hcl/hcl"

Index

Package Files

lex.go object.go parse.go valuetype_string.go y.go

Constants

const BOOL = 57346
const COMMA = 57349
const EMINUS = 57361
const EPLUS = 57360
const EQUAL = 57351
const FLOAT = 57347
const IDENTIFIER = 57350
const LEFTBRACE = 57355
const LEFTBRACKET = 57357
const MINUS = 57354
const NEWLINE = 57352
const NULL = 57362
const NUMBER = 57348
const PERIOD = 57359
const RIGHTBRACE = 57356
const RIGHTBRACKET = 57358
const STRING = 57353

type Object Uses

type Object struct {
    Key   string
    Type  ValueType
    Value interface{}
    Next  *Object
}

Object represents any element of HCL: an object itself, a list, a literal, etc.

func Parse Uses

func Parse(v string) (*Object, error)

Parse parses the given string and returns the result.

func (*Object) Elem Uses

func (o *Object) Elem(expand bool) []*Object

Elem returns all the elements that are part of this object.

func (*Object) Get Uses

func (o *Object) Get(k string, insensitive bool) *Object

Get gets all the objects that match the given key.

It returns the resulting objects as a single Object structure with the linked list populated.

func (*Object) GoString Uses

func (o *Object) GoString() string

GoString is an implementation of the GoStringer interface.

func (*Object) Len Uses

func (o *Object) Len() (i int)

Len returns the number of objects in this object structure.

type ObjectList Uses

type ObjectList []*Object

ObjectList is a list of objects.

func (ObjectList) Flat Uses

func (l ObjectList) Flat() []*Object

Flat returns a flattened list structure of the objects.

type ValueType Uses

type ValueType byte

ValueType is an enum represnting the type of a value in a LiteralNode.

const (
    ValueTypeUnknown ValueType = iota
    ValueTypeFloat
    ValueTypeInt
    ValueTypeString
    ValueTypeBool
    ValueTypeNil
    ValueTypeList
    ValueTypeObject
)

func (ValueType) String Uses

func (i ValueType) String() string

Package hcl imports 8 packages (graph) and is imported by 2 packages. Updated 2017-01-26. Refresh now. Tools for package owners.