Documentation
ΒΆ
Index ΒΆ
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
This section is empty.
Types ΒΆ
type JSONArray ΒΆ
type JSONArray struct {
Values []JSONEntity
}
func UnmarshalJSONArrayFromTokenizer ΒΆ
func UnmarshalJSONArrayFromTokenizer(t *JSONTokenizer) (JSONArray, error)
func (*JSONArray) Put ΒΆ
func (arr *JSONArray) Put(value JSONEntity) error
type JSONEntity ΒΆ
type JSONObject ΒΆ
type JSONObject struct {
Values map[string]JSONEntity
}
func Unmarshal ΒΆ
func Unmarshal(input any) (JSONObject, error)
func UnmarshalFromGenericMap ΒΆ
func UnmarshalFromGenericMap(input map[string]any) JSONObject
func UnmarshalFromMap ΒΆ
func UnmarshalFromMap(input map[string]JSONEntity) JSONObject
func UnmarshalFromString ΒΆ
func UnmarshalFromString(input string) (JSONObject, error)
func UnmarshalFromTokenizer ΒΆ
func UnmarshalFromTokenizer(t *JSONTokenizer) (JSONObject, error)
func (*JSONObject) Get ΒΆ
func (obj *JSONObject) Get(key string) JSONEntity
func (*JSONObject) Print ΒΆ
func (obj *JSONObject) Print()
func (*JSONObject) Put ΒΆ
func (obj *JSONObject) Put(key string, value JSONEntity) error
func (*JSONObject) String ΒΆ
func (obj *JSONObject) String(depth int) string
type JSONTokenizer ΒΆ
type JSONTokenizer struct {
// CurrentCharacterPosition is the current read character position on the current line.
CurrentCharacterPosition int64
// Eof indicate if the end of the input has been found.
Eof bool
// Index indicate the current read index of the input.
Index int64
// Line indicate the current line of the input.
Line int64
// Previous is the previous character read from the input.
Previous rune
// Reader for the input.
Reader *bufio.Reader
// UsePrevious is a flag to indicate that a previous character was requested.
UsePrevious bool
// CharactersPreviousLine is the number of characters read in the previous line.
CharactersPreviousLine int64
}
func NewJSONTokenizer ΒΆ
func NewJSONTokenizer(input string) *JSONTokenizer
func (*JSONTokenizer) Back ΒΆ
func (t *JSONTokenizer) Back() error
Back allow the tokenizer to go back one character. If the tokenizer is at the beginning of the input or if the tokenizr is already set to use the previous character, an error is returned.
func (*JSONTokenizer) Next ΒΆ
func (t *JSONTokenizer) Next() (rune, error)
Next returns the next character from the input. If the end of the input is reached, EOF is returned.
func (*JSONTokenizer) NextCharacter ΒΆ
func (t *JSONTokenizer) NextCharacter() (rune, error)
NextCharacter returns the next character from the input excluding whitespaces.
func (*JSONTokenizer) NextString ΒΆ
func (t *JSONTokenizer) NextString() (string, error)
func (*JSONTokenizer) NextValue ΒΆ
func (t *JSONTokenizer) NextValue() (JSONEntity, error)
func (*JSONTokenizer) Peek ΒΆ
func (t *JSONTokenizer) Peek() (rune, error)
Peek returns the next character from the input without advancing the tokenizer.
type JSONValue ΒΆ
type JSONValue struct {
JSONValueType
}
func CreateJSONValue ΒΆ
func (*JSONValue) Set ΒΆ
func (obj *JSONValue) Set(value JSONValueType) error
type JSONValueType ΒΆ
type JSONValueType interface {
// contains filtered or unexported methods
}
Source Files
ΒΆ
Click to show internal directories.
Click to hide internal directories.