Documentation ¶
Overview ¶
The package can translate your json-schema data to json data, if you have set default value, it will be translated too It depends on simpleson: https://github.com/simplejson/simplejson
Index ¶
- Constants
- func NewSchema(data string) *schema
- func Version() string
- type JSONData
- func (j *JSONData) Array(path ...interface{}) ([]interface{}, error)
- func (j *JSONData) Bool(path ...interface{}) (bool, error)
- func (j *JSONData) Data() []byte
- func (j *JSONData) Float64(path ...interface{}) (float64, error)
- func (j *JSONData) FormatString() string
- func (j *JSONData) GetJSON(path ...interface{}) (*JSONData, error)
- func (j *JSONData) Int(path ...interface{}) (int, error)
- func (j *JSONData) Int64(path ...interface{}) (int64, error)
- func (j *JSONData) Interface(path ...interface{}) (interface{}, error)
- func (j *JSONData) Map(path ...interface{}) (map[string]interface{}, error)
- func (j *JSONData) Set(key string, value interface{}) (string, error)
- func (j *JSONData) SetPath(v interface{}, path ...string) error
- func (j *JSONData) StrArray(path ...interface{}) ([]string, error)
- func (j *JSONData) String(path ...interface{}) (string, error)
- func (j *JSONData) Uint64(path ...interface{}) (uint64, error)
Constants ¶
View Source
const ( NotValidJSONSchema = "valid JSON schema data" NotValidMap = "is not a map" )
View Source
const (
NotValid = "data is not valid"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JSONData ¶
type JSONData struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.