config

package module
v0.0.0-...-b2ac241 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

* Copyright (C) 2019-2020 Red Dove Consultants Ltd. All rights reserved.

* Copyright (C) 2019-2020 Red Dove Consultants Ltd. All rights reserved.

* Copyright (C) 2019-2020 Red Dove Consultants Ltd. All rights reserved.

Index

Constants

View Source
const (
	EOF tokenKind = iota
	Word
	Integer
	Float
	String
	Newline
	LeftCurly
	RightCurly
	LeftBracket
	RightBracket
	LeftParenthesis
	RightParenthesis
	LessThan
	GreaterThan
	LessThanOrEqual
	GreaterThanOrEqual
	Assign
	Equal
	Unequal
	AltUnequal
	LeftShift
	RightShift
	Dot
	Comma
	Colon
	At
	Plus
	Minus
	Star
	Power
	Slash
	SlashSlash
	Modulo
	BackTick
	Dollar
	True
	False
	None
	Is
	In
	Not
	And
	Or
	BitwiseAnd
	BitwiseOr
	BitwiseXor
	BitwiseComplement
	Complex
	IsNot
	NotIn
	Error
)

Variables

View Source
var NullValue = missing{}

Functions

This section is empty.

Types

type Any

type Any interface{}

func Parse

func Parse(source string) (Any, error)

func ParseRule

func ParseRule(source string, rule string) (Any, error)

type BinaryNode

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

func (BinaryNode) String

func (b BinaryNode) String() string

type Config

type Config struct {
	NoDuplicates      bool
	StrictConversions bool
	IncludePath       []string
	RootDir           string
	Path              string

	Context *Mapping
	// contains filtered or unexported fields
}

func FromFile

func FromFile(path string) (*Config, error)

func NewConfig

func NewConfig() *Config

func (*Config) AsDict

func (self *Config) AsDict() (Mapping, error)

func (*Config) Get

func (self *Config) Get(key string) (Any, error)

func (*Config) GetWithDefault

func (self *Config) GetWithDefault(key string, defaultValue Any) (Any, error)

func (*Config) Load

func (self *Config) Load(reader *io.Reader) error

func (*Config) LoadFile

func (self *Config) LoadFile(path string) error

func (*Config) String

func (self *Config) String() string

type Location

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

func (*Location) NextLine

func (self *Location) NextLine()

func (Location) String

func (loc Location) String() string

func (*Location) Update

func (self *Location) Update(other *Location)

type MapWrapper

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

func (*MapWrapper) AsDict

func (self *MapWrapper) AsDict() (Mapping, error)

func (*MapWrapper) Get

func (self *MapWrapper) Get(key string) (Any, error)

func (MapWrapper) String

func (self MapWrapper) String() string

type Mapping

type Mapping map[string]Any

type Parser

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

func NewParser

func NewParser(reader *io.Reader) (Parser, error)

func (*Parser) Container

func (self *Parser) Container() (Any, error)

func (*Parser) Expr

func (self *Parser) Expr() (Any, error)

func (*Parser) MappingBody

func (self *Parser) MappingBody() (Any, error)

type RecognizerError

type RecognizerError struct {
	Location *Location
	// contains filtered or unexported fields
}

func (RecognizerError) Error

func (e RecognizerError) Error() string

type SeqWrapper

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

func (*SeqWrapper) AsList

func (self *SeqWrapper) AsList() (Sequence, error)

func (*SeqWrapper) Get

func (self *SeqWrapper) Get(index int) (Any, error)

func (SeqWrapper) String

func (self SeqWrapper) String() string

type Sequence

type Sequence []Any

type SliceNode

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

func (SliceNode) String

func (s SliceNode) String() string

type StringConverter

type StringConverter func(string, *Config) Any

type Token

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

func (Token) String

func (t Token) String() string

type UnaryNode

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

func (UnaryNode) String

func (u UnaryNode) String() string

Jump to

Keyboard shortcuts

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