Documentation ¶
Index ¶
- type JSONHelper
- func (instance *JSONHelper) Bytes(entity interface{}) []byte
- func (instance *JSONHelper) BytesToArray(data []byte) ([]interface{}, bool)
- func (instance *JSONHelper) BytesToMap(data []byte) (map[string]interface{}, bool)
- func (instance *JSONHelper) IsDelimitedJson(s string) bool
- func (instance *JSONHelper) IsValidJson(text string) bool
- func (instance *JSONHelper) IsValidJsonArray(text string) bool
- func (instance *JSONHelper) IsValidJsonObject(text string) bool
- func (instance *JSONHelper) Parse(input interface{}) interface{}
- func (instance *JSONHelper) Read(input interface{}, entity interface{}) (err error)
- func (instance *JSONHelper) ReadArrayFromFile(fileName string) ([]map[string]interface{}, error)
- func (instance *JSONHelper) ReadFromFile(fileName string, entity interface{}) error
- func (instance *JSONHelper) ReadMapFromFile(fileName string) (map[string]interface{}, error)
- func (instance *JSONHelper) StringToArray(text string) ([]interface{}, bool)
- func (instance *JSONHelper) StringToMap(text string) (map[string]interface{}, bool)
- func (instance *JSONHelper) Stringify(entity interface{}) string
- func (instance *JSONHelper) TextExtractor(input interface{}) *JsonExtractor
- func (instance *JSONHelper) Wrap(input interface{}) *JSONWrap
- type JSONWrap
- func (instance *JSONWrap) Array() []map[string]interface{}
- func (instance *JSONWrap) AsArray() (response []map[string]interface{}, err error)
- func (instance *JSONWrap) AsMap() (response map[string]interface{}, err error)
- func (instance *JSONWrap) Error() error
- func (instance *JSONWrap) HasError() bool
- func (instance *JSONWrap) IsArray() bool
- func (instance *JSONWrap) IsMap() bool
- func (instance *JSONWrap) IsUnknown() bool
- func (instance *JSONWrap) Kind() string
- func (instance *JSONWrap) KindRt() reflect.Kind
- func (instance *JSONWrap) Map() map[string]interface{}
- func (instance *JSONWrap) String() string
- func (instance *JSONWrap) Value() interface{}
- type JsonExtractor
- func (instance *JsonExtractor) Get() (response interface{})
- func (instance *JsonExtractor) GetObjects() (response []*JSONWrap, err error)
- func (instance *JsonExtractor) LoadFromFile(filename string) *JsonExtractor
- func (instance *JsonExtractor) String() string
- func (instance *JsonExtractor) Write(value interface{}) *JsonExtractor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONHelper ¶
type JSONHelper struct { }
var JSON *JSONHelper
func (*JSONHelper) Bytes ¶
func (instance *JSONHelper) Bytes(entity interface{}) []byte
func (*JSONHelper) BytesToArray ¶
func (instance *JSONHelper) BytesToArray(data []byte) ([]interface{}, bool)
func (*JSONHelper) BytesToMap ¶
func (instance *JSONHelper) BytesToMap(data []byte) (map[string]interface{}, bool)
func (*JSONHelper) IsDelimitedJson ¶
func (instance *JSONHelper) IsDelimitedJson(s string) bool
func (*JSONHelper) IsValidJson ¶
func (instance *JSONHelper) IsValidJson(text string) bool
func (*JSONHelper) IsValidJsonArray ¶
func (instance *JSONHelper) IsValidJsonArray(text string) bool
func (*JSONHelper) IsValidJsonObject ¶
func (instance *JSONHelper) IsValidJsonObject(text string) bool
func (*JSONHelper) Parse ¶
func (instance *JSONHelper) Parse(input interface{}) interface{}
func (*JSONHelper) Read ¶
func (instance *JSONHelper) Read(input interface{}, entity interface{}) (err error)
Read Support inputs like maps, strings and byte arrays.
func (*JSONHelper) ReadArrayFromFile ¶
func (instance *JSONHelper) ReadArrayFromFile(fileName string) ([]map[string]interface{}, error)
func (*JSONHelper) ReadFromFile ¶
func (instance *JSONHelper) ReadFromFile(fileName string, entity interface{}) error
func (*JSONHelper) ReadMapFromFile ¶
func (instance *JSONHelper) ReadMapFromFile(fileName string) (map[string]interface{}, error)
func (*JSONHelper) StringToArray ¶
func (instance *JSONHelper) StringToArray(text string) ([]interface{}, bool)
func (*JSONHelper) StringToMap ¶
func (instance *JSONHelper) StringToMap(text string) (map[string]interface{}, bool)
func (*JSONHelper) Stringify ¶
func (instance *JSONHelper) Stringify(entity interface{}) string
func (*JSONHelper) TextExtractor ¶
func (instance *JSONHelper) TextExtractor(input interface{}) *JsonExtractor
func (*JSONHelper) Wrap ¶
func (instance *JSONHelper) Wrap(input interface{}) *JSONWrap
type JSONWrap ¶
type JSONWrap struct {
// contains filtered or unexported fields
}
JSONWrap simple wrapper for JSON objects
func NewJSONWrap ¶
func NewJSONWrap(value interface{}) (instance *JSONWrap)
type JsonExtractor ¶
type JsonExtractor struct {
// contains filtered or unexported fields
}
JsonExtractor extract json objects from a text file or from long text
func NewJsonExtractor ¶
func NewJsonExtractor() (instance *JsonExtractor)
func (*JsonExtractor) Get ¶
func (instance *JsonExtractor) Get() (response interface{})
Get parse a text to detect and extract all JSON objects or arrays found. Returns an object or an array of objects or arrays
func (*JsonExtractor) GetObjects ¶
func (instance *JsonExtractor) GetObjects() (response []*JSONWrap, err error)
func (*JsonExtractor) LoadFromFile ¶
func (instance *JsonExtractor) LoadFromFile(filename string) *JsonExtractor
func (*JsonExtractor) String ¶
func (instance *JsonExtractor) String() string
func (*JsonExtractor) Write ¶
func (instance *JsonExtractor) Write(value interface{}) *JsonExtractor
Click to show internal directories.
Click to hide internal directories.