Documentation ¶
Index ¶
- Constants
- Variables
- func StringTokenType(tokenType TokenType) string
- type HoconArray
- type HoconElement
- type HoconLiteral
- type HoconObject
- func (p *HoconObject) GetArray() []*HoconValue
- func (p *HoconObject) GetKey(key string) *HoconValue
- func (p *HoconObject) GetKeys() []string
- func (p *HoconObject) GetOrCreateKey(key string) *HoconValue
- func (p *HoconObject) GetString() string
- func (p *HoconObject) IsArray() bool
- func (p *HoconObject) IsString() bool
- func (p *HoconObject) Items() map[string]*HoconValue
- func (p *HoconObject) Merge(other *HoconObject)
- func (p *HoconObject) MergeImmutable(other *HoconObject) *HoconObject
- func (p *HoconObject) String() string
- func (p *HoconObject) ToString(indent int) string
- func (p *HoconObject) Unwrapped() map[string]interface{}
- type HoconRoot
- type HoconSubstitution
- type HoconTokenizer
- func (p *HoconTokenizer) IsArrayEnd() bool
- func (p *HoconTokenizer) IsArrayStart() bool
- func (p *HoconTokenizer) IsAssignment() bool
- func (p *HoconTokenizer) IsComma() bool
- func (p *HoconTokenizer) IsDot() bool
- func (p *HoconTokenizer) IsEndOfObject() bool
- func (p *HoconTokenizer) IsInclude() bool
- func (p *HoconTokenizer) IsNewline() bool
- func (p *HoconTokenizer) IsObjectStart() bool
- func (p *HoconTokenizer) IsPlusAssignment() bool
- func (p *HoconTokenizer) IsSpaceOrTab() bool
- func (p *HoconTokenizer) IsStartOfComment() bool
- func (p *HoconTokenizer) IsStartOfQuotedText() bool
- func (p *HoconTokenizer) IsStartOfTripleQuotedText() bool
- func (p *HoconTokenizer) IsStartSimpleValue() bool
- func (p *HoconTokenizer) IsSubstitutionStart() bool
- func (p *HoconTokenizer) IsUnquotedKey() bool
- func (p *HoconTokenizer) IsUnquotedKeyStart() bool
- func (p *HoconTokenizer) IsWhitespace() bool
- func (p *HoconTokenizer) IsWhitespaceOrComment() bool
- func (p *HoconTokenizer) PullArrayEnd() *Token
- func (p *HoconTokenizer) PullArrayStart() *Token
- func (p *HoconTokenizer) PullAssignment() *Token
- func (p *HoconTokenizer) PullComma() *Token
- func (p *HoconTokenizer) PullComment() *Token
- func (p *HoconTokenizer) PullDot() *Token
- func (p *HoconTokenizer) PullEndOfObject() *Token
- func (p *HoconTokenizer) PullInclude() *Token
- func (p *HoconTokenizer) PullNewline() *Token
- func (p *HoconTokenizer) PullNext() (token *Token)
- func (p *HoconTokenizer) PullPlusAssignment() *Token
- func (p *HoconTokenizer) PullQuotedKey() *Token
- func (p *HoconTokenizer) PullQuotedText() *Token
- func (p *HoconTokenizer) PullRestOfLine() string
- func (p *HoconTokenizer) PullSimpleValue() *Token
- func (p *HoconTokenizer) PullSpaceOrTab() *Token
- func (p *HoconTokenizer) PullStartOfObject() *Token
- func (p *HoconTokenizer) PullTripleQuotedText() *Token
- func (p *HoconTokenizer) PullUnquotedKey() *Token
- func (p *HoconTokenizer) PullValue() *Token
- func (p *HoconTokenizer) PullWhitespaceAndComments()
- type HoconValue
- func (p *HoconValue) AppendValue(value HoconElement)
- func (p *HoconValue) AtKey(key string) *HoconRoot
- func (p *HoconValue) Clear()
- func (p *HoconValue) GetArray() []*HoconValue
- func (p *HoconValue) GetBoolean() bool
- func (p *HoconValue) GetBooleanList() []bool
- func (p *HoconValue) GetByte() byte
- func (p *HoconValue) GetByteList() []byte
- func (p *HoconValue) GetByteSize() *big.Int
- func (p *HoconValue) GetChildObject(key string) *HoconValue
- func (p *HoconValue) GetFloat32() float32
- func (p *HoconValue) GetFloat32List() []float32
- func (p *HoconValue) GetFloat64() float64
- func (p *HoconValue) GetFloat64List() []float64
- func (p *HoconValue) GetInt32() int32
- func (p *HoconValue) GetInt32List() []int32
- func (p *HoconValue) GetInt64() int64
- func (p *HoconValue) GetInt64List() []int64
- func (p *HoconValue) GetObject() *HoconObject
- func (p *HoconValue) GetString() string
- func (p *HoconValue) GetStringList() []string
- func (p *HoconValue) GetTimeDuration(allowInfinite bool) time.Duration
- func (p *HoconValue) IsArray() bool
- func (p *HoconValue) IsEmpty() bool
- func (p *HoconValue) IsObject() bool
- func (p *HoconValue) IsString() bool
- func (p *HoconValue) NewValue(value HoconElement)
- func (p *HoconValue) String() string
- func (p *HoconValue) ToString(indent int) string
- type IncludeCallback
- type MightBeAHoconObject
- type Parser
- type Stack
- type Token
- type TokenType
- type Tokenizer
- func (p *Tokenizer) EOF() bool
- func (p *Tokenizer) Matches(pattern string) bool
- func (p *Tokenizer) MatchesMore(patterns []string) bool
- func (p *Tokenizer) Peek() byte
- func (p *Tokenizer) Pop()
- func (p *Tokenizer) PullWhitespace()
- func (p *Tokenizer) Push()
- func (p *Tokenizer) Take(length int) string
- func (p *Tokenizer) TakeOne() byte
Constants ¶
View Source
const ( HoconNotInUnquotedKey = "$\"{}[]:=+,#`^?!@*&\\." HoconNotInUnquotedText = "$\"{}[]:=+,#`^?!@*&\\" )
Variables ¶
View Source
var (
DefaultToken = Token{}
)
Functions ¶
func StringTokenType ¶
Types ¶
type HoconArray ¶
type HoconArray struct {
// contains filtered or unexported fields
}
func NewHoconArray ¶
func NewHoconArray() *HoconArray
func (*HoconArray) GetArray ¶
func (p *HoconArray) GetArray() []*HoconValue
func (*HoconArray) GetString ¶
func (p *HoconArray) GetString() string
func (*HoconArray) IsArray ¶
func (p *HoconArray) IsArray() bool
func (*HoconArray) IsString ¶
func (p *HoconArray) IsString() bool
func (*HoconArray) String ¶
func (p *HoconArray) String() string
type HoconElement ¶
type HoconElement interface { IsString() bool GetString() string IsArray() bool GetArray() []*HoconValue }
type HoconLiteral ¶
type HoconLiteral struct {
// contains filtered or unexported fields
}
func NewHoconLiteral ¶
func NewHoconLiteral(value string) *HoconLiteral
func (*HoconLiteral) GetArray ¶
func (p *HoconLiteral) GetArray() []*HoconValue
func (*HoconLiteral) GetString ¶
func (p *HoconLiteral) GetString() string
func (*HoconLiteral) IsArray ¶
func (p *HoconLiteral) IsArray() bool
func (*HoconLiteral) IsString ¶
func (p *HoconLiteral) IsString() bool
func (*HoconLiteral) String ¶
func (p *HoconLiteral) String() string
type HoconObject ¶
type HoconObject struct {
// contains filtered or unexported fields
}
func NewHoconObject ¶
func NewHoconObject() *HoconObject
func (*HoconObject) GetArray ¶
func (p *HoconObject) GetArray() []*HoconValue
func (*HoconObject) GetKey ¶
func (p *HoconObject) GetKey(key string) *HoconValue
func (*HoconObject) GetKeys ¶
func (p *HoconObject) GetKeys() []string
func (*HoconObject) GetOrCreateKey ¶
func (p *HoconObject) GetOrCreateKey(key string) *HoconValue
func (*HoconObject) GetString ¶
func (p *HoconObject) GetString() string
func (*HoconObject) IsArray ¶
func (p *HoconObject) IsArray() bool
func (*HoconObject) IsString ¶
func (p *HoconObject) IsString() bool
func (*HoconObject) Items ¶
func (p *HoconObject) Items() map[string]*HoconValue
func (*HoconObject) Merge ¶
func (p *HoconObject) Merge(other *HoconObject)
func (*HoconObject) MergeImmutable ¶
func (p *HoconObject) MergeImmutable(other *HoconObject) *HoconObject
func (*HoconObject) String ¶
func (p *HoconObject) String() string
func (*HoconObject) ToString ¶
func (p *HoconObject) ToString(indent int) string
func (*HoconObject) Unwrapped ¶
func (p *HoconObject) Unwrapped() map[string]interface{}
type HoconRoot ¶
type HoconRoot struct {
// contains filtered or unexported fields
}
func NewHoconRoot ¶
func NewHoconRoot(value *HoconValue, substitutions ...*HoconSubstitution) *HoconRoot
func Parse ¶
func Parse(text string, callback IncludeCallback) *HoconRoot
func (HoconRoot) Substitutions ¶
func (p HoconRoot) Substitutions() []*HoconSubstitution
func (HoconRoot) Value ¶
func (p HoconRoot) Value() *HoconValue
type HoconSubstitution ¶
type HoconSubstitution struct { Path string ResolvedValue *HoconValue IsOptional bool OrignialPath string }
func NewHoconSubstitution ¶
func NewHoconSubstitution(path string, isOptional bool) *HoconSubstitution
func (*HoconSubstitution) GetArray ¶
func (p *HoconSubstitution) GetArray() []*HoconValue
func (*HoconSubstitution) GetObject ¶
func (p *HoconSubstitution) GetObject() *HoconObject
func (*HoconSubstitution) GetString ¶
func (p *HoconSubstitution) GetString() string
func (*HoconSubstitution) IsArray ¶
func (p *HoconSubstitution) IsArray() bool
func (*HoconSubstitution) IsObject ¶
func (p *HoconSubstitution) IsObject() bool
func (*HoconSubstitution) IsString ¶
func (p *HoconSubstitution) IsString() bool
type HoconTokenizer ¶
type HoconTokenizer struct {
*Tokenizer
}
func NewHoconTokenizer ¶
func NewHoconTokenizer(text string) *HoconTokenizer
func (*HoconTokenizer) IsArrayEnd ¶
func (p *HoconTokenizer) IsArrayEnd() bool
func (*HoconTokenizer) IsArrayStart ¶
func (p *HoconTokenizer) IsArrayStart() bool
func (*HoconTokenizer) IsAssignment ¶
func (p *HoconTokenizer) IsAssignment() bool
func (*HoconTokenizer) IsComma ¶
func (p *HoconTokenizer) IsComma() bool
func (*HoconTokenizer) IsDot ¶
func (p *HoconTokenizer) IsDot() bool
func (*HoconTokenizer) IsEndOfObject ¶
func (p *HoconTokenizer) IsEndOfObject() bool
func (*HoconTokenizer) IsInclude ¶
func (p *HoconTokenizer) IsInclude() bool
func (*HoconTokenizer) IsNewline ¶
func (p *HoconTokenizer) IsNewline() bool
func (*HoconTokenizer) IsObjectStart ¶
func (p *HoconTokenizer) IsObjectStart() bool
func (*HoconTokenizer) IsPlusAssignment ¶
func (p *HoconTokenizer) IsPlusAssignment() bool
func (*HoconTokenizer) IsSpaceOrTab ¶
func (p *HoconTokenizer) IsSpaceOrTab() bool
func (*HoconTokenizer) IsStartOfComment ¶
func (p *HoconTokenizer) IsStartOfComment() bool
func (*HoconTokenizer) IsStartOfQuotedText ¶
func (p *HoconTokenizer) IsStartOfQuotedText() bool
func (*HoconTokenizer) IsStartOfTripleQuotedText ¶
func (p *HoconTokenizer) IsStartOfTripleQuotedText() bool
func (*HoconTokenizer) IsStartSimpleValue ¶
func (p *HoconTokenizer) IsStartSimpleValue() bool
func (*HoconTokenizer) IsSubstitutionStart ¶
func (p *HoconTokenizer) IsSubstitutionStart() bool
func (*HoconTokenizer) IsUnquotedKey ¶
func (p *HoconTokenizer) IsUnquotedKey() bool
func (*HoconTokenizer) IsUnquotedKeyStart ¶
func (p *HoconTokenizer) IsUnquotedKeyStart() bool
func (*HoconTokenizer) IsWhitespace ¶
func (p *HoconTokenizer) IsWhitespace() bool
func (*HoconTokenizer) IsWhitespaceOrComment ¶
func (p *HoconTokenizer) IsWhitespaceOrComment() bool
func (*HoconTokenizer) PullArrayEnd ¶
func (p *HoconTokenizer) PullArrayEnd() *Token
func (*HoconTokenizer) PullArrayStart ¶
func (p *HoconTokenizer) PullArrayStart() *Token
func (*HoconTokenizer) PullAssignment ¶
func (p *HoconTokenizer) PullAssignment() *Token
func (*HoconTokenizer) PullComma ¶
func (p *HoconTokenizer) PullComma() *Token
func (*HoconTokenizer) PullComment ¶
func (p *HoconTokenizer) PullComment() *Token
func (*HoconTokenizer) PullDot ¶
func (p *HoconTokenizer) PullDot() *Token
func (*HoconTokenizer) PullEndOfObject ¶
func (p *HoconTokenizer) PullEndOfObject() *Token
func (*HoconTokenizer) PullInclude ¶
func (p *HoconTokenizer) PullInclude() *Token
func (*HoconTokenizer) PullNewline ¶
func (p *HoconTokenizer) PullNewline() *Token
func (*HoconTokenizer) PullNext ¶
func (p *HoconTokenizer) PullNext() (token *Token)
func (*HoconTokenizer) PullPlusAssignment ¶
func (p *HoconTokenizer) PullPlusAssignment() *Token
func (*HoconTokenizer) PullQuotedKey ¶
func (p *HoconTokenizer) PullQuotedKey() *Token
func (*HoconTokenizer) PullQuotedText ¶
func (p *HoconTokenizer) PullQuotedText() *Token
func (*HoconTokenizer) PullRestOfLine ¶
func (p *HoconTokenizer) PullRestOfLine() string
func (*HoconTokenizer) PullSimpleValue ¶
func (p *HoconTokenizer) PullSimpleValue() *Token
func (*HoconTokenizer) PullSpaceOrTab ¶
func (p *HoconTokenizer) PullSpaceOrTab() *Token
func (*HoconTokenizer) PullStartOfObject ¶
func (p *HoconTokenizer) PullStartOfObject() *Token
func (*HoconTokenizer) PullTripleQuotedText ¶
func (p *HoconTokenizer) PullTripleQuotedText() *Token
func (*HoconTokenizer) PullUnquotedKey ¶
func (p *HoconTokenizer) PullUnquotedKey() *Token
func (*HoconTokenizer) PullValue ¶
func (p *HoconTokenizer) PullValue() *Token
func (*HoconTokenizer) PullWhitespaceAndComments ¶
func (p *HoconTokenizer) PullWhitespaceAndComments()
type HoconValue ¶
type HoconValue struct {
// contains filtered or unexported fields
}
func NewHoconValue ¶
func NewHoconValue() *HoconValue
func (*HoconValue) AppendValue ¶
func (p *HoconValue) AppendValue(value HoconElement)
func (*HoconValue) AtKey ¶
func (p *HoconValue) AtKey(key string) *HoconRoot
func (*HoconValue) Clear ¶
func (p *HoconValue) Clear()
func (*HoconValue) GetArray ¶
func (p *HoconValue) GetArray() []*HoconValue
func (*HoconValue) GetBoolean ¶
func (p *HoconValue) GetBoolean() bool
func (*HoconValue) GetBooleanList ¶
func (p *HoconValue) GetBooleanList() []bool
func (*HoconValue) GetByte ¶
func (p *HoconValue) GetByte() byte
func (*HoconValue) GetByteList ¶
func (p *HoconValue) GetByteList() []byte
func (*HoconValue) GetByteSize ¶
func (p *HoconValue) GetByteSize() *big.Int
func (*HoconValue) GetChildObject ¶
func (p *HoconValue) GetChildObject(key string) *HoconValue
func (*HoconValue) GetFloat32 ¶
func (p *HoconValue) GetFloat32() float32
func (*HoconValue) GetFloat32List ¶
func (p *HoconValue) GetFloat32List() []float32
func (*HoconValue) GetFloat64 ¶
func (p *HoconValue) GetFloat64() float64
func (*HoconValue) GetFloat64List ¶
func (p *HoconValue) GetFloat64List() []float64
func (*HoconValue) GetInt32 ¶
func (p *HoconValue) GetInt32() int32
func (*HoconValue) GetInt32List ¶
func (p *HoconValue) GetInt32List() []int32
func (*HoconValue) GetInt64 ¶
func (p *HoconValue) GetInt64() int64
func (*HoconValue) GetInt64List ¶
func (p *HoconValue) GetInt64List() []int64
func (*HoconValue) GetObject ¶
func (p *HoconValue) GetObject() *HoconObject
func (*HoconValue) GetString ¶
func (p *HoconValue) GetString() string
func (*HoconValue) GetStringList ¶
func (p *HoconValue) GetStringList() []string
func (*HoconValue) GetTimeDuration ¶
func (p *HoconValue) GetTimeDuration(allowInfinite bool) time.Duration
func (*HoconValue) IsArray ¶
func (p *HoconValue) IsArray() bool
func (*HoconValue) IsEmpty ¶
func (p *HoconValue) IsEmpty() bool
func (*HoconValue) IsObject ¶
func (p *HoconValue) IsObject() bool
func (*HoconValue) IsString ¶
func (p *HoconValue) IsString() bool
func (*HoconValue) NewValue ¶
func (p *HoconValue) NewValue(value HoconElement)
func (*HoconValue) String ¶
func (p *HoconValue) String() string
func (*HoconValue) ToString ¶
func (p *HoconValue) ToString(indent int) string
type IncludeCallback ¶
type MightBeAHoconObject ¶
type MightBeAHoconObject interface { IsObject() bool GetObject() *HoconObject }
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) ParseArray ¶
func (p *Parser) ParseArray(currentPath string) HoconArray
func (*Parser) ParseSubstitution ¶
func (p *Parser) ParseSubstitution(value string, isOptional bool) *HoconSubstitution
func (*Parser) ParseTrailingWhitespace ¶
func (p *Parser) ParseTrailingWhitespace(owner *HoconValue)
func (*Parser) ParseValue ¶
func (p *Parser) ParseValue(owner *HoconValue, isEqualPlus bool, currentPath string)
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
func (*Token) LiteralValue ¶
type TokenType ¶
type TokenType int
const ( TokenTypeNone TokenType = iota TokenTypeComment TokenTypeKey TokenTypeLiteralValue TokenTypeAssign TokenTypePlusAssign TokenTypeObjectStart TokenTypeObjectEnd TokenTypeDot TokenTypeNewline TokenTypeEoF TokenTypeArrayStart TokenTypeArrayEnd TokenTypeComma TokenTypeSubstitute TokenTypeInclude )
type Tokenizer ¶
type Tokenizer struct {
// contains filtered or unexported fields
}
func NewTokenizer ¶
func (*Tokenizer) MatchesMore ¶
func (*Tokenizer) PullWhitespace ¶
func (p *Tokenizer) PullWhitespace()
Click to show internal directories.
Click to hide internal directories.