Documentation ¶
Overview ¶
Package json the json parser
Index ¶
- type Parser
- func (p Parser) GetElement(ctx *plugin.Context, content any, arg string) (string, error)
- func (p Parser) GetElements(ctx *plugin.Context, content any, arg string) ([]string, error)
- func (p Parser) GetString(_ *plugin.Context, content any, arg string) (string, error)
- func (p Parser) GetStrings(_ *plugin.Context, content any, arg string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct{}
Parser the json parser
func (Parser) GetElement ¶
GetElement gets the element of the content with the given arguments. sames as the GetString.
func (Parser) GetElements ¶
GetElements gets the elements of the content with the given arguments. sames as the GetStrings.
func (Parser) GetString ¶
GetString gets the string of the content with the given arguments.
content := `{"keys": [{"key":"foo"},{"key":"bar"}]}` GetString(ctx, content, "$.key[*].key") returns "foo\nbar"
func (Parser) GetStrings ¶
GetStrings gets the strings of the content with the given arguments.
content := `{"keys": [{"key":"foo"},{"key":"bar"}]}` GetStrings(ctx, content, "$.key[*].key") returns []string{"foo", "bar"}
Click to show internal directories.
Click to hide internal directories.