Documentation
¶
Index ¶
- Variables
- func GetArray() *[]any
- func GetByteSlice() *[]byte
- func GetMap() *map[string]any
- func PutArray(a *[]any)
- func PutByteSlice(b *[]byte)
- func PutMap(m *map[string]any)
- func ReleaseScanner(s *Scanner)
- type Config
- func (c *Config) Error(msg string) error
- func (c *Config) Get(key string) (any, error)
- func (c *Config) GetArray(key string) ([]any, error)
- func (c *Config) GetBool(key string) (bool, error)
- func (c *Config) GetData() map[string]any
- func (c *Config) GetFloat(key string) (float64, error)
- func (c *Config) GetInt(key string) (int, error)
- func (c *Config) GetMap(key string) (map[string]any, error)
- func (c *Config) GetOr(key string, defaultValue any) any
- func (c *Config) GetString(key string) (string, error)
- func (c *Config) Parse(r io.Reader) error
- func (c *Config) Release()
- type Scanner
- func (s *Scanner) Error(msg string) error
- func (s *Scanner) NextToken() (Token, error)
- func (s *Scanner) PeekByte() (byte, error)
- func (s *Scanner) PeekBytes(n int) ([]byte, error)
- func (s *Scanner) ReadByte() (byte, error)
- func (s *Scanner) SkipWhitespace() error
- func (s *Scanner) UnreadByte() error
- func (s *Scanner) UnreadToken(token Token)
- type Token
- type TokenType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnterminatedString = errors.New("unterminated string") ErrUnterminatedEscape = errors.New("unterminated escape sequence") ErrUnterminatedComment = errors.New("unclosed block comment") ErrInvalidComment = errors.New("invalid comment") ErrNameStartWithLetter = errors.New("name must start with letter") )
Pre-declared errors to reduce allocations
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds a single hierarchical structure and handles parsing
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner handles the low-level parsing of the configuration format
func NewScanner ¶
NewScanner creates a new scanner from a pool
func (*Scanner) SkipWhitespace ¶
SkipWhitespace skips whitespace characters
func (*Scanner) UnreadByte ¶
UnreadByte pushes back a byte to the reader
func (*Scanner) UnreadToken ¶
UnreadToken stores a token to be returned by the next call to NextToken
Click to show internal directories.
Click to hide internal directories.