Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type FileParser ¶
type FileParser interface {
GetProperty(fileBytes []byte, pp *ParsedPath) (*ParsedProperty, error)
}
FileParser is a base interface that works with file content and returns a property based on provided path
type JsonFileParser ¶
type JsonFileParser struct { }
func (*JsonFileParser) GetProperty ¶
func (j *JsonFileParser) GetProperty(fileBytes []byte, pp *ParsedPath) (*ParsedProperty, error)
type ParsedPath ¶
type ParsedPath struct {
Elements []string
}
ParsedPath describes steps of searching for a property in a file content
func ParsePath ¶
func ParsePath(propertyPath string) (*ParsedPath, error)
func (*ParsedPath) String ¶
func (p *ParsedPath) String() string
type ParsedProperty ¶
type ParsedProperty struct { // Start cursor position of the first character of the value. Starts from 0 Start int // End cursor position of the next character after the last one of the value End int // Text text representation of the value Text string // Type describes type of the value Type PropertyType // QuotesType describes used type of quotes QuotesType QuotesType }
ParsedProperty describes a found property
type PropertyType ¶
type PropertyType int
const ( PropertyTypeString PropertyType = 1 << iota PropertyTypeNumber PropertyTypeBool PropertyTypeNull )
type QuotesType ¶
type QuotesType int
const ( QuotesTypeNone QuotesType = 1 << iota QuotesTypeSingular QuotesTypeDouble )
type XmlFileParser ¶
type XmlFileParser struct { }
func (*XmlFileParser) GetProperty ¶
func (j *XmlFileParser) GetProperty(fileBytes []byte, pp *ParsedPath) (*ParsedProperty, error)
type YamlFileParser ¶
type YamlFileParser struct { }
func (*YamlFileParser) GetProperty ¶
func (p *YamlFileParser) GetProperty(fileBytes []byte, pp *ParsedPath) (*ParsedProperty, error)
Click to show internal directories.
Click to hide internal directories.