", context))
- if err != nil {
- return nil, err
- }
- x.Schema = append(x.Schema, y)
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewJsonReference creates an object of type JsonReference if possible, returning an error if not.
-func NewJsonReference(in interface{}, context *compiler.Context) (*JsonReference, error) {
- errors := make([]error, 0)
- x := &JsonReference{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"$ref"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- allowedKeys := []string{"$ref", "description"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string _ref = 1;
- v1 := compiler.MapValueForKey(m, "$ref")
- if v1 != nil {
- x.XRef, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for $ref: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string description = 2;
- v2 := compiler.MapValueForKey(m, "description")
- if v2 != nil {
- x.Description, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewLicense creates an object of type License if possible, returning an error if not.
-func NewLicense(in interface{}, context *compiler.Context) (*License, error) {
- errors := make([]error, 0)
- x := &License{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"name"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- allowedKeys := []string{"name", "url"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string url = 2;
- v2 := compiler.MapValueForKey(m, "url")
- if v2 != nil {
- x.Url, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for url: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated NamedAny vendor_extension = 3;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNamedAny creates an object of type NamedAny if possible, returning an error if not.
-func NewNamedAny(in interface{}, context *compiler.Context) (*NamedAny, error) {
- errors := make([]error, 0)
- x := &NamedAny{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"name", "value"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Any value = 2;
- v2 := compiler.MapValueForKey(m, "value")
- if v2 != nil {
- var err error
- x.Value, err = NewAny(v2, compiler.NewContext("value", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNamedHeader creates an object of type NamedHeader if possible, returning an error if not.
-func NewNamedHeader(in interface{}, context *compiler.Context) (*NamedHeader, error) {
- errors := make([]error, 0)
- x := &NamedHeader{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"name", "value"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Header value = 2;
- v2 := compiler.MapValueForKey(m, "value")
- if v2 != nil {
- var err error
- x.Value, err = NewHeader(v2, compiler.NewContext("value", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNamedParameter creates an object of type NamedParameter if possible, returning an error if not.
-func NewNamedParameter(in interface{}, context *compiler.Context) (*NamedParameter, error) {
- errors := make([]error, 0)
- x := &NamedParameter{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"name", "value"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Parameter value = 2;
- v2 := compiler.MapValueForKey(m, "value")
- if v2 != nil {
- var err error
- x.Value, err = NewParameter(v2, compiler.NewContext("value", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNamedPathItem creates an object of type NamedPathItem if possible, returning an error if not.
-func NewNamedPathItem(in interface{}, context *compiler.Context) (*NamedPathItem, error) {
- errors := make([]error, 0)
- x := &NamedPathItem{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"name", "value"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // PathItem value = 2;
- v2 := compiler.MapValueForKey(m, "value")
- if v2 != nil {
- var err error
- x.Value, err = NewPathItem(v2, compiler.NewContext("value", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNamedResponse creates an object of type NamedResponse if possible, returning an error if not.
-func NewNamedResponse(in interface{}, context *compiler.Context) (*NamedResponse, error) {
- errors := make([]error, 0)
- x := &NamedResponse{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"name", "value"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Response value = 2;
- v2 := compiler.MapValueForKey(m, "value")
- if v2 != nil {
- var err error
- x.Value, err = NewResponse(v2, compiler.NewContext("value", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNamedResponseValue creates an object of type NamedResponseValue if possible, returning an error if not.
-func NewNamedResponseValue(in interface{}, context *compiler.Context) (*NamedResponseValue, error) {
- errors := make([]error, 0)
- x := &NamedResponseValue{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"name", "value"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // ResponseValue value = 2;
- v2 := compiler.MapValueForKey(m, "value")
- if v2 != nil {
- var err error
- x.Value, err = NewResponseValue(v2, compiler.NewContext("value", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNamedSchema creates an object of type NamedSchema if possible, returning an error if not.
-func NewNamedSchema(in interface{}, context *compiler.Context) (*NamedSchema, error) {
- errors := make([]error, 0)
- x := &NamedSchema{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"name", "value"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Schema value = 2;
- v2 := compiler.MapValueForKey(m, "value")
- if v2 != nil {
- var err error
- x.Value, err = NewSchema(v2, compiler.NewContext("value", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNamedSecurityDefinitionsItem creates an object of type NamedSecurityDefinitionsItem if possible, returning an error if not.
-func NewNamedSecurityDefinitionsItem(in interface{}, context *compiler.Context) (*NamedSecurityDefinitionsItem, error) {
- errors := make([]error, 0)
- x := &NamedSecurityDefinitionsItem{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"name", "value"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // SecurityDefinitionsItem value = 2;
- v2 := compiler.MapValueForKey(m, "value")
- if v2 != nil {
- var err error
- x.Value, err = NewSecurityDefinitionsItem(v2, compiler.NewContext("value", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNamedString creates an object of type NamedString if possible, returning an error if not.
-func NewNamedString(in interface{}, context *compiler.Context) (*NamedString, error) {
- errors := make([]error, 0)
- x := &NamedString{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"name", "value"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string value = 2;
- v2 := compiler.MapValueForKey(m, "value")
- if v2 != nil {
- x.Value, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for value: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNamedStringArray creates an object of type NamedStringArray if possible, returning an error if not.
-func NewNamedStringArray(in interface{}, context *compiler.Context) (*NamedStringArray, error) {
- errors := make([]error, 0)
- x := &NamedStringArray{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"name", "value"}
- var allowedPatterns []*regexp.Regexp
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // StringArray value = 2;
- v2 := compiler.MapValueForKey(m, "value")
- if v2 != nil {
- var err error
- x.Value, err = NewStringArray(v2, compiler.NewContext("value", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewNonBodyParameter creates an object of type NonBodyParameter if possible, returning an error if not.
-func NewNonBodyParameter(in interface{}, context *compiler.Context) (*NonBodyParameter, error) {
- errors := make([]error, 0)
- x := &NonBodyParameter{}
- matched := false
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"in", "name", "type"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // HeaderParameterSubSchema header_parameter_sub_schema = 1;
- {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewHeaderParameterSubSchema(m, compiler.NewContext("headerParameterSubSchema", context))
- if matchingError == nil {
- x.Oneof = &NonBodyParameter_HeaderParameterSubSchema{HeaderParameterSubSchema: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- // FormDataParameterSubSchema form_data_parameter_sub_schema = 2;
- {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewFormDataParameterSubSchema(m, compiler.NewContext("formDataParameterSubSchema", context))
- if matchingError == nil {
- x.Oneof = &NonBodyParameter_FormDataParameterSubSchema{FormDataParameterSubSchema: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- // QueryParameterSubSchema query_parameter_sub_schema = 3;
- {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewQueryParameterSubSchema(m, compiler.NewContext("queryParameterSubSchema", context))
- if matchingError == nil {
- x.Oneof = &NonBodyParameter_QueryParameterSubSchema{QueryParameterSubSchema: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- // PathParameterSubSchema path_parameter_sub_schema = 4;
- {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewPathParameterSubSchema(m, compiler.NewContext("pathParameterSubSchema", context))
- if matchingError == nil {
- x.Oneof = &NonBodyParameter_PathParameterSubSchema{PathParameterSubSchema: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- if matched {
- // since the oneof matched one of its possibilities, discard any matching errors
- errors = make([]error, 0)
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewOauth2AccessCodeSecurity creates an object of type Oauth2AccessCodeSecurity if possible, returning an error if not.
-func NewOauth2AccessCodeSecurity(in interface{}, context *compiler.Context) (*Oauth2AccessCodeSecurity, error) {
- errors := make([]error, 0)
- x := &Oauth2AccessCodeSecurity{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"authorizationUrl", "flow", "tokenUrl", "type"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- allowedKeys := []string{"authorizationUrl", "description", "flow", "scopes", "tokenUrl", "type"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string type = 1;
- v1 := compiler.MapValueForKey(m, "type")
- if v1 != nil {
- x.Type, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [oauth2]
- if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string flow = 2;
- v2 := compiler.MapValueForKey(m, "flow")
- if v2 != nil {
- x.Flow, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [accessCode]
- if ok && !compiler.StringArrayContainsValue([]string{"accessCode"}, x.Flow) {
- message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Oauth2Scopes scopes = 3;
- v3 := compiler.MapValueForKey(m, "scopes")
- if v3 != nil {
- var err error
- x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // string authorization_url = 4;
- v4 := compiler.MapValueForKey(m, "authorizationUrl")
- if v4 != nil {
- x.AuthorizationUrl, ok = v4.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for authorizationUrl: %+v (%T)", v4, v4)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string token_url = 5;
- v5 := compiler.MapValueForKey(m, "tokenUrl")
- if v5 != nil {
- x.TokenUrl, ok = v5.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for tokenUrl: %+v (%T)", v5, v5)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string description = 6;
- v6 := compiler.MapValueForKey(m, "description")
- if v6 != nil {
- x.Description, ok = v6.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v6, v6)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated NamedAny vendor_extension = 7;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewOauth2ApplicationSecurity creates an object of type Oauth2ApplicationSecurity if possible, returning an error if not.
-func NewOauth2ApplicationSecurity(in interface{}, context *compiler.Context) (*Oauth2ApplicationSecurity, error) {
- errors := make([]error, 0)
- x := &Oauth2ApplicationSecurity{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"flow", "tokenUrl", "type"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- allowedKeys := []string{"description", "flow", "scopes", "tokenUrl", "type"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string type = 1;
- v1 := compiler.MapValueForKey(m, "type")
- if v1 != nil {
- x.Type, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [oauth2]
- if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string flow = 2;
- v2 := compiler.MapValueForKey(m, "flow")
- if v2 != nil {
- x.Flow, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [application]
- if ok && !compiler.StringArrayContainsValue([]string{"application"}, x.Flow) {
- message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Oauth2Scopes scopes = 3;
- v3 := compiler.MapValueForKey(m, "scopes")
- if v3 != nil {
- var err error
- x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // string token_url = 4;
- v4 := compiler.MapValueForKey(m, "tokenUrl")
- if v4 != nil {
- x.TokenUrl, ok = v4.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for tokenUrl: %+v (%T)", v4, v4)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string description = 5;
- v5 := compiler.MapValueForKey(m, "description")
- if v5 != nil {
- x.Description, ok = v5.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v5, v5)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated NamedAny vendor_extension = 6;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewOauth2ImplicitSecurity creates an object of type Oauth2ImplicitSecurity if possible, returning an error if not.
-func NewOauth2ImplicitSecurity(in interface{}, context *compiler.Context) (*Oauth2ImplicitSecurity, error) {
- errors := make([]error, 0)
- x := &Oauth2ImplicitSecurity{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"authorizationUrl", "flow", "type"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- allowedKeys := []string{"authorizationUrl", "description", "flow", "scopes", "type"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string type = 1;
- v1 := compiler.MapValueForKey(m, "type")
- if v1 != nil {
- x.Type, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [oauth2]
- if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string flow = 2;
- v2 := compiler.MapValueForKey(m, "flow")
- if v2 != nil {
- x.Flow, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [implicit]
- if ok && !compiler.StringArrayContainsValue([]string{"implicit"}, x.Flow) {
- message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Oauth2Scopes scopes = 3;
- v3 := compiler.MapValueForKey(m, "scopes")
- if v3 != nil {
- var err error
- x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // string authorization_url = 4;
- v4 := compiler.MapValueForKey(m, "authorizationUrl")
- if v4 != nil {
- x.AuthorizationUrl, ok = v4.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for authorizationUrl: %+v (%T)", v4, v4)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string description = 5;
- v5 := compiler.MapValueForKey(m, "description")
- if v5 != nil {
- x.Description, ok = v5.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v5, v5)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated NamedAny vendor_extension = 6;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewOauth2PasswordSecurity creates an object of type Oauth2PasswordSecurity if possible, returning an error if not.
-func NewOauth2PasswordSecurity(in interface{}, context *compiler.Context) (*Oauth2PasswordSecurity, error) {
- errors := make([]error, 0)
- x := &Oauth2PasswordSecurity{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"flow", "tokenUrl", "type"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- allowedKeys := []string{"description", "flow", "scopes", "tokenUrl", "type"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string type = 1;
- v1 := compiler.MapValueForKey(m, "type")
- if v1 != nil {
- x.Type, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [oauth2]
- if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string flow = 2;
- v2 := compiler.MapValueForKey(m, "flow")
- if v2 != nil {
- x.Flow, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [password]
- if ok && !compiler.StringArrayContainsValue([]string{"password"}, x.Flow) {
- message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Oauth2Scopes scopes = 3;
- v3 := compiler.MapValueForKey(m, "scopes")
- if v3 != nil {
- var err error
- x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // string token_url = 4;
- v4 := compiler.MapValueForKey(m, "tokenUrl")
- if v4 != nil {
- x.TokenUrl, ok = v4.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for tokenUrl: %+v (%T)", v4, v4)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string description = 5;
- v5 := compiler.MapValueForKey(m, "description")
- if v5 != nil {
- x.Description, ok = v5.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v5, v5)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated NamedAny vendor_extension = 6;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewOauth2Scopes creates an object of type Oauth2Scopes if possible, returning an error if not.
-func NewOauth2Scopes(in interface{}, context *compiler.Context) (*Oauth2Scopes, error) {
- errors := make([]error, 0)
- x := &Oauth2Scopes{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- // repeated NamedString additional_properties = 1;
- // MAP: string
- x.AdditionalProperties = make([]*NamedString, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- pair := &NamedString{}
- pair.Name = k
- pair.Value = v.(string)
- x.AdditionalProperties = append(x.AdditionalProperties, pair)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewOperation creates an object of type Operation if possible, returning an error if not.
-func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) {
- errors := make([]error, 0)
- x := &Operation{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"responses"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- allowedKeys := []string{"consumes", "deprecated", "description", "externalDocs", "operationId", "parameters", "produces", "responses", "schemes", "security", "summary", "tags"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // repeated string tags = 1;
- v1 := compiler.MapValueForKey(m, "tags")
- if v1 != nil {
- v, ok := v1.([]interface{})
- if ok {
- x.Tags = compiler.ConvertInterfaceArrayToStringArray(v)
- } else {
- message := fmt.Sprintf("has unexpected value for tags: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string summary = 2;
- v2 := compiler.MapValueForKey(m, "summary")
- if v2 != nil {
- x.Summary, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for summary: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string description = 3;
- v3 := compiler.MapValueForKey(m, "description")
- if v3 != nil {
- x.Description, ok = v3.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // ExternalDocs external_docs = 4;
- v4 := compiler.MapValueForKey(m, "externalDocs")
- if v4 != nil {
- var err error
- x.ExternalDocs, err = NewExternalDocs(v4, compiler.NewContext("externalDocs", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // string operation_id = 5;
- v5 := compiler.MapValueForKey(m, "operationId")
- if v5 != nil {
- x.OperationId, ok = v5.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for operationId: %+v (%T)", v5, v5)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated string produces = 6;
- v6 := compiler.MapValueForKey(m, "produces")
- if v6 != nil {
- v, ok := v6.([]interface{})
- if ok {
- x.Produces = compiler.ConvertInterfaceArrayToStringArray(v)
- } else {
- message := fmt.Sprintf("has unexpected value for produces: %+v (%T)", v6, v6)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated string consumes = 7;
- v7 := compiler.MapValueForKey(m, "consumes")
- if v7 != nil {
- v, ok := v7.([]interface{})
- if ok {
- x.Consumes = compiler.ConvertInterfaceArrayToStringArray(v)
- } else {
- message := fmt.Sprintf("has unexpected value for consumes: %+v (%T)", v7, v7)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated ParametersItem parameters = 8;
- v8 := compiler.MapValueForKey(m, "parameters")
- if v8 != nil {
- // repeated ParametersItem
- x.Parameters = make([]*ParametersItem, 0)
- a, ok := v8.([]interface{})
- if ok {
- for _, item := range a {
- y, err := NewParametersItem(item, compiler.NewContext("parameters", context))
- if err != nil {
- errors = append(errors, err)
- }
- x.Parameters = append(x.Parameters, y)
- }
- }
- }
- // Responses responses = 9;
- v9 := compiler.MapValueForKey(m, "responses")
- if v9 != nil {
- var err error
- x.Responses, err = NewResponses(v9, compiler.NewContext("responses", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // repeated string schemes = 10;
- v10 := compiler.MapValueForKey(m, "schemes")
- if v10 != nil {
- v, ok := v10.([]interface{})
- if ok {
- x.Schemes = compiler.ConvertInterfaceArrayToStringArray(v)
- } else {
- message := fmt.Sprintf("has unexpected value for schemes: %+v (%T)", v10, v10)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [http https ws wss]
- if ok && !compiler.StringArrayContainsValues([]string{"http", "https", "ws", "wss"}, x.Schemes) {
- message := fmt.Sprintf("has unexpected value for schemes: %+v", v10)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool deprecated = 11;
- v11 := compiler.MapValueForKey(m, "deprecated")
- if v11 != nil {
- x.Deprecated, ok = v11.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for deprecated: %+v (%T)", v11, v11)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated SecurityRequirement security = 12;
- v12 := compiler.MapValueForKey(m, "security")
- if v12 != nil {
- // repeated SecurityRequirement
- x.Security = make([]*SecurityRequirement, 0)
- a, ok := v12.([]interface{})
- if ok {
- for _, item := range a {
- y, err := NewSecurityRequirement(item, compiler.NewContext("security", context))
- if err != nil {
- errors = append(errors, err)
- }
- x.Security = append(x.Security, y)
- }
- }
- }
- // repeated NamedAny vendor_extension = 13;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewParameter creates an object of type Parameter if possible, returning an error if not.
-func NewParameter(in interface{}, context *compiler.Context) (*Parameter, error) {
- errors := make([]error, 0)
- x := &Parameter{}
- matched := false
- // BodyParameter body_parameter = 1;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewBodyParameter(m, compiler.NewContext("bodyParameter", context))
- if matchingError == nil {
- x.Oneof = &Parameter_BodyParameter{BodyParameter: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- // NonBodyParameter non_body_parameter = 2;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewNonBodyParameter(m, compiler.NewContext("nonBodyParameter", context))
- if matchingError == nil {
- x.Oneof = &Parameter_NonBodyParameter{NonBodyParameter: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- if matched {
- // since the oneof matched one of its possibilities, discard any matching errors
- errors = make([]error, 0)
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewParameterDefinitions creates an object of type ParameterDefinitions if possible, returning an error if not.
-func NewParameterDefinitions(in interface{}, context *compiler.Context) (*ParameterDefinitions, error) {
- errors := make([]error, 0)
- x := &ParameterDefinitions{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- // repeated NamedParameter additional_properties = 1;
- // MAP: Parameter
- x.AdditionalProperties = make([]*NamedParameter, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- pair := &NamedParameter{}
- pair.Name = k
- var err error
- pair.Value, err = NewParameter(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- x.AdditionalProperties = append(x.AdditionalProperties, pair)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewParametersItem creates an object of type ParametersItem if possible, returning an error if not.
-func NewParametersItem(in interface{}, context *compiler.Context) (*ParametersItem, error) {
- errors := make([]error, 0)
- x := &ParametersItem{}
- matched := false
- // Parameter parameter = 1;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewParameter(m, compiler.NewContext("parameter", context))
- if matchingError == nil {
- x.Oneof = &ParametersItem_Parameter{Parameter: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- // JsonReference json_reference = 2;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", context))
- if matchingError == nil {
- x.Oneof = &ParametersItem_JsonReference{JsonReference: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- if matched {
- // since the oneof matched one of its possibilities, discard any matching errors
- errors = make([]error, 0)
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewPathItem creates an object of type PathItem if possible, returning an error if not.
-func NewPathItem(in interface{}, context *compiler.Context) (*PathItem, error) {
- errors := make([]error, 0)
- x := &PathItem{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"$ref", "delete", "get", "head", "options", "parameters", "patch", "post", "put"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string _ref = 1;
- v1 := compiler.MapValueForKey(m, "$ref")
- if v1 != nil {
- x.XRef, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for $ref: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Operation get = 2;
- v2 := compiler.MapValueForKey(m, "get")
- if v2 != nil {
- var err error
- x.Get, err = NewOperation(v2, compiler.NewContext("get", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // Operation put = 3;
- v3 := compiler.MapValueForKey(m, "put")
- if v3 != nil {
- var err error
- x.Put, err = NewOperation(v3, compiler.NewContext("put", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // Operation post = 4;
- v4 := compiler.MapValueForKey(m, "post")
- if v4 != nil {
- var err error
- x.Post, err = NewOperation(v4, compiler.NewContext("post", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // Operation delete = 5;
- v5 := compiler.MapValueForKey(m, "delete")
- if v5 != nil {
- var err error
- x.Delete, err = NewOperation(v5, compiler.NewContext("delete", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // Operation options = 6;
- v6 := compiler.MapValueForKey(m, "options")
- if v6 != nil {
- var err error
- x.Options, err = NewOperation(v6, compiler.NewContext("options", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // Operation head = 7;
- v7 := compiler.MapValueForKey(m, "head")
- if v7 != nil {
- var err error
- x.Head, err = NewOperation(v7, compiler.NewContext("head", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // Operation patch = 8;
- v8 := compiler.MapValueForKey(m, "patch")
- if v8 != nil {
- var err error
- x.Patch, err = NewOperation(v8, compiler.NewContext("patch", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // repeated ParametersItem parameters = 9;
- v9 := compiler.MapValueForKey(m, "parameters")
- if v9 != nil {
- // repeated ParametersItem
- x.Parameters = make([]*ParametersItem, 0)
- a, ok := v9.([]interface{})
- if ok {
- for _, item := range a {
- y, err := NewParametersItem(item, compiler.NewContext("parameters", context))
- if err != nil {
- errors = append(errors, err)
- }
- x.Parameters = append(x.Parameters, y)
- }
- }
- }
- // repeated NamedAny vendor_extension = 10;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewPathParameterSubSchema creates an object of type PathParameterSubSchema if possible, returning an error if not.
-func NewPathParameterSubSchema(in interface{}, context *compiler.Context) (*PathParameterSubSchema, error) {
- errors := make([]error, 0)
- x := &PathParameterSubSchema{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"required"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- allowedKeys := []string{"collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // bool required = 1;
- v1 := compiler.MapValueForKey(m, "required")
- if v1 != nil {
- x.Required, ok = v1.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string in = 2;
- v2 := compiler.MapValueForKey(m, "in")
- if v2 != nil {
- x.In, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [path]
- if ok && !compiler.StringArrayContainsValue([]string{"path"}, x.In) {
- message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string description = 3;
- v3 := compiler.MapValueForKey(m, "description")
- if v3 != nil {
- x.Description, ok = v3.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string name = 4;
- v4 := compiler.MapValueForKey(m, "name")
- if v4 != nil {
- x.Name, ok = v4.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v4, v4)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string type = 5;
- v5 := compiler.MapValueForKey(m, "type")
- if v5 != nil {
- x.Type, ok = v5.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v5, v5)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [string number boolean integer array]
- if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v5, v5)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string format = 6;
- v6 := compiler.MapValueForKey(m, "format")
- if v6 != nil {
- x.Format, ok = v6.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v6, v6)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // PrimitivesItems items = 7;
- v7 := compiler.MapValueForKey(m, "items")
- if v7 != nil {
- var err error
- x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // string collection_format = 8;
- v8 := compiler.MapValueForKey(m, "collectionFormat")
- if v8 != nil {
- x.CollectionFormat, ok = v8.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v8, v8)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [csv ssv tsv pipes]
- if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) {
- message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v8, v8)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Any default = 9;
- v9 := compiler.MapValueForKey(m, "default")
- if v9 != nil {
- var err error
- x.Default, err = NewAny(v9, compiler.NewContext("default", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // float maximum = 10;
- v10 := compiler.MapValueForKey(m, "maximum")
- if v10 != nil {
- switch v10 := v10.(type) {
- case float64:
- x.Maximum = v10
- case float32:
- x.Maximum = float64(v10)
- case uint64:
- x.Maximum = float64(v10)
- case uint32:
- x.Maximum = float64(v10)
- case int64:
- x.Maximum = float64(v10)
- case int32:
- x.Maximum = float64(v10)
- case int:
- x.Maximum = float64(v10)
- default:
- message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v10, v10)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool exclusive_maximum = 11;
- v11 := compiler.MapValueForKey(m, "exclusiveMaximum")
- if v11 != nil {
- x.ExclusiveMaximum, ok = v11.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v11, v11)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // float minimum = 12;
- v12 := compiler.MapValueForKey(m, "minimum")
- if v12 != nil {
- switch v12 := v12.(type) {
- case float64:
- x.Minimum = v12
- case float32:
- x.Minimum = float64(v12)
- case uint64:
- x.Minimum = float64(v12)
- case uint32:
- x.Minimum = float64(v12)
- case int64:
- x.Minimum = float64(v12)
- case int32:
- x.Minimum = float64(v12)
- case int:
- x.Minimum = float64(v12)
- default:
- message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v12, v12)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool exclusive_minimum = 13;
- v13 := compiler.MapValueForKey(m, "exclusiveMinimum")
- if v13 != nil {
- x.ExclusiveMinimum, ok = v13.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v13, v13)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 max_length = 14;
- v14 := compiler.MapValueForKey(m, "maxLength")
- if v14 != nil {
- t, ok := v14.(int)
- if ok {
- x.MaxLength = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v14, v14)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 min_length = 15;
- v15 := compiler.MapValueForKey(m, "minLength")
- if v15 != nil {
- t, ok := v15.(int)
- if ok {
- x.MinLength = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v15, v15)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string pattern = 16;
- v16 := compiler.MapValueForKey(m, "pattern")
- if v16 != nil {
- x.Pattern, ok = v16.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v16, v16)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 max_items = 17;
- v17 := compiler.MapValueForKey(m, "maxItems")
- if v17 != nil {
- t, ok := v17.(int)
- if ok {
- x.MaxItems = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v17, v17)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 min_items = 18;
- v18 := compiler.MapValueForKey(m, "minItems")
- if v18 != nil {
- t, ok := v18.(int)
- if ok {
- x.MinItems = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v18, v18)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool unique_items = 19;
- v19 := compiler.MapValueForKey(m, "uniqueItems")
- if v19 != nil {
- x.UniqueItems, ok = v19.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v19, v19)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated Any enum = 20;
- v20 := compiler.MapValueForKey(m, "enum")
- if v20 != nil {
- // repeated Any
- x.Enum = make([]*Any, 0)
- a, ok := v20.([]interface{})
- if ok {
- for _, item := range a {
- y, err := NewAny(item, compiler.NewContext("enum", context))
- if err != nil {
- errors = append(errors, err)
- }
- x.Enum = append(x.Enum, y)
- }
- }
- }
- // float multiple_of = 21;
- v21 := compiler.MapValueForKey(m, "multipleOf")
- if v21 != nil {
- switch v21 := v21.(type) {
- case float64:
- x.MultipleOf = v21
- case float32:
- x.MultipleOf = float64(v21)
- case uint64:
- x.MultipleOf = float64(v21)
- case uint32:
- x.MultipleOf = float64(v21)
- case int64:
- x.MultipleOf = float64(v21)
- case int32:
- x.MultipleOf = float64(v21)
- case int:
- x.MultipleOf = float64(v21)
- default:
- message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v21, v21)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated NamedAny vendor_extension = 22;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewPaths creates an object of type Paths if possible, returning an error if not.
-func NewPaths(in interface{}, context *compiler.Context) (*Paths, error) {
- errors := make([]error, 0)
- x := &Paths{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{}
- allowedPatterns := []*regexp.Regexp{pattern0, pattern1}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // repeated NamedAny vendor_extension = 1;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- // repeated NamedPathItem path = 2;
- // MAP: PathItem ^/
- x.Path = make([]*NamedPathItem, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "/") {
- pair := &NamedPathItem{}
- pair.Name = k
- var err error
- pair.Value, err = NewPathItem(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- x.Path = append(x.Path, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewPrimitivesItems creates an object of type PrimitivesItems if possible, returning an error if not.
-func NewPrimitivesItems(in interface{}, context *compiler.Context) (*PrimitivesItems, error) {
- errors := make([]error, 0)
- x := &PrimitivesItems{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"collectionFormat", "default", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "pattern", "type", "uniqueItems"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string type = 1;
- v1 := compiler.MapValueForKey(m, "type")
- if v1 != nil {
- x.Type, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [string number integer boolean array]
- if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "integer", "boolean", "array"}, x.Type) {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string format = 2;
- v2 := compiler.MapValueForKey(m, "format")
- if v2 != nil {
- x.Format, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // PrimitivesItems items = 3;
- v3 := compiler.MapValueForKey(m, "items")
- if v3 != nil {
- var err error
- x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // string collection_format = 4;
- v4 := compiler.MapValueForKey(m, "collectionFormat")
- if v4 != nil {
- x.CollectionFormat, ok = v4.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v4, v4)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [csv ssv tsv pipes]
- if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) {
- message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v4, v4)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Any default = 5;
- v5 := compiler.MapValueForKey(m, "default")
- if v5 != nil {
- var err error
- x.Default, err = NewAny(v5, compiler.NewContext("default", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // float maximum = 6;
- v6 := compiler.MapValueForKey(m, "maximum")
- if v6 != nil {
- switch v6 := v6.(type) {
- case float64:
- x.Maximum = v6
- case float32:
- x.Maximum = float64(v6)
- case uint64:
- x.Maximum = float64(v6)
- case uint32:
- x.Maximum = float64(v6)
- case int64:
- x.Maximum = float64(v6)
- case int32:
- x.Maximum = float64(v6)
- case int:
- x.Maximum = float64(v6)
- default:
- message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v6, v6)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool exclusive_maximum = 7;
- v7 := compiler.MapValueForKey(m, "exclusiveMaximum")
- if v7 != nil {
- x.ExclusiveMaximum, ok = v7.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v7, v7)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // float minimum = 8;
- v8 := compiler.MapValueForKey(m, "minimum")
- if v8 != nil {
- switch v8 := v8.(type) {
- case float64:
- x.Minimum = v8
- case float32:
- x.Minimum = float64(v8)
- case uint64:
- x.Minimum = float64(v8)
- case uint32:
- x.Minimum = float64(v8)
- case int64:
- x.Minimum = float64(v8)
- case int32:
- x.Minimum = float64(v8)
- case int:
- x.Minimum = float64(v8)
- default:
- message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v8, v8)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool exclusive_minimum = 9;
- v9 := compiler.MapValueForKey(m, "exclusiveMinimum")
- if v9 != nil {
- x.ExclusiveMinimum, ok = v9.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v9, v9)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 max_length = 10;
- v10 := compiler.MapValueForKey(m, "maxLength")
- if v10 != nil {
- t, ok := v10.(int)
- if ok {
- x.MaxLength = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v10, v10)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 min_length = 11;
- v11 := compiler.MapValueForKey(m, "minLength")
- if v11 != nil {
- t, ok := v11.(int)
- if ok {
- x.MinLength = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v11, v11)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string pattern = 12;
- v12 := compiler.MapValueForKey(m, "pattern")
- if v12 != nil {
- x.Pattern, ok = v12.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v12, v12)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 max_items = 13;
- v13 := compiler.MapValueForKey(m, "maxItems")
- if v13 != nil {
- t, ok := v13.(int)
- if ok {
- x.MaxItems = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v13, v13)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 min_items = 14;
- v14 := compiler.MapValueForKey(m, "minItems")
- if v14 != nil {
- t, ok := v14.(int)
- if ok {
- x.MinItems = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v14, v14)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool unique_items = 15;
- v15 := compiler.MapValueForKey(m, "uniqueItems")
- if v15 != nil {
- x.UniqueItems, ok = v15.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v15, v15)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated Any enum = 16;
- v16 := compiler.MapValueForKey(m, "enum")
- if v16 != nil {
- // repeated Any
- x.Enum = make([]*Any, 0)
- a, ok := v16.([]interface{})
- if ok {
- for _, item := range a {
- y, err := NewAny(item, compiler.NewContext("enum", context))
- if err != nil {
- errors = append(errors, err)
- }
- x.Enum = append(x.Enum, y)
- }
- }
- }
- // float multiple_of = 17;
- v17 := compiler.MapValueForKey(m, "multipleOf")
- if v17 != nil {
- switch v17 := v17.(type) {
- case float64:
- x.MultipleOf = v17
- case float32:
- x.MultipleOf = float64(v17)
- case uint64:
- x.MultipleOf = float64(v17)
- case uint32:
- x.MultipleOf = float64(v17)
- case int64:
- x.MultipleOf = float64(v17)
- case int32:
- x.MultipleOf = float64(v17)
- case int:
- x.MultipleOf = float64(v17)
- default:
- message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v17, v17)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated NamedAny vendor_extension = 18;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewProperties creates an object of type Properties if possible, returning an error if not.
-func NewProperties(in interface{}, context *compiler.Context) (*Properties, error) {
- errors := make([]error, 0)
- x := &Properties{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- // repeated NamedSchema additional_properties = 1;
- // MAP: Schema
- x.AdditionalProperties = make([]*NamedSchema, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- pair := &NamedSchema{}
- pair.Name = k
- var err error
- pair.Value, err = NewSchema(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- x.AdditionalProperties = append(x.AdditionalProperties, pair)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewQueryParameterSubSchema creates an object of type QueryParameterSubSchema if possible, returning an error if not.
-func NewQueryParameterSubSchema(in interface{}, context *compiler.Context) (*QueryParameterSubSchema, error) {
- errors := make([]error, 0)
- x := &QueryParameterSubSchema{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"allowEmptyValue", "collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // bool required = 1;
- v1 := compiler.MapValueForKey(m, "required")
- if v1 != nil {
- x.Required, ok = v1.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string in = 2;
- v2 := compiler.MapValueForKey(m, "in")
- if v2 != nil {
- x.In, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [query]
- if ok && !compiler.StringArrayContainsValue([]string{"query"}, x.In) {
- message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string description = 3;
- v3 := compiler.MapValueForKey(m, "description")
- if v3 != nil {
- x.Description, ok = v3.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string name = 4;
- v4 := compiler.MapValueForKey(m, "name")
- if v4 != nil {
- x.Name, ok = v4.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v4, v4)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool allow_empty_value = 5;
- v5 := compiler.MapValueForKey(m, "allowEmptyValue")
- if v5 != nil {
- x.AllowEmptyValue, ok = v5.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for allowEmptyValue: %+v (%T)", v5, v5)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string type = 6;
- v6 := compiler.MapValueForKey(m, "type")
- if v6 != nil {
- x.Type, ok = v6.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [string number boolean integer array]
- if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) {
- message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string format = 7;
- v7 := compiler.MapValueForKey(m, "format")
- if v7 != nil {
- x.Format, ok = v7.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v7, v7)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // PrimitivesItems items = 8;
- v8 := compiler.MapValueForKey(m, "items")
- if v8 != nil {
- var err error
- x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // string collection_format = 9;
- v9 := compiler.MapValueForKey(m, "collectionFormat")
- if v9 != nil {
- x.CollectionFormat, ok = v9.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v9, v9)
- errors = append(errors, compiler.NewError(context, message))
- }
- // check for valid enum values
- // [csv ssv tsv pipes multi]
- if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes", "multi"}, x.CollectionFormat) {
- message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v9, v9)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Any default = 10;
- v10 := compiler.MapValueForKey(m, "default")
- if v10 != nil {
- var err error
- x.Default, err = NewAny(v10, compiler.NewContext("default", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // float maximum = 11;
- v11 := compiler.MapValueForKey(m, "maximum")
- if v11 != nil {
- switch v11 := v11.(type) {
- case float64:
- x.Maximum = v11
- case float32:
- x.Maximum = float64(v11)
- case uint64:
- x.Maximum = float64(v11)
- case uint32:
- x.Maximum = float64(v11)
- case int64:
- x.Maximum = float64(v11)
- case int32:
- x.Maximum = float64(v11)
- case int:
- x.Maximum = float64(v11)
- default:
- message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v11, v11)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool exclusive_maximum = 12;
- v12 := compiler.MapValueForKey(m, "exclusiveMaximum")
- if v12 != nil {
- x.ExclusiveMaximum, ok = v12.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v12, v12)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // float minimum = 13;
- v13 := compiler.MapValueForKey(m, "minimum")
- if v13 != nil {
- switch v13 := v13.(type) {
- case float64:
- x.Minimum = v13
- case float32:
- x.Minimum = float64(v13)
- case uint64:
- x.Minimum = float64(v13)
- case uint32:
- x.Minimum = float64(v13)
- case int64:
- x.Minimum = float64(v13)
- case int32:
- x.Minimum = float64(v13)
- case int:
- x.Minimum = float64(v13)
- default:
- message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v13, v13)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool exclusive_minimum = 14;
- v14 := compiler.MapValueForKey(m, "exclusiveMinimum")
- if v14 != nil {
- x.ExclusiveMinimum, ok = v14.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v14, v14)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 max_length = 15;
- v15 := compiler.MapValueForKey(m, "maxLength")
- if v15 != nil {
- t, ok := v15.(int)
- if ok {
- x.MaxLength = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v15, v15)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 min_length = 16;
- v16 := compiler.MapValueForKey(m, "minLength")
- if v16 != nil {
- t, ok := v16.(int)
- if ok {
- x.MinLength = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v16, v16)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string pattern = 17;
- v17 := compiler.MapValueForKey(m, "pattern")
- if v17 != nil {
- x.Pattern, ok = v17.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v17, v17)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 max_items = 18;
- v18 := compiler.MapValueForKey(m, "maxItems")
- if v18 != nil {
- t, ok := v18.(int)
- if ok {
- x.MaxItems = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v18, v18)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 min_items = 19;
- v19 := compiler.MapValueForKey(m, "minItems")
- if v19 != nil {
- t, ok := v19.(int)
- if ok {
- x.MinItems = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v19, v19)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool unique_items = 20;
- v20 := compiler.MapValueForKey(m, "uniqueItems")
- if v20 != nil {
- x.UniqueItems, ok = v20.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v20, v20)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated Any enum = 21;
- v21 := compiler.MapValueForKey(m, "enum")
- if v21 != nil {
- // repeated Any
- x.Enum = make([]*Any, 0)
- a, ok := v21.([]interface{})
- if ok {
- for _, item := range a {
- y, err := NewAny(item, compiler.NewContext("enum", context))
- if err != nil {
- errors = append(errors, err)
- }
- x.Enum = append(x.Enum, y)
- }
- }
- }
- // float multiple_of = 22;
- v22 := compiler.MapValueForKey(m, "multipleOf")
- if v22 != nil {
- switch v22 := v22.(type) {
- case float64:
- x.MultipleOf = v22
- case float32:
- x.MultipleOf = float64(v22)
- case uint64:
- x.MultipleOf = float64(v22)
- case uint32:
- x.MultipleOf = float64(v22)
- case int64:
- x.MultipleOf = float64(v22)
- case int32:
- x.MultipleOf = float64(v22)
- case int:
- x.MultipleOf = float64(v22)
- default:
- message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v22, v22)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated NamedAny vendor_extension = 23;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewResponse creates an object of type Response if possible, returning an error if not.
-func NewResponse(in interface{}, context *compiler.Context) (*Response, error) {
- errors := make([]error, 0)
- x := &Response{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"description"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- allowedKeys := []string{"description", "examples", "headers", "schema"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string description = 1;
- v1 := compiler.MapValueForKey(m, "description")
- if v1 != nil {
- x.Description, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // SchemaItem schema = 2;
- v2 := compiler.MapValueForKey(m, "schema")
- if v2 != nil {
- var err error
- x.Schema, err = NewSchemaItem(v2, compiler.NewContext("schema", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // Headers headers = 3;
- v3 := compiler.MapValueForKey(m, "headers")
- if v3 != nil {
- var err error
- x.Headers, err = NewHeaders(v3, compiler.NewContext("headers", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // Examples examples = 4;
- v4 := compiler.MapValueForKey(m, "examples")
- if v4 != nil {
- var err error
- x.Examples, err = NewExamples(v4, compiler.NewContext("examples", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // repeated NamedAny vendor_extension = 5;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewResponseDefinitions creates an object of type ResponseDefinitions if possible, returning an error if not.
-func NewResponseDefinitions(in interface{}, context *compiler.Context) (*ResponseDefinitions, error) {
- errors := make([]error, 0)
- x := &ResponseDefinitions{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- // repeated NamedResponse additional_properties = 1;
- // MAP: Response
- x.AdditionalProperties = make([]*NamedResponse, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- pair := &NamedResponse{}
- pair.Name = k
- var err error
- pair.Value, err = NewResponse(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- x.AdditionalProperties = append(x.AdditionalProperties, pair)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewResponseValue creates an object of type ResponseValue if possible, returning an error if not.
-func NewResponseValue(in interface{}, context *compiler.Context) (*ResponseValue, error) {
- errors := make([]error, 0)
- x := &ResponseValue{}
- matched := false
- // Response response = 1;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewResponse(m, compiler.NewContext("response", context))
- if matchingError == nil {
- x.Oneof = &ResponseValue_Response{Response: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- // JsonReference json_reference = 2;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", context))
- if matchingError == nil {
- x.Oneof = &ResponseValue_JsonReference{JsonReference: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- if matched {
- // since the oneof matched one of its possibilities, discard any matching errors
- errors = make([]error, 0)
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewResponses creates an object of type Responses if possible, returning an error if not.
-func NewResponses(in interface{}, context *compiler.Context) (*Responses, error) {
- errors := make([]error, 0)
- x := &Responses{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{}
- allowedPatterns := []*regexp.Regexp{pattern2, pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // repeated NamedResponseValue response_code = 1;
- // MAP: ResponseValue ^([0-9]{3})$|^(default)$
- x.ResponseCode = make([]*NamedResponseValue, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if pattern2.MatchString(k) {
- pair := &NamedResponseValue{}
- pair.Name = k
- var err error
- pair.Value, err = NewResponseValue(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- x.ResponseCode = append(x.ResponseCode, pair)
- }
- }
- }
- // repeated NamedAny vendor_extension = 2;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewSchema creates an object of type Schema if possible, returning an error if not.
-func NewSchema(in interface{}, context *compiler.Context) (*Schema, error) {
- errors := make([]error, 0)
- x := &Schema{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"$ref", "additionalProperties", "allOf", "default", "description", "discriminator", "enum", "example", "exclusiveMaximum", "exclusiveMinimum", "externalDocs", "format", "items", "maxItems", "maxLength", "maxProperties", "maximum", "minItems", "minLength", "minProperties", "minimum", "multipleOf", "pattern", "properties", "readOnly", "required", "title", "type", "uniqueItems", "xml"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string _ref = 1;
- v1 := compiler.MapValueForKey(m, "$ref")
- if v1 != nil {
- x.XRef, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for $ref: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string format = 2;
- v2 := compiler.MapValueForKey(m, "format")
- if v2 != nil {
- x.Format, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string title = 3;
- v3 := compiler.MapValueForKey(m, "title")
- if v3 != nil {
- x.Title, ok = v3.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for title: %+v (%T)", v3, v3)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string description = 4;
- v4 := compiler.MapValueForKey(m, "description")
- if v4 != nil {
- x.Description, ok = v4.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v4, v4)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Any default = 5;
- v5 := compiler.MapValueForKey(m, "default")
- if v5 != nil {
- var err error
- x.Default, err = NewAny(v5, compiler.NewContext("default", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // float multiple_of = 6;
- v6 := compiler.MapValueForKey(m, "multipleOf")
- if v6 != nil {
- switch v6 := v6.(type) {
- case float64:
- x.MultipleOf = v6
- case float32:
- x.MultipleOf = float64(v6)
- case uint64:
- x.MultipleOf = float64(v6)
- case uint32:
- x.MultipleOf = float64(v6)
- case int64:
- x.MultipleOf = float64(v6)
- case int32:
- x.MultipleOf = float64(v6)
- case int:
- x.MultipleOf = float64(v6)
- default:
- message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v6, v6)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // float maximum = 7;
- v7 := compiler.MapValueForKey(m, "maximum")
- if v7 != nil {
- switch v7 := v7.(type) {
- case float64:
- x.Maximum = v7
- case float32:
- x.Maximum = float64(v7)
- case uint64:
- x.Maximum = float64(v7)
- case uint32:
- x.Maximum = float64(v7)
- case int64:
- x.Maximum = float64(v7)
- case int32:
- x.Maximum = float64(v7)
- case int:
- x.Maximum = float64(v7)
- default:
- message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v7, v7)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool exclusive_maximum = 8;
- v8 := compiler.MapValueForKey(m, "exclusiveMaximum")
- if v8 != nil {
- x.ExclusiveMaximum, ok = v8.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v8, v8)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // float minimum = 9;
- v9 := compiler.MapValueForKey(m, "minimum")
- if v9 != nil {
- switch v9 := v9.(type) {
- case float64:
- x.Minimum = v9
- case float32:
- x.Minimum = float64(v9)
- case uint64:
- x.Minimum = float64(v9)
- case uint32:
- x.Minimum = float64(v9)
- case int64:
- x.Minimum = float64(v9)
- case int32:
- x.Minimum = float64(v9)
- case int:
- x.Minimum = float64(v9)
- default:
- message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v9, v9)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool exclusive_minimum = 10;
- v10 := compiler.MapValueForKey(m, "exclusiveMinimum")
- if v10 != nil {
- x.ExclusiveMinimum, ok = v10.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v10, v10)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 max_length = 11;
- v11 := compiler.MapValueForKey(m, "maxLength")
- if v11 != nil {
- t, ok := v11.(int)
- if ok {
- x.MaxLength = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v11, v11)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 min_length = 12;
- v12 := compiler.MapValueForKey(m, "minLength")
- if v12 != nil {
- t, ok := v12.(int)
- if ok {
- x.MinLength = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v12, v12)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string pattern = 13;
- v13 := compiler.MapValueForKey(m, "pattern")
- if v13 != nil {
- x.Pattern, ok = v13.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v13, v13)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 max_items = 14;
- v14 := compiler.MapValueForKey(m, "maxItems")
- if v14 != nil {
- t, ok := v14.(int)
- if ok {
- x.MaxItems = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v14, v14)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 min_items = 15;
- v15 := compiler.MapValueForKey(m, "minItems")
- if v15 != nil {
- t, ok := v15.(int)
- if ok {
- x.MinItems = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v15, v15)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool unique_items = 16;
- v16 := compiler.MapValueForKey(m, "uniqueItems")
- if v16 != nil {
- x.UniqueItems, ok = v16.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v16, v16)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 max_properties = 17;
- v17 := compiler.MapValueForKey(m, "maxProperties")
- if v17 != nil {
- t, ok := v17.(int)
- if ok {
- x.MaxProperties = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for maxProperties: %+v (%T)", v17, v17)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // int64 min_properties = 18;
- v18 := compiler.MapValueForKey(m, "minProperties")
- if v18 != nil {
- t, ok := v18.(int)
- if ok {
- x.MinProperties = int64(t)
- } else {
- message := fmt.Sprintf("has unexpected value for minProperties: %+v (%T)", v18, v18)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated string required = 19;
- v19 := compiler.MapValueForKey(m, "required")
- if v19 != nil {
- v, ok := v19.([]interface{})
- if ok {
- x.Required = compiler.ConvertInterfaceArrayToStringArray(v)
- } else {
- message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v19, v19)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated Any enum = 20;
- v20 := compiler.MapValueForKey(m, "enum")
- if v20 != nil {
- // repeated Any
- x.Enum = make([]*Any, 0)
- a, ok := v20.([]interface{})
- if ok {
- for _, item := range a {
- y, err := NewAny(item, compiler.NewContext("enum", context))
- if err != nil {
- errors = append(errors, err)
- }
- x.Enum = append(x.Enum, y)
- }
- }
- }
- // AdditionalPropertiesItem additional_properties = 21;
- v21 := compiler.MapValueForKey(m, "additionalProperties")
- if v21 != nil {
- var err error
- x.AdditionalProperties, err = NewAdditionalPropertiesItem(v21, compiler.NewContext("additionalProperties", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // TypeItem type = 22;
- v22 := compiler.MapValueForKey(m, "type")
- if v22 != nil {
- var err error
- x.Type, err = NewTypeItem(v22, compiler.NewContext("type", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // ItemsItem items = 23;
- v23 := compiler.MapValueForKey(m, "items")
- if v23 != nil {
- var err error
- x.Items, err = NewItemsItem(v23, compiler.NewContext("items", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // repeated Schema all_of = 24;
- v24 := compiler.MapValueForKey(m, "allOf")
- if v24 != nil {
- // repeated Schema
- x.AllOf = make([]*Schema, 0)
- a, ok := v24.([]interface{})
- if ok {
- for _, item := range a {
- y, err := NewSchema(item, compiler.NewContext("allOf", context))
- if err != nil {
- errors = append(errors, err)
- }
- x.AllOf = append(x.AllOf, y)
- }
- }
- }
- // Properties properties = 25;
- v25 := compiler.MapValueForKey(m, "properties")
- if v25 != nil {
- var err error
- x.Properties, err = NewProperties(v25, compiler.NewContext("properties", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // string discriminator = 26;
- v26 := compiler.MapValueForKey(m, "discriminator")
- if v26 != nil {
- x.Discriminator, ok = v26.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for discriminator: %+v (%T)", v26, v26)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool read_only = 27;
- v27 := compiler.MapValueForKey(m, "readOnly")
- if v27 != nil {
- x.ReadOnly, ok = v27.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for readOnly: %+v (%T)", v27, v27)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // Xml xml = 28;
- v28 := compiler.MapValueForKey(m, "xml")
- if v28 != nil {
- var err error
- x.Xml, err = NewXml(v28, compiler.NewContext("xml", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // ExternalDocs external_docs = 29;
- v29 := compiler.MapValueForKey(m, "externalDocs")
- if v29 != nil {
- var err error
- x.ExternalDocs, err = NewExternalDocs(v29, compiler.NewContext("externalDocs", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // Any example = 30;
- v30 := compiler.MapValueForKey(m, "example")
- if v30 != nil {
- var err error
- x.Example, err = NewAny(v30, compiler.NewContext("example", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // repeated NamedAny vendor_extension = 31;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewSchemaItem creates an object of type SchemaItem if possible, returning an error if not.
-func NewSchemaItem(in interface{}, context *compiler.Context) (*SchemaItem, error) {
- errors := make([]error, 0)
- x := &SchemaItem{}
- matched := false
- // Schema schema = 1;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewSchema(m, compiler.NewContext("schema", context))
- if matchingError == nil {
- x.Oneof = &SchemaItem_Schema{Schema: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- // FileSchema file_schema = 2;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewFileSchema(m, compiler.NewContext("fileSchema", context))
- if matchingError == nil {
- x.Oneof = &SchemaItem_FileSchema{FileSchema: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- if matched {
- // since the oneof matched one of its possibilities, discard any matching errors
- errors = make([]error, 0)
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewSecurityDefinitions creates an object of type SecurityDefinitions if possible, returning an error if not.
-func NewSecurityDefinitions(in interface{}, context *compiler.Context) (*SecurityDefinitions, error) {
- errors := make([]error, 0)
- x := &SecurityDefinitions{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- // repeated NamedSecurityDefinitionsItem additional_properties = 1;
- // MAP: SecurityDefinitionsItem
- x.AdditionalProperties = make([]*NamedSecurityDefinitionsItem, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- pair := &NamedSecurityDefinitionsItem{}
- pair.Name = k
- var err error
- pair.Value, err = NewSecurityDefinitionsItem(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- x.AdditionalProperties = append(x.AdditionalProperties, pair)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewSecurityDefinitionsItem creates an object of type SecurityDefinitionsItem if possible, returning an error if not.
-func NewSecurityDefinitionsItem(in interface{}, context *compiler.Context) (*SecurityDefinitionsItem, error) {
- errors := make([]error, 0)
- x := &SecurityDefinitionsItem{}
- matched := false
- // BasicAuthenticationSecurity basic_authentication_security = 1;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewBasicAuthenticationSecurity(m, compiler.NewContext("basicAuthenticationSecurity", context))
- if matchingError == nil {
- x.Oneof = &SecurityDefinitionsItem_BasicAuthenticationSecurity{BasicAuthenticationSecurity: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- // ApiKeySecurity api_key_security = 2;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewApiKeySecurity(m, compiler.NewContext("apiKeySecurity", context))
- if matchingError == nil {
- x.Oneof = &SecurityDefinitionsItem_ApiKeySecurity{ApiKeySecurity: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- // Oauth2ImplicitSecurity oauth2_implicit_security = 3;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewOauth2ImplicitSecurity(m, compiler.NewContext("oauth2ImplicitSecurity", context))
- if matchingError == nil {
- x.Oneof = &SecurityDefinitionsItem_Oauth2ImplicitSecurity{Oauth2ImplicitSecurity: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- // Oauth2PasswordSecurity oauth2_password_security = 4;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewOauth2PasswordSecurity(m, compiler.NewContext("oauth2PasswordSecurity", context))
- if matchingError == nil {
- x.Oneof = &SecurityDefinitionsItem_Oauth2PasswordSecurity{Oauth2PasswordSecurity: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- // Oauth2ApplicationSecurity oauth2_application_security = 5;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewOauth2ApplicationSecurity(m, compiler.NewContext("oauth2ApplicationSecurity", context))
- if matchingError == nil {
- x.Oneof = &SecurityDefinitionsItem_Oauth2ApplicationSecurity{Oauth2ApplicationSecurity: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- // Oauth2AccessCodeSecurity oauth2_access_code_security = 6;
- {
- m, ok := compiler.UnpackMap(in)
- if ok {
- // errors might be ok here, they mean we just don't have the right subtype
- t, matchingError := NewOauth2AccessCodeSecurity(m, compiler.NewContext("oauth2AccessCodeSecurity", context))
- if matchingError == nil {
- x.Oneof = &SecurityDefinitionsItem_Oauth2AccessCodeSecurity{Oauth2AccessCodeSecurity: t}
- matched = true
- } else {
- errors = append(errors, matchingError)
- }
- }
- }
- if matched {
- // since the oneof matched one of its possibilities, discard any matching errors
- errors = make([]error, 0)
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewSecurityRequirement creates an object of type SecurityRequirement if possible, returning an error if not.
-func NewSecurityRequirement(in interface{}, context *compiler.Context) (*SecurityRequirement, error) {
- errors := make([]error, 0)
- x := &SecurityRequirement{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- // repeated NamedStringArray additional_properties = 1;
- // MAP: StringArray
- x.AdditionalProperties = make([]*NamedStringArray, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- pair := &NamedStringArray{}
- pair.Name = k
- var err error
- pair.Value, err = NewStringArray(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- x.AdditionalProperties = append(x.AdditionalProperties, pair)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewStringArray creates an object of type StringArray if possible, returning an error if not.
-func NewStringArray(in interface{}, context *compiler.Context) (*StringArray, error) {
- errors := make([]error, 0)
- x := &StringArray{}
- a, ok := in.([]interface{})
- if !ok {
- message := fmt.Sprintf("has unexpected value for StringArray: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- x.Value = make([]string, 0)
- for _, s := range a {
- x.Value = append(x.Value, s.(string))
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewTag creates an object of type Tag if possible, returning an error if not.
-func NewTag(in interface{}, context *compiler.Context) (*Tag, error) {
- errors := make([]error, 0)
- x := &Tag{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- requiredKeys := []string{"name"}
- missingKeys := compiler.MissingKeysInMap(m, requiredKeys)
- if len(missingKeys) > 0 {
- message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- allowedKeys := []string{"description", "externalDocs", "name"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string description = 2;
- v2 := compiler.MapValueForKey(m, "description")
- if v2 != nil {
- x.Description, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // ExternalDocs external_docs = 3;
- v3 := compiler.MapValueForKey(m, "externalDocs")
- if v3 != nil {
- var err error
- x.ExternalDocs, err = NewExternalDocs(v3, compiler.NewContext("externalDocs", context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- // repeated NamedAny vendor_extension = 4;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewTypeItem creates an object of type TypeItem if possible, returning an error if not.
-func NewTypeItem(in interface{}, context *compiler.Context) (*TypeItem, error) {
- errors := make([]error, 0)
- x := &TypeItem{}
- switch in := in.(type) {
- case string:
- x.Value = make([]string, 0)
- x.Value = append(x.Value, in)
- case []interface{}:
- x.Value = make([]string, 0)
- for _, v := range in {
- value, ok := v.(string)
- if ok {
- x.Value = append(x.Value, value)
- } else {
- message := fmt.Sprintf("has unexpected value for string array element: %+v (%T)", value, value)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- default:
- message := fmt.Sprintf("has unexpected value for string array: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewVendorExtension creates an object of type VendorExtension if possible, returning an error if not.
-func NewVendorExtension(in interface{}, context *compiler.Context) (*VendorExtension, error) {
- errors := make([]error, 0)
- x := &VendorExtension{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- // repeated NamedAny additional_properties = 1;
- // MAP: Any
- x.AdditionalProperties = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.AdditionalProperties = append(x.AdditionalProperties, pair)
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// NewXml creates an object of type Xml if possible, returning an error if not.
-func NewXml(in interface{}, context *compiler.Context) (*Xml, error) {
- errors := make([]error, 0)
- x := &Xml{}
- m, ok := compiler.UnpackMap(in)
- if !ok {
- message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in)
- errors = append(errors, compiler.NewError(context, message))
- } else {
- allowedKeys := []string{"attribute", "name", "namespace", "prefix", "wrapped"}
- allowedPatterns := []*regexp.Regexp{pattern0}
- invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns)
- if len(invalidKeys) > 0 {
- message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", "))
- errors = append(errors, compiler.NewError(context, message))
- }
- // string name = 1;
- v1 := compiler.MapValueForKey(m, "name")
- if v1 != nil {
- x.Name, ok = v1.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string namespace = 2;
- v2 := compiler.MapValueForKey(m, "namespace")
- if v2 != nil {
- x.Namespace, ok = v2.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for namespace: %+v (%T)", v2, v2)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // string prefix = 3;
- v3 := compiler.MapValueForKey(m, "prefix")
- if v3 != nil {
- x.Prefix, ok = v3.(string)
- if !ok {
- message := fmt.Sprintf("has unexpected value for prefix: %+v (%T)", v3, v3)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool attribute = 4;
- v4 := compiler.MapValueForKey(m, "attribute")
- if v4 != nil {
- x.Attribute, ok = v4.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for attribute: %+v (%T)", v4, v4)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // bool wrapped = 5;
- v5 := compiler.MapValueForKey(m, "wrapped")
- if v5 != nil {
- x.Wrapped, ok = v5.(bool)
- if !ok {
- message := fmt.Sprintf("has unexpected value for wrapped: %+v (%T)", v5, v5)
- errors = append(errors, compiler.NewError(context, message))
- }
- }
- // repeated NamedAny vendor_extension = 6;
- // MAP: Any ^x-
- x.VendorExtension = make([]*NamedAny, 0)
- for _, item := range m {
- k, ok := compiler.StringValue(item.Key)
- if ok {
- v := item.Value
- if strings.HasPrefix(k, "x-") {
- pair := &NamedAny{}
- pair.Name = k
- result := &Any{}
- handled, resultFromExt, err := compiler.HandleExtension(context, v, k)
- if handled {
- if err != nil {
- errors = append(errors, err)
- } else {
- bytes, _ := yaml.Marshal(v)
- result.Yaml = string(bytes)
- result.Value = resultFromExt
- pair.Value = result
- }
- } else {
- pair.Value, err = NewAny(v, compiler.NewContext(k, context))
- if err != nil {
- errors = append(errors, err)
- }
- }
- x.VendorExtension = append(x.VendorExtension, pair)
- }
- }
- }
- }
- return x, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside AdditionalPropertiesItem objects.
-func (m *AdditionalPropertiesItem) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- {
- p, ok := m.Oneof.(*AdditionalPropertiesItem_Schema)
- if ok {
- _, err := p.Schema.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Any objects.
-func (m *Any) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside ApiKeySecurity objects.
-func (m *ApiKeySecurity) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside BasicAuthenticationSecurity objects.
-func (m *BasicAuthenticationSecurity) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside BodyParameter objects.
-func (m *BodyParameter) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Schema != nil {
- _, err := m.Schema.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Contact objects.
-func (m *Contact) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Default objects.
-func (m *Default) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Definitions objects.
-func (m *Definitions) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Document objects.
-func (m *Document) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Info != nil {
- _, err := m.Info.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Paths != nil {
- _, err := m.Paths.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Definitions != nil {
- _, err := m.Definitions.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Parameters != nil {
- _, err := m.Parameters.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Responses != nil {
- _, err := m.Responses.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Security {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- if m.SecurityDefinitions != nil {
- _, err := m.SecurityDefinitions.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Tags {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- if m.ExternalDocs != nil {
- _, err := m.ExternalDocs.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Examples objects.
-func (m *Examples) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside ExternalDocs objects.
-func (m *ExternalDocs) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside FileSchema objects.
-func (m *FileSchema) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Default != nil {
- _, err := m.Default.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.ExternalDocs != nil {
- _, err := m.ExternalDocs.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Example != nil {
- _, err := m.Example.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside FormDataParameterSubSchema objects.
-func (m *FormDataParameterSubSchema) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Items != nil {
- _, err := m.Items.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Default != nil {
- _, err := m.Default.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Enum {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Header objects.
-func (m *Header) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Items != nil {
- _, err := m.Items.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Default != nil {
- _, err := m.Default.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Enum {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside HeaderParameterSubSchema objects.
-func (m *HeaderParameterSubSchema) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Items != nil {
- _, err := m.Items.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Default != nil {
- _, err := m.Default.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Enum {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Headers objects.
-func (m *Headers) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Info objects.
-func (m *Info) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Contact != nil {
- _, err := m.Contact.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.License != nil {
- _, err := m.License.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside ItemsItem objects.
-func (m *ItemsItem) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.Schema {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside JsonReference objects.
-func (m *JsonReference) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.XRef != "" {
- info, err := compiler.ReadInfoForRef(root, m.XRef)
- if err != nil {
- return nil, err
- }
- if info != nil {
- replacement, err := NewJsonReference(info, nil)
- if err == nil {
- *m = *replacement
- return m.ResolveReferences(root)
- }
- }
- return info, nil
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside License objects.
-func (m *License) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NamedAny objects.
-func (m *NamedAny) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Value != nil {
- _, err := m.Value.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NamedHeader objects.
-func (m *NamedHeader) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Value != nil {
- _, err := m.Value.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NamedParameter objects.
-func (m *NamedParameter) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Value != nil {
- _, err := m.Value.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NamedPathItem objects.
-func (m *NamedPathItem) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Value != nil {
- _, err := m.Value.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NamedResponse objects.
-func (m *NamedResponse) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Value != nil {
- _, err := m.Value.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NamedResponseValue objects.
-func (m *NamedResponseValue) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Value != nil {
- _, err := m.Value.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NamedSchema objects.
-func (m *NamedSchema) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Value != nil {
- _, err := m.Value.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NamedSecurityDefinitionsItem objects.
-func (m *NamedSecurityDefinitionsItem) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Value != nil {
- _, err := m.Value.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NamedString objects.
-func (m *NamedString) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NamedStringArray objects.
-func (m *NamedStringArray) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Value != nil {
- _, err := m.Value.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside NonBodyParameter objects.
-func (m *NonBodyParameter) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- {
- p, ok := m.Oneof.(*NonBodyParameter_HeaderParameterSubSchema)
- if ok {
- _, err := p.HeaderParameterSubSchema.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*NonBodyParameter_FormDataParameterSubSchema)
- if ok {
- _, err := p.FormDataParameterSubSchema.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*NonBodyParameter_QueryParameterSubSchema)
- if ok {
- _, err := p.QueryParameterSubSchema.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*NonBodyParameter_PathParameterSubSchema)
- if ok {
- _, err := p.PathParameterSubSchema.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Oauth2AccessCodeSecurity objects.
-func (m *Oauth2AccessCodeSecurity) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Scopes != nil {
- _, err := m.Scopes.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Oauth2ApplicationSecurity objects.
-func (m *Oauth2ApplicationSecurity) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Scopes != nil {
- _, err := m.Scopes.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Oauth2ImplicitSecurity objects.
-func (m *Oauth2ImplicitSecurity) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Scopes != nil {
- _, err := m.Scopes.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Oauth2PasswordSecurity objects.
-func (m *Oauth2PasswordSecurity) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Scopes != nil {
- _, err := m.Scopes.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Oauth2Scopes objects.
-func (m *Oauth2Scopes) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Operation objects.
-func (m *Operation) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.ExternalDocs != nil {
- _, err := m.ExternalDocs.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Parameters {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- if m.Responses != nil {
- _, err := m.Responses.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Security {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Parameter objects.
-func (m *Parameter) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- {
- p, ok := m.Oneof.(*Parameter_BodyParameter)
- if ok {
- _, err := p.BodyParameter.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*Parameter_NonBodyParameter)
- if ok {
- _, err := p.NonBodyParameter.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside ParameterDefinitions objects.
-func (m *ParameterDefinitions) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside ParametersItem objects.
-func (m *ParametersItem) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- {
- p, ok := m.Oneof.(*ParametersItem_Parameter)
- if ok {
- _, err := p.Parameter.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*ParametersItem_JsonReference)
- if ok {
- info, err := p.JsonReference.ResolveReferences(root)
- if err != nil {
- return nil, err
- } else if info != nil {
- n, err := NewParametersItem(info, nil)
- if err != nil {
- return nil, err
- } else if n != nil {
- *m = *n
- return nil, nil
- }
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside PathItem objects.
-func (m *PathItem) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.XRef != "" {
- info, err := compiler.ReadInfoForRef(root, m.XRef)
- if err != nil {
- return nil, err
- }
- if info != nil {
- replacement, err := NewPathItem(info, nil)
- if err == nil {
- *m = *replacement
- return m.ResolveReferences(root)
- }
- }
- return info, nil
- }
- if m.Get != nil {
- _, err := m.Get.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Put != nil {
- _, err := m.Put.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Post != nil {
- _, err := m.Post.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Delete != nil {
- _, err := m.Delete.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Options != nil {
- _, err := m.Options.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Head != nil {
- _, err := m.Head.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Patch != nil {
- _, err := m.Patch.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Parameters {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside PathParameterSubSchema objects.
-func (m *PathParameterSubSchema) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Items != nil {
- _, err := m.Items.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Default != nil {
- _, err := m.Default.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Enum {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Paths objects.
-func (m *Paths) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- for _, item := range m.Path {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside PrimitivesItems objects.
-func (m *PrimitivesItems) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Items != nil {
- _, err := m.Items.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Default != nil {
- _, err := m.Default.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Enum {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Properties objects.
-func (m *Properties) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside QueryParameterSubSchema objects.
-func (m *QueryParameterSubSchema) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Items != nil {
- _, err := m.Items.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Default != nil {
- _, err := m.Default.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Enum {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Response objects.
-func (m *Response) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.Schema != nil {
- _, err := m.Schema.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Headers != nil {
- _, err := m.Headers.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Examples != nil {
- _, err := m.Examples.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside ResponseDefinitions objects.
-func (m *ResponseDefinitions) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside ResponseValue objects.
-func (m *ResponseValue) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- {
- p, ok := m.Oneof.(*ResponseValue_Response)
- if ok {
- _, err := p.Response.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*ResponseValue_JsonReference)
- if ok {
- info, err := p.JsonReference.ResolveReferences(root)
- if err != nil {
- return nil, err
- } else if info != nil {
- n, err := NewResponseValue(info, nil)
- if err != nil {
- return nil, err
- } else if n != nil {
- *m = *n
- return nil, nil
- }
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Responses objects.
-func (m *Responses) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.ResponseCode {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Schema objects.
-func (m *Schema) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.XRef != "" {
- info, err := compiler.ReadInfoForRef(root, m.XRef)
- if err != nil {
- return nil, err
- }
- if info != nil {
- replacement, err := NewSchema(info, nil)
- if err == nil {
- *m = *replacement
- return m.ResolveReferences(root)
- }
- }
- return info, nil
- }
- if m.Default != nil {
- _, err := m.Default.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.Enum {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- if m.AdditionalProperties != nil {
- _, err := m.AdditionalProperties.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Type != nil {
- _, err := m.Type.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Items != nil {
- _, err := m.Items.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.AllOf {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- if m.Properties != nil {
- _, err := m.Properties.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Xml != nil {
- _, err := m.Xml.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.ExternalDocs != nil {
- _, err := m.ExternalDocs.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- if m.Example != nil {
- _, err := m.Example.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside SchemaItem objects.
-func (m *SchemaItem) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- {
- p, ok := m.Oneof.(*SchemaItem_Schema)
- if ok {
- _, err := p.Schema.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*SchemaItem_FileSchema)
- if ok {
- _, err := p.FileSchema.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside SecurityDefinitions objects.
-func (m *SecurityDefinitions) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside SecurityDefinitionsItem objects.
-func (m *SecurityDefinitionsItem) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- {
- p, ok := m.Oneof.(*SecurityDefinitionsItem_BasicAuthenticationSecurity)
- if ok {
- _, err := p.BasicAuthenticationSecurity.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*SecurityDefinitionsItem_ApiKeySecurity)
- if ok {
- _, err := p.ApiKeySecurity.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2ImplicitSecurity)
- if ok {
- _, err := p.Oauth2ImplicitSecurity.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2PasswordSecurity)
- if ok {
- _, err := p.Oauth2PasswordSecurity.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2ApplicationSecurity)
- if ok {
- _, err := p.Oauth2ApplicationSecurity.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- {
- p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2AccessCodeSecurity)
- if ok {
- _, err := p.Oauth2AccessCodeSecurity.ResolveReferences(root)
- if err != nil {
- return nil, err
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside SecurityRequirement objects.
-func (m *SecurityRequirement) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside StringArray objects.
-func (m *StringArray) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Tag objects.
-func (m *Tag) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- if m.ExternalDocs != nil {
- _, err := m.ExternalDocs.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside TypeItem objects.
-func (m *TypeItem) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside VendorExtension objects.
-func (m *VendorExtension) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.AdditionalProperties {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ResolveReferences resolves references found inside Xml objects.
-func (m *Xml) ResolveReferences(root string) (interface{}, error) {
- errors := make([]error, 0)
- for _, item := range m.VendorExtension {
- if item != nil {
- _, err := item.ResolveReferences(root)
- if err != nil {
- errors = append(errors, err)
- }
- }
- }
- return nil, compiler.NewErrorGroupOrNil(errors)
-}
-
-// ToRawInfo returns a description of AdditionalPropertiesItem suitable for JSON or YAML export.
-func (m *AdditionalPropertiesItem) ToRawInfo() interface{} {
- // ONE OF WRAPPER
- // AdditionalPropertiesItem
- // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v0 := m.GetSchema()
- if v0 != nil {
- return v0.ToRawInfo()
- }
- // {Name:boolean Type:bool StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if v1, ok := m.GetOneof().(*AdditionalPropertiesItem_Boolean); ok {
- return v1.Boolean
- }
- return nil
-}
-
-// ToRawInfo returns a description of Any suitable for JSON or YAML export.
-func (m *Any) ToRawInfo() interface{} {
- var err error
- var info1 []yaml.MapSlice
- err = yaml.Unmarshal([]byte(m.Yaml), &info1)
- if err == nil {
- return info1
- }
- var info2 yaml.MapSlice
- err = yaml.Unmarshal([]byte(m.Yaml), &info2)
- if err == nil {
- return info2
- }
- var info3 interface{}
- err = yaml.Unmarshal([]byte(m.Yaml), &info3)
- if err == nil {
- return info3
- }
- return nil
-}
-
-// ToRawInfo returns a description of ApiKeySecurity suitable for JSON or YAML export.
-func (m *ApiKeySecurity) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "in", Value: m.In})
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of BasicAuthenticationSecurity suitable for JSON or YAML export.
-func (m *BasicAuthenticationSecurity) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of BodyParameter suitable for JSON or YAML export.
-func (m *BodyParameter) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "in", Value: m.In})
- if m.Required != false {
- info = append(info, yaml.MapItem{Key: "required", Value: m.Required})
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "schema", Value: m.Schema.ToRawInfo()})
- // &{Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Contact suitable for JSON or YAML export.
-func (m *Contact) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- if m.Url != "" {
- info = append(info, yaml.MapItem{Key: "url", Value: m.Url})
- }
- if m.Email != "" {
- info = append(info, yaml.MapItem{Key: "email", Value: m.Email})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Default suitable for JSON or YAML export.
-func (m *Default) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.AdditionalProperties != nil {
- for _, item := range m.AdditionalProperties {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:false Description:}
- return info
-}
-
-// ToRawInfo returns a description of Definitions suitable for JSON or YAML export.
-func (m *Definitions) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.AdditionalProperties != nil {
- for _, item := range m.AdditionalProperties {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:additionalProperties Type:NamedSchema StringEnumValues:[] MapType:Schema Repeated:true Pattern: Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Document suitable for JSON or YAML export.
-func (m *Document) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "swagger", Value: m.Swagger})
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "info", Value: m.Info.ToRawInfo()})
- // &{Name:info Type:Info StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Host != "" {
- info = append(info, yaml.MapItem{Key: "host", Value: m.Host})
- }
- if m.BasePath != "" {
- info = append(info, yaml.MapItem{Key: "basePath", Value: m.BasePath})
- }
- if len(m.Schemes) != 0 {
- info = append(info, yaml.MapItem{Key: "schemes", Value: m.Schemes})
- }
- if len(m.Consumes) != 0 {
- info = append(info, yaml.MapItem{Key: "consumes", Value: m.Consumes})
- }
- if len(m.Produces) != 0 {
- info = append(info, yaml.MapItem{Key: "produces", Value: m.Produces})
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "paths", Value: m.Paths.ToRawInfo()})
- // &{Name:paths Type:Paths StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Definitions != nil {
- info = append(info, yaml.MapItem{Key: "definitions", Value: m.Definitions.ToRawInfo()})
- }
- // &{Name:definitions Type:Definitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Parameters != nil {
- info = append(info, yaml.MapItem{Key: "parameters", Value: m.Parameters.ToRawInfo()})
- }
- // &{Name:parameters Type:ParameterDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Responses != nil {
- info = append(info, yaml.MapItem{Key: "responses", Value: m.Responses.ToRawInfo()})
- }
- // &{Name:responses Type:ResponseDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if len(m.Security) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Security {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "security", Value: items})
- }
- // &{Name:security Type:SecurityRequirement StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.SecurityDefinitions != nil {
- info = append(info, yaml.MapItem{Key: "securityDefinitions", Value: m.SecurityDefinitions.ToRawInfo()})
- }
- // &{Name:securityDefinitions Type:SecurityDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if len(m.Tags) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Tags {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "tags", Value: items})
- }
- // &{Name:tags Type:Tag StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.ExternalDocs != nil {
- info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()})
- }
- // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Examples suitable for JSON or YAML export.
-func (m *Examples) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.AdditionalProperties != nil {
- for _, item := range m.AdditionalProperties {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of ExternalDocs suitable for JSON or YAML export.
-func (m *ExternalDocs) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "url", Value: m.Url})
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of FileSchema suitable for JSON or YAML export.
-func (m *FileSchema) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Format != "" {
- info = append(info, yaml.MapItem{Key: "format", Value: m.Format})
- }
- if m.Title != "" {
- info = append(info, yaml.MapItem{Key: "title", Value: m.Title})
- }
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.Default != nil {
- info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()})
- }
- // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if len(m.Required) != 0 {
- info = append(info, yaml.MapItem{Key: "required", Value: m.Required})
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- if m.ReadOnly != false {
- info = append(info, yaml.MapItem{Key: "readOnly", Value: m.ReadOnly})
- }
- if m.ExternalDocs != nil {
- info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()})
- }
- // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Example != nil {
- info = append(info, yaml.MapItem{Key: "example", Value: m.Example.ToRawInfo()})
- }
- // &{Name:example Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of FormDataParameterSubSchema suitable for JSON or YAML export.
-func (m *FormDataParameterSubSchema) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Required != false {
- info = append(info, yaml.MapItem{Key: "required", Value: m.Required})
- }
- if m.In != "" {
- info = append(info, yaml.MapItem{Key: "in", Value: m.In})
- }
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- if m.AllowEmptyValue != false {
- info = append(info, yaml.MapItem{Key: "allowEmptyValue", Value: m.AllowEmptyValue})
- }
- if m.Type != "" {
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- }
- if m.Format != "" {
- info = append(info, yaml.MapItem{Key: "format", Value: m.Format})
- }
- if m.Items != nil {
- info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()})
- }
- // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.CollectionFormat != "" {
- info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat})
- }
- if m.Default != nil {
- info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()})
- }
- // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Maximum != 0.0 {
- info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum})
- }
- if m.ExclusiveMaximum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum})
- }
- if m.Minimum != 0.0 {
- info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum})
- }
- if m.ExclusiveMinimum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum})
- }
- if m.MaxLength != 0 {
- info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength})
- }
- if m.MinLength != 0 {
- info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength})
- }
- if m.Pattern != "" {
- info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern})
- }
- if m.MaxItems != 0 {
- info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems})
- }
- if m.MinItems != 0 {
- info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems})
- }
- if m.UniqueItems != false {
- info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems})
- }
- if len(m.Enum) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Enum {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "enum", Value: items})
- }
- // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.MultipleOf != 0.0 {
- info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Header suitable for JSON or YAML export.
-func (m *Header) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- if m.Format != "" {
- info = append(info, yaml.MapItem{Key: "format", Value: m.Format})
- }
- if m.Items != nil {
- info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()})
- }
- // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.CollectionFormat != "" {
- info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat})
- }
- if m.Default != nil {
- info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()})
- }
- // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Maximum != 0.0 {
- info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum})
- }
- if m.ExclusiveMaximum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum})
- }
- if m.Minimum != 0.0 {
- info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum})
- }
- if m.ExclusiveMinimum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum})
- }
- if m.MaxLength != 0 {
- info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength})
- }
- if m.MinLength != 0 {
- info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength})
- }
- if m.Pattern != "" {
- info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern})
- }
- if m.MaxItems != 0 {
- info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems})
- }
- if m.MinItems != 0 {
- info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems})
- }
- if m.UniqueItems != false {
- info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems})
- }
- if len(m.Enum) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Enum {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "enum", Value: items})
- }
- // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.MultipleOf != 0.0 {
- info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf})
- }
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of HeaderParameterSubSchema suitable for JSON or YAML export.
-func (m *HeaderParameterSubSchema) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Required != false {
- info = append(info, yaml.MapItem{Key: "required", Value: m.Required})
- }
- if m.In != "" {
- info = append(info, yaml.MapItem{Key: "in", Value: m.In})
- }
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- if m.Type != "" {
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- }
- if m.Format != "" {
- info = append(info, yaml.MapItem{Key: "format", Value: m.Format})
- }
- if m.Items != nil {
- info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()})
- }
- // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.CollectionFormat != "" {
- info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat})
- }
- if m.Default != nil {
- info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()})
- }
- // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Maximum != 0.0 {
- info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum})
- }
- if m.ExclusiveMaximum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum})
- }
- if m.Minimum != 0.0 {
- info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum})
- }
- if m.ExclusiveMinimum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum})
- }
- if m.MaxLength != 0 {
- info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength})
- }
- if m.MinLength != 0 {
- info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength})
- }
- if m.Pattern != "" {
- info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern})
- }
- if m.MaxItems != 0 {
- info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems})
- }
- if m.MinItems != 0 {
- info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems})
- }
- if m.UniqueItems != false {
- info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems})
- }
- if len(m.Enum) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Enum {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "enum", Value: items})
- }
- // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.MultipleOf != 0.0 {
- info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Headers suitable for JSON or YAML export.
-func (m *Headers) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.AdditionalProperties != nil {
- for _, item := range m.AdditionalProperties {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:additionalProperties Type:NamedHeader StringEnumValues:[] MapType:Header Repeated:true Pattern: Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Info suitable for JSON or YAML export.
-func (m *Info) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "title", Value: m.Title})
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "version", Value: m.Version})
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.TermsOfService != "" {
- info = append(info, yaml.MapItem{Key: "termsOfService", Value: m.TermsOfService})
- }
- if m.Contact != nil {
- info = append(info, yaml.MapItem{Key: "contact", Value: m.Contact.ToRawInfo()})
- }
- // &{Name:contact Type:Contact StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.License != nil {
- info = append(info, yaml.MapItem{Key: "license", Value: m.License.ToRawInfo()})
- }
- // &{Name:license Type:License StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of ItemsItem suitable for JSON or YAML export.
-func (m *ItemsItem) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if len(m.Schema) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Schema {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "schema", Value: items})
- }
- // &{Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- return info
-}
-
-// ToRawInfo returns a description of JsonReference suitable for JSON or YAML export.
-func (m *JsonReference) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "$ref", Value: m.XRef})
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- return info
-}
-
-// ToRawInfo returns a description of License suitable for JSON or YAML export.
-func (m *License) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- if m.Url != "" {
- info = append(info, yaml.MapItem{Key: "url", Value: m.Url})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of NamedAny suitable for JSON or YAML export.
-func (m *NamedAny) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- // &{Name:value Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}
- return info
-}
-
-// ToRawInfo returns a description of NamedHeader suitable for JSON or YAML export.
-func (m *NamedHeader) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- // &{Name:value Type:Header StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}
- return info
-}
-
-// ToRawInfo returns a description of NamedParameter suitable for JSON or YAML export.
-func (m *NamedParameter) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- // &{Name:value Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}
- return info
-}
-
-// ToRawInfo returns a description of NamedPathItem suitable for JSON or YAML export.
-func (m *NamedPathItem) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- // &{Name:value Type:PathItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}
- return info
-}
-
-// ToRawInfo returns a description of NamedResponse suitable for JSON or YAML export.
-func (m *NamedResponse) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- // &{Name:value Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}
- return info
-}
-
-// ToRawInfo returns a description of NamedResponseValue suitable for JSON or YAML export.
-func (m *NamedResponseValue) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- // &{Name:value Type:ResponseValue StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}
- return info
-}
-
-// ToRawInfo returns a description of NamedSchema suitable for JSON or YAML export.
-func (m *NamedSchema) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- // &{Name:value Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}
- return info
-}
-
-// ToRawInfo returns a description of NamedSecurityDefinitionsItem suitable for JSON or YAML export.
-func (m *NamedSecurityDefinitionsItem) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- // &{Name:value Type:SecurityDefinitionsItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}
- return info
-}
-
-// ToRawInfo returns a description of NamedString suitable for JSON or YAML export.
-func (m *NamedString) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- if m.Value != "" {
- info = append(info, yaml.MapItem{Key: "value", Value: m.Value})
- }
- return info
-}
-
-// ToRawInfo returns a description of NamedStringArray suitable for JSON or YAML export.
-func (m *NamedStringArray) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- // &{Name:value Type:StringArray StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value}
- return info
-}
-
-// ToRawInfo returns a description of NonBodyParameter suitable for JSON or YAML export.
-func (m *NonBodyParameter) ToRawInfo() interface{} {
- // ONE OF WRAPPER
- // NonBodyParameter
- // {Name:headerParameterSubSchema Type:HeaderParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v0 := m.GetHeaderParameterSubSchema()
- if v0 != nil {
- return v0.ToRawInfo()
- }
- // {Name:formDataParameterSubSchema Type:FormDataParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v1 := m.GetFormDataParameterSubSchema()
- if v1 != nil {
- return v1.ToRawInfo()
- }
- // {Name:queryParameterSubSchema Type:QueryParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v2 := m.GetQueryParameterSubSchema()
- if v2 != nil {
- return v2.ToRawInfo()
- }
- // {Name:pathParameterSubSchema Type:PathParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v3 := m.GetPathParameterSubSchema()
- if v3 != nil {
- return v3.ToRawInfo()
- }
- return nil
-}
-
-// ToRawInfo returns a description of Oauth2AccessCodeSecurity suitable for JSON or YAML export.
-func (m *Oauth2AccessCodeSecurity) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow})
- if m.Scopes != nil {
- info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()})
- }
- // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "authorizationUrl", Value: m.AuthorizationUrl})
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "tokenUrl", Value: m.TokenUrl})
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Oauth2ApplicationSecurity suitable for JSON or YAML export.
-func (m *Oauth2ApplicationSecurity) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow})
- if m.Scopes != nil {
- info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()})
- }
- // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "tokenUrl", Value: m.TokenUrl})
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Oauth2ImplicitSecurity suitable for JSON or YAML export.
-func (m *Oauth2ImplicitSecurity) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow})
- if m.Scopes != nil {
- info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()})
- }
- // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "authorizationUrl", Value: m.AuthorizationUrl})
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Oauth2PasswordSecurity suitable for JSON or YAML export.
-func (m *Oauth2PasswordSecurity) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "flow", Value: m.Flow})
- if m.Scopes != nil {
- info = append(info, yaml.MapItem{Key: "scopes", Value: m.Scopes.ToRawInfo()})
- }
- // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "tokenUrl", Value: m.TokenUrl})
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Oauth2Scopes suitable for JSON or YAML export.
-func (m *Oauth2Scopes) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Operation suitable for JSON or YAML export.
-func (m *Operation) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if len(m.Tags) != 0 {
- info = append(info, yaml.MapItem{Key: "tags", Value: m.Tags})
- }
- if m.Summary != "" {
- info = append(info, yaml.MapItem{Key: "summary", Value: m.Summary})
- }
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.ExternalDocs != nil {
- info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()})
- }
- // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.OperationId != "" {
- info = append(info, yaml.MapItem{Key: "operationId", Value: m.OperationId})
- }
- if len(m.Produces) != 0 {
- info = append(info, yaml.MapItem{Key: "produces", Value: m.Produces})
- }
- if len(m.Consumes) != 0 {
- info = append(info, yaml.MapItem{Key: "consumes", Value: m.Consumes})
- }
- if len(m.Parameters) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Parameters {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "parameters", Value: items})
- }
- // &{Name:parameters Type:ParametersItem StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:The parameters needed to send a valid API call.}
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "responses", Value: m.Responses.ToRawInfo()})
- // &{Name:responses Type:Responses StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if len(m.Schemes) != 0 {
- info = append(info, yaml.MapItem{Key: "schemes", Value: m.Schemes})
- }
- if m.Deprecated != false {
- info = append(info, yaml.MapItem{Key: "deprecated", Value: m.Deprecated})
- }
- if len(m.Security) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Security {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "security", Value: items})
- }
- // &{Name:security Type:SecurityRequirement StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Parameter suitable for JSON or YAML export.
-func (m *Parameter) ToRawInfo() interface{} {
- // ONE OF WRAPPER
- // Parameter
- // {Name:bodyParameter Type:BodyParameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v0 := m.GetBodyParameter()
- if v0 != nil {
- return v0.ToRawInfo()
- }
- // {Name:nonBodyParameter Type:NonBodyParameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v1 := m.GetNonBodyParameter()
- if v1 != nil {
- return v1.ToRawInfo()
- }
- return nil
-}
-
-// ToRawInfo returns a description of ParameterDefinitions suitable for JSON or YAML export.
-func (m *ParameterDefinitions) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.AdditionalProperties != nil {
- for _, item := range m.AdditionalProperties {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:additionalProperties Type:NamedParameter StringEnumValues:[] MapType:Parameter Repeated:true Pattern: Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of ParametersItem suitable for JSON or YAML export.
-func (m *ParametersItem) ToRawInfo() interface{} {
- // ONE OF WRAPPER
- // ParametersItem
- // {Name:parameter Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v0 := m.GetParameter()
- if v0 != nil {
- return v0.ToRawInfo()
- }
- // {Name:jsonReference Type:JsonReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v1 := m.GetJsonReference()
- if v1 != nil {
- return v1.ToRawInfo()
- }
- return nil
-}
-
-// ToRawInfo returns a description of PathItem suitable for JSON or YAML export.
-func (m *PathItem) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.XRef != "" {
- info = append(info, yaml.MapItem{Key: "$ref", Value: m.XRef})
- }
- if m.Get != nil {
- info = append(info, yaml.MapItem{Key: "get", Value: m.Get.ToRawInfo()})
- }
- // &{Name:get Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Put != nil {
- info = append(info, yaml.MapItem{Key: "put", Value: m.Put.ToRawInfo()})
- }
- // &{Name:put Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Post != nil {
- info = append(info, yaml.MapItem{Key: "post", Value: m.Post.ToRawInfo()})
- }
- // &{Name:post Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Delete != nil {
- info = append(info, yaml.MapItem{Key: "delete", Value: m.Delete.ToRawInfo()})
- }
- // &{Name:delete Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Options != nil {
- info = append(info, yaml.MapItem{Key: "options", Value: m.Options.ToRawInfo()})
- }
- // &{Name:options Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Head != nil {
- info = append(info, yaml.MapItem{Key: "head", Value: m.Head.ToRawInfo()})
- }
- // &{Name:head Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Patch != nil {
- info = append(info, yaml.MapItem{Key: "patch", Value: m.Patch.ToRawInfo()})
- }
- // &{Name:patch Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if len(m.Parameters) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Parameters {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "parameters", Value: items})
- }
- // &{Name:parameters Type:ParametersItem StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:The parameters needed to send a valid API call.}
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of PathParameterSubSchema suitable for JSON or YAML export.
-func (m *PathParameterSubSchema) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "required", Value: m.Required})
- if m.In != "" {
- info = append(info, yaml.MapItem{Key: "in", Value: m.In})
- }
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- if m.Type != "" {
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- }
- if m.Format != "" {
- info = append(info, yaml.MapItem{Key: "format", Value: m.Format})
- }
- if m.Items != nil {
- info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()})
- }
- // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.CollectionFormat != "" {
- info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat})
- }
- if m.Default != nil {
- info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()})
- }
- // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Maximum != 0.0 {
- info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum})
- }
- if m.ExclusiveMaximum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum})
- }
- if m.Minimum != 0.0 {
- info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum})
- }
- if m.ExclusiveMinimum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum})
- }
- if m.MaxLength != 0 {
- info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength})
- }
- if m.MinLength != 0 {
- info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength})
- }
- if m.Pattern != "" {
- info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern})
- }
- if m.MaxItems != 0 {
- info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems})
- }
- if m.MinItems != 0 {
- info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems})
- }
- if m.UniqueItems != false {
- info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems})
- }
- if len(m.Enum) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Enum {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "enum", Value: items})
- }
- // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.MultipleOf != 0.0 {
- info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Paths suitable for JSON or YAML export.
-func (m *Paths) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- if m.Path != nil {
- for _, item := range m.Path {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:Path Type:NamedPathItem StringEnumValues:[] MapType:PathItem Repeated:true Pattern:^/ Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of PrimitivesItems suitable for JSON or YAML export.
-func (m *PrimitivesItems) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Type != "" {
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- }
- if m.Format != "" {
- info = append(info, yaml.MapItem{Key: "format", Value: m.Format})
- }
- if m.Items != nil {
- info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()})
- }
- // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.CollectionFormat != "" {
- info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat})
- }
- if m.Default != nil {
- info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()})
- }
- // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Maximum != 0.0 {
- info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum})
- }
- if m.ExclusiveMaximum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum})
- }
- if m.Minimum != 0.0 {
- info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum})
- }
- if m.ExclusiveMinimum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum})
- }
- if m.MaxLength != 0 {
- info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength})
- }
- if m.MinLength != 0 {
- info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength})
- }
- if m.Pattern != "" {
- info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern})
- }
- if m.MaxItems != 0 {
- info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems})
- }
- if m.MinItems != 0 {
- info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems})
- }
- if m.UniqueItems != false {
- info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems})
- }
- if len(m.Enum) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Enum {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "enum", Value: items})
- }
- // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.MultipleOf != 0.0 {
- info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Properties suitable for JSON or YAML export.
-func (m *Properties) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.AdditionalProperties != nil {
- for _, item := range m.AdditionalProperties {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:additionalProperties Type:NamedSchema StringEnumValues:[] MapType:Schema Repeated:true Pattern: Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of QueryParameterSubSchema suitable for JSON or YAML export.
-func (m *QueryParameterSubSchema) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Required != false {
- info = append(info, yaml.MapItem{Key: "required", Value: m.Required})
- }
- if m.In != "" {
- info = append(info, yaml.MapItem{Key: "in", Value: m.In})
- }
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- if m.AllowEmptyValue != false {
- info = append(info, yaml.MapItem{Key: "allowEmptyValue", Value: m.AllowEmptyValue})
- }
- if m.Type != "" {
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type})
- }
- if m.Format != "" {
- info = append(info, yaml.MapItem{Key: "format", Value: m.Format})
- }
- if m.Items != nil {
- info = append(info, yaml.MapItem{Key: "items", Value: m.Items.ToRawInfo()})
- }
- // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.CollectionFormat != "" {
- info = append(info, yaml.MapItem{Key: "collectionFormat", Value: m.CollectionFormat})
- }
- if m.Default != nil {
- info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()})
- }
- // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Maximum != 0.0 {
- info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum})
- }
- if m.ExclusiveMaximum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum})
- }
- if m.Minimum != 0.0 {
- info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum})
- }
- if m.ExclusiveMinimum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum})
- }
- if m.MaxLength != 0 {
- info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength})
- }
- if m.MinLength != 0 {
- info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength})
- }
- if m.Pattern != "" {
- info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern})
- }
- if m.MaxItems != 0 {
- info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems})
- }
- if m.MinItems != 0 {
- info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems})
- }
- if m.UniqueItems != false {
- info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems})
- }
- if len(m.Enum) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Enum {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "enum", Value: items})
- }
- // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.MultipleOf != 0.0 {
- info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Response suitable for JSON or YAML export.
-func (m *Response) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- if m.Schema != nil {
- info = append(info, yaml.MapItem{Key: "schema", Value: m.Schema.ToRawInfo()})
- }
- // &{Name:schema Type:SchemaItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Headers != nil {
- info = append(info, yaml.MapItem{Key: "headers", Value: m.Headers.ToRawInfo()})
- }
- // &{Name:headers Type:Headers StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Examples != nil {
- info = append(info, yaml.MapItem{Key: "examples", Value: m.Examples.ToRawInfo()})
- }
- // &{Name:examples Type:Examples StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of ResponseDefinitions suitable for JSON or YAML export.
-func (m *ResponseDefinitions) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.AdditionalProperties != nil {
- for _, item := range m.AdditionalProperties {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:additionalProperties Type:NamedResponse StringEnumValues:[] MapType:Response Repeated:true Pattern: Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of ResponseValue suitable for JSON or YAML export.
-func (m *ResponseValue) ToRawInfo() interface{} {
- // ONE OF WRAPPER
- // ResponseValue
- // {Name:response Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v0 := m.GetResponse()
- if v0 != nil {
- return v0.ToRawInfo()
- }
- // {Name:jsonReference Type:JsonReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v1 := m.GetJsonReference()
- if v1 != nil {
- return v1.ToRawInfo()
- }
- return nil
-}
-
-// ToRawInfo returns a description of Responses suitable for JSON or YAML export.
-func (m *Responses) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.ResponseCode != nil {
- for _, item := range m.ResponseCode {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:ResponseCode Type:NamedResponseValue StringEnumValues:[] MapType:ResponseValue Repeated:true Pattern:^([0-9]{3})$|^(default)$ Implicit:true Description:}
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Schema suitable for JSON or YAML export.
-func (m *Schema) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.XRef != "" {
- info = append(info, yaml.MapItem{Key: "$ref", Value: m.XRef})
- }
- if m.Format != "" {
- info = append(info, yaml.MapItem{Key: "format", Value: m.Format})
- }
- if m.Title != "" {
- info = append(info, yaml.MapItem{Key: "title", Value: m.Title})
- }
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.Default != nil {
- info = append(info, yaml.MapItem{Key: "default", Value: m.Default.ToRawInfo()})
- }
- // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.MultipleOf != 0.0 {
- info = append(info, yaml.MapItem{Key: "multipleOf", Value: m.MultipleOf})
- }
- if m.Maximum != 0.0 {
- info = append(info, yaml.MapItem{Key: "maximum", Value: m.Maximum})
- }
- if m.ExclusiveMaximum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMaximum", Value: m.ExclusiveMaximum})
- }
- if m.Minimum != 0.0 {
- info = append(info, yaml.MapItem{Key: "minimum", Value: m.Minimum})
- }
- if m.ExclusiveMinimum != false {
- info = append(info, yaml.MapItem{Key: "exclusiveMinimum", Value: m.ExclusiveMinimum})
- }
- if m.MaxLength != 0 {
- info = append(info, yaml.MapItem{Key: "maxLength", Value: m.MaxLength})
- }
- if m.MinLength != 0 {
- info = append(info, yaml.MapItem{Key: "minLength", Value: m.MinLength})
- }
- if m.Pattern != "" {
- info = append(info, yaml.MapItem{Key: "pattern", Value: m.Pattern})
- }
- if m.MaxItems != 0 {
- info = append(info, yaml.MapItem{Key: "maxItems", Value: m.MaxItems})
- }
- if m.MinItems != 0 {
- info = append(info, yaml.MapItem{Key: "minItems", Value: m.MinItems})
- }
- if m.UniqueItems != false {
- info = append(info, yaml.MapItem{Key: "uniqueItems", Value: m.UniqueItems})
- }
- if m.MaxProperties != 0 {
- info = append(info, yaml.MapItem{Key: "maxProperties", Value: m.MaxProperties})
- }
- if m.MinProperties != 0 {
- info = append(info, yaml.MapItem{Key: "minProperties", Value: m.MinProperties})
- }
- if len(m.Required) != 0 {
- info = append(info, yaml.MapItem{Key: "required", Value: m.Required})
- }
- if len(m.Enum) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.Enum {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "enum", Value: items})
- }
- // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.AdditionalProperties != nil {
- info = append(info, yaml.MapItem{Key: "additionalProperties", Value: m.AdditionalProperties.ToRawInfo()})
- }
- // &{Name:additionalProperties Type:AdditionalPropertiesItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Type != nil {
- if len(m.Type.Value) == 1 {
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type.Value[0]})
- } else {
- info = append(info, yaml.MapItem{Key: "type", Value: m.Type.Value})
- }
- }
- // &{Name:type Type:TypeItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Items != nil {
- items := make([]interface{}, 0)
- for _, item := range m.Items.Schema {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "items", Value: items[0]})
- }
- // &{Name:items Type:ItemsItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if len(m.AllOf) != 0 {
- items := make([]interface{}, 0)
- for _, item := range m.AllOf {
- items = append(items, item.ToRawInfo())
- }
- info = append(info, yaml.MapItem{Key: "allOf", Value: items})
- }
- // &{Name:allOf Type:Schema StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:}
- if m.Properties != nil {
- info = append(info, yaml.MapItem{Key: "properties", Value: m.Properties.ToRawInfo()})
- }
- // &{Name:properties Type:Properties StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Discriminator != "" {
- info = append(info, yaml.MapItem{Key: "discriminator", Value: m.Discriminator})
- }
- if m.ReadOnly != false {
- info = append(info, yaml.MapItem{Key: "readOnly", Value: m.ReadOnly})
- }
- if m.Xml != nil {
- info = append(info, yaml.MapItem{Key: "xml", Value: m.Xml.ToRawInfo()})
- }
- // &{Name:xml Type:Xml StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.ExternalDocs != nil {
- info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()})
- }
- // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.Example != nil {
- info = append(info, yaml.MapItem{Key: "example", Value: m.Example.ToRawInfo()})
- }
- // &{Name:example Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of SchemaItem suitable for JSON or YAML export.
-func (m *SchemaItem) ToRawInfo() interface{} {
- // ONE OF WRAPPER
- // SchemaItem
- // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v0 := m.GetSchema()
- if v0 != nil {
- return v0.ToRawInfo()
- }
- // {Name:fileSchema Type:FileSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v1 := m.GetFileSchema()
- if v1 != nil {
- return v1.ToRawInfo()
- }
- return nil
-}
-
-// ToRawInfo returns a description of SecurityDefinitions suitable for JSON or YAML export.
-func (m *SecurityDefinitions) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.AdditionalProperties != nil {
- for _, item := range m.AdditionalProperties {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:additionalProperties Type:NamedSecurityDefinitionsItem StringEnumValues:[] MapType:SecurityDefinitionsItem Repeated:true Pattern: Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of SecurityDefinitionsItem suitable for JSON or YAML export.
-func (m *SecurityDefinitionsItem) ToRawInfo() interface{} {
- // ONE OF WRAPPER
- // SecurityDefinitionsItem
- // {Name:basicAuthenticationSecurity Type:BasicAuthenticationSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v0 := m.GetBasicAuthenticationSecurity()
- if v0 != nil {
- return v0.ToRawInfo()
- }
- // {Name:apiKeySecurity Type:ApiKeySecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v1 := m.GetApiKeySecurity()
- if v1 != nil {
- return v1.ToRawInfo()
- }
- // {Name:oauth2ImplicitSecurity Type:Oauth2ImplicitSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v2 := m.GetOauth2ImplicitSecurity()
- if v2 != nil {
- return v2.ToRawInfo()
- }
- // {Name:oauth2PasswordSecurity Type:Oauth2PasswordSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v3 := m.GetOauth2PasswordSecurity()
- if v3 != nil {
- return v3.ToRawInfo()
- }
- // {Name:oauth2ApplicationSecurity Type:Oauth2ApplicationSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v4 := m.GetOauth2ApplicationSecurity()
- if v4 != nil {
- return v4.ToRawInfo()
- }
- // {Name:oauth2AccessCodeSecurity Type:Oauth2AccessCodeSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- v5 := m.GetOauth2AccessCodeSecurity()
- if v5 != nil {
- return v5.ToRawInfo()
- }
- return nil
-}
-
-// ToRawInfo returns a description of SecurityRequirement suitable for JSON or YAML export.
-func (m *SecurityRequirement) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.AdditionalProperties != nil {
- for _, item := range m.AdditionalProperties {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:additionalProperties Type:NamedStringArray StringEnumValues:[] MapType:StringArray Repeated:true Pattern: Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of StringArray suitable for JSON or YAML export.
-func (m *StringArray) ToRawInfo() interface{} {
- return m.Value
-}
-
-// ToRawInfo returns a description of Tag suitable for JSON or YAML export.
-func (m *Tag) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- // always include this required field.
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- if m.Description != "" {
- info = append(info, yaml.MapItem{Key: "description", Value: m.Description})
- }
- if m.ExternalDocs != nil {
- info = append(info, yaml.MapItem{Key: "externalDocs", Value: m.ExternalDocs.ToRawInfo()})
- }
- // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:}
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of TypeItem suitable for JSON or YAML export.
-func (m *TypeItem) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if len(m.Value) != 0 {
- info = append(info, yaml.MapItem{Key: "value", Value: m.Value})
- }
- return info
-}
-
-// ToRawInfo returns a description of VendorExtension suitable for JSON or YAML export.
-func (m *VendorExtension) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.AdditionalProperties != nil {
- for _, item := range m.AdditionalProperties {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:true Description:}
- return info
-}
-
-// ToRawInfo returns a description of Xml suitable for JSON or YAML export.
-func (m *Xml) ToRawInfo() interface{} {
- info := yaml.MapSlice{}
- if m == nil {
- return info
- }
- if m.Name != "" {
- info = append(info, yaml.MapItem{Key: "name", Value: m.Name})
- }
- if m.Namespace != "" {
- info = append(info, yaml.MapItem{Key: "namespace", Value: m.Namespace})
- }
- if m.Prefix != "" {
- info = append(info, yaml.MapItem{Key: "prefix", Value: m.Prefix})
- }
- if m.Attribute != false {
- info = append(info, yaml.MapItem{Key: "attribute", Value: m.Attribute})
- }
- if m.Wrapped != false {
- info = append(info, yaml.MapItem{Key: "wrapped", Value: m.Wrapped})
- }
- if m.VendorExtension != nil {
- for _, item := range m.VendorExtension {
- info = append(info, yaml.MapItem{Key: item.Name, Value: item.Value.ToRawInfo()})
- }
- }
- // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:}
- return info
-}
-
-var (
- pattern0 = regexp.MustCompile("^x-")
- pattern1 = regexp.MustCompile("^/")
- pattern2 = regexp.MustCompile("^([0-9]{3})$|^(default)$")
-)
diff --git a/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go b/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go
deleted file mode 100644
index 55a6cb51..00000000
--- a/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.pb.go
+++ /dev/null
@@ -1,5226 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: openapiv2/OpenAPIv2.proto
-
-package openapi_v2
-
-import (
- fmt "fmt"
- proto "github.com/golang/protobuf/proto"
- any "github.com/golang/protobuf/ptypes/any"
- math "math"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
-type AdditionalPropertiesItem struct {
- // Types that are valid to be assigned to Oneof:
- // *AdditionalPropertiesItem_Schema
- // *AdditionalPropertiesItem_Boolean
- Oneof isAdditionalPropertiesItem_Oneof `protobuf_oneof:"oneof"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *AdditionalPropertiesItem) Reset() { *m = AdditionalPropertiesItem{} }
-func (m *AdditionalPropertiesItem) String() string { return proto.CompactTextString(m) }
-func (*AdditionalPropertiesItem) ProtoMessage() {}
-func (*AdditionalPropertiesItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{0}
-}
-
-func (m *AdditionalPropertiesItem) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_AdditionalPropertiesItem.Unmarshal(m, b)
-}
-func (m *AdditionalPropertiesItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_AdditionalPropertiesItem.Marshal(b, m, deterministic)
-}
-func (m *AdditionalPropertiesItem) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AdditionalPropertiesItem.Merge(m, src)
-}
-func (m *AdditionalPropertiesItem) XXX_Size() int {
- return xxx_messageInfo_AdditionalPropertiesItem.Size(m)
-}
-func (m *AdditionalPropertiesItem) XXX_DiscardUnknown() {
- xxx_messageInfo_AdditionalPropertiesItem.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AdditionalPropertiesItem proto.InternalMessageInfo
-
-type isAdditionalPropertiesItem_Oneof interface {
- isAdditionalPropertiesItem_Oneof()
-}
-
-type AdditionalPropertiesItem_Schema struct {
- Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"`
-}
-
-type AdditionalPropertiesItem_Boolean struct {
- Boolean bool `protobuf:"varint,2,opt,name=boolean,proto3,oneof"`
-}
-
-func (*AdditionalPropertiesItem_Schema) isAdditionalPropertiesItem_Oneof() {}
-
-func (*AdditionalPropertiesItem_Boolean) isAdditionalPropertiesItem_Oneof() {}
-
-func (m *AdditionalPropertiesItem) GetOneof() isAdditionalPropertiesItem_Oneof {
- if m != nil {
- return m.Oneof
- }
- return nil
-}
-
-func (m *AdditionalPropertiesItem) GetSchema() *Schema {
- if x, ok := m.GetOneof().(*AdditionalPropertiesItem_Schema); ok {
- return x.Schema
- }
- return nil
-}
-
-func (m *AdditionalPropertiesItem) GetBoolean() bool {
- if x, ok := m.GetOneof().(*AdditionalPropertiesItem_Boolean); ok {
- return x.Boolean
- }
- return false
-}
-
-// XXX_OneofWrappers is for the internal use of the proto package.
-func (*AdditionalPropertiesItem) XXX_OneofWrappers() []interface{} {
- return []interface{}{
- (*AdditionalPropertiesItem_Schema)(nil),
- (*AdditionalPropertiesItem_Boolean)(nil),
- }
-}
-
-type Any struct {
- Value *any.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
- Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Any) Reset() { *m = Any{} }
-func (m *Any) String() string { return proto.CompactTextString(m) }
-func (*Any) ProtoMessage() {}
-func (*Any) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{1}
-}
-
-func (m *Any) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Any.Unmarshal(m, b)
-}
-func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Any.Marshal(b, m, deterministic)
-}
-func (m *Any) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Any.Merge(m, src)
-}
-func (m *Any) XXX_Size() int {
- return xxx_messageInfo_Any.Size(m)
-}
-func (m *Any) XXX_DiscardUnknown() {
- xxx_messageInfo_Any.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Any proto.InternalMessageInfo
-
-func (m *Any) GetValue() *any.Any {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-func (m *Any) GetYaml() string {
- if m != nil {
- return m.Yaml
- }
- return ""
-}
-
-type ApiKeySecurity struct {
- Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
- Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
- In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"`
- Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ApiKeySecurity) Reset() { *m = ApiKeySecurity{} }
-func (m *ApiKeySecurity) String() string { return proto.CompactTextString(m) }
-func (*ApiKeySecurity) ProtoMessage() {}
-func (*ApiKeySecurity) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{2}
-}
-
-func (m *ApiKeySecurity) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ApiKeySecurity.Unmarshal(m, b)
-}
-func (m *ApiKeySecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ApiKeySecurity.Marshal(b, m, deterministic)
-}
-func (m *ApiKeySecurity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ApiKeySecurity.Merge(m, src)
-}
-func (m *ApiKeySecurity) XXX_Size() int {
- return xxx_messageInfo_ApiKeySecurity.Size(m)
-}
-func (m *ApiKeySecurity) XXX_DiscardUnknown() {
- xxx_messageInfo_ApiKeySecurity.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ApiKeySecurity proto.InternalMessageInfo
-
-func (m *ApiKeySecurity) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *ApiKeySecurity) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *ApiKeySecurity) GetIn() string {
- if m != nil {
- return m.In
- }
- return ""
-}
-
-func (m *ApiKeySecurity) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *ApiKeySecurity) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type BasicAuthenticationSecurity struct {
- Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
- Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *BasicAuthenticationSecurity) Reset() { *m = BasicAuthenticationSecurity{} }
-func (m *BasicAuthenticationSecurity) String() string { return proto.CompactTextString(m) }
-func (*BasicAuthenticationSecurity) ProtoMessage() {}
-func (*BasicAuthenticationSecurity) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{3}
-}
-
-func (m *BasicAuthenticationSecurity) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_BasicAuthenticationSecurity.Unmarshal(m, b)
-}
-func (m *BasicAuthenticationSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_BasicAuthenticationSecurity.Marshal(b, m, deterministic)
-}
-func (m *BasicAuthenticationSecurity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_BasicAuthenticationSecurity.Merge(m, src)
-}
-func (m *BasicAuthenticationSecurity) XXX_Size() int {
- return xxx_messageInfo_BasicAuthenticationSecurity.Size(m)
-}
-func (m *BasicAuthenticationSecurity) XXX_DiscardUnknown() {
- xxx_messageInfo_BasicAuthenticationSecurity.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_BasicAuthenticationSecurity proto.InternalMessageInfo
-
-func (m *BasicAuthenticationSecurity) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *BasicAuthenticationSecurity) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *BasicAuthenticationSecurity) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type BodyParameter struct {
- // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
- Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
- // The name of the parameter.
- Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
- // Determines the location of the parameter.
- In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"`
- // Determines whether or not this parameter is required or optional.
- Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"`
- Schema *Schema `protobuf:"bytes,5,opt,name=schema,proto3" json:"schema,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *BodyParameter) Reset() { *m = BodyParameter{} }
-func (m *BodyParameter) String() string { return proto.CompactTextString(m) }
-func (*BodyParameter) ProtoMessage() {}
-func (*BodyParameter) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{4}
-}
-
-func (m *BodyParameter) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_BodyParameter.Unmarshal(m, b)
-}
-func (m *BodyParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_BodyParameter.Marshal(b, m, deterministic)
-}
-func (m *BodyParameter) XXX_Merge(src proto.Message) {
- xxx_messageInfo_BodyParameter.Merge(m, src)
-}
-func (m *BodyParameter) XXX_Size() int {
- return xxx_messageInfo_BodyParameter.Size(m)
-}
-func (m *BodyParameter) XXX_DiscardUnknown() {
- xxx_messageInfo_BodyParameter.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_BodyParameter proto.InternalMessageInfo
-
-func (m *BodyParameter) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *BodyParameter) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *BodyParameter) GetIn() string {
- if m != nil {
- return m.In
- }
- return ""
-}
-
-func (m *BodyParameter) GetRequired() bool {
- if m != nil {
- return m.Required
- }
- return false
-}
-
-func (m *BodyParameter) GetSchema() *Schema {
- if m != nil {
- return m.Schema
- }
- return nil
-}
-
-func (m *BodyParameter) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-// Contact information for the owners of the API.
-type Contact struct {
- // The identifying name of the contact person/organization.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // The URL pointing to the contact information.
- Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
- // The email address of the contact person/organization.
- Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Contact) Reset() { *m = Contact{} }
-func (m *Contact) String() string { return proto.CompactTextString(m) }
-func (*Contact) ProtoMessage() {}
-func (*Contact) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{5}
-}
-
-func (m *Contact) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Contact.Unmarshal(m, b)
-}
-func (m *Contact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Contact.Marshal(b, m, deterministic)
-}
-func (m *Contact) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Contact.Merge(m, src)
-}
-func (m *Contact) XXX_Size() int {
- return xxx_messageInfo_Contact.Size(m)
-}
-func (m *Contact) XXX_DiscardUnknown() {
- xxx_messageInfo_Contact.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Contact proto.InternalMessageInfo
-
-func (m *Contact) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *Contact) GetUrl() string {
- if m != nil {
- return m.Url
- }
- return ""
-}
-
-func (m *Contact) GetEmail() string {
- if m != nil {
- return m.Email
- }
- return ""
-}
-
-func (m *Contact) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Default struct {
- AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Default) Reset() { *m = Default{} }
-func (m *Default) String() string { return proto.CompactTextString(m) }
-func (*Default) ProtoMessage() {}
-func (*Default) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{6}
-}
-
-func (m *Default) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Default.Unmarshal(m, b)
-}
-func (m *Default) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Default.Marshal(b, m, deterministic)
-}
-func (m *Default) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Default.Merge(m, src)
-}
-func (m *Default) XXX_Size() int {
- return xxx_messageInfo_Default.Size(m)
-}
-func (m *Default) XXX_DiscardUnknown() {
- xxx_messageInfo_Default.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Default proto.InternalMessageInfo
-
-func (m *Default) GetAdditionalProperties() []*NamedAny {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-// One or more JSON objects describing the schemas being consumed and produced by the API.
-type Definitions struct {
- AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Definitions) Reset() { *m = Definitions{} }
-func (m *Definitions) String() string { return proto.CompactTextString(m) }
-func (*Definitions) ProtoMessage() {}
-func (*Definitions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{7}
-}
-
-func (m *Definitions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Definitions.Unmarshal(m, b)
-}
-func (m *Definitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Definitions.Marshal(b, m, deterministic)
-}
-func (m *Definitions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Definitions.Merge(m, src)
-}
-func (m *Definitions) XXX_Size() int {
- return xxx_messageInfo_Definitions.Size(m)
-}
-func (m *Definitions) XXX_DiscardUnknown() {
- xxx_messageInfo_Definitions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Definitions proto.InternalMessageInfo
-
-func (m *Definitions) GetAdditionalProperties() []*NamedSchema {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-type Document struct {
- // The Swagger version of this document.
- Swagger string `protobuf:"bytes,1,opt,name=swagger,proto3" json:"swagger,omitempty"`
- Info *Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"`
- // The host (name or ip) of the API. Example: 'swagger.io'
- Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"`
- // The base path to the API. Example: '/api'.
- BasePath string `protobuf:"bytes,4,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"`
- // The transfer protocol of the API.
- Schemes []string `protobuf:"bytes,5,rep,name=schemes,proto3" json:"schemes,omitempty"`
- // A list of MIME types accepted by the API.
- Consumes []string `protobuf:"bytes,6,rep,name=consumes,proto3" json:"consumes,omitempty"`
- // A list of MIME types the API can produce.
- Produces []string `protobuf:"bytes,7,rep,name=produces,proto3" json:"produces,omitempty"`
- Paths *Paths `protobuf:"bytes,8,opt,name=paths,proto3" json:"paths,omitempty"`
- Definitions *Definitions `protobuf:"bytes,9,opt,name=definitions,proto3" json:"definitions,omitempty"`
- Parameters *ParameterDefinitions `protobuf:"bytes,10,opt,name=parameters,proto3" json:"parameters,omitempty"`
- Responses *ResponseDefinitions `protobuf:"bytes,11,opt,name=responses,proto3" json:"responses,omitempty"`
- Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"`
- SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,13,opt,name=security_definitions,json=securityDefinitions,proto3" json:"security_definitions,omitempty"`
- Tags []*Tag `protobuf:"bytes,14,rep,name=tags,proto3" json:"tags,omitempty"`
- ExternalDocs *ExternalDocs `protobuf:"bytes,15,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,16,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Document) Reset() { *m = Document{} }
-func (m *Document) String() string { return proto.CompactTextString(m) }
-func (*Document) ProtoMessage() {}
-func (*Document) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{8}
-}
-
-func (m *Document) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Document.Unmarshal(m, b)
-}
-func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Document.Marshal(b, m, deterministic)
-}
-func (m *Document) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Document.Merge(m, src)
-}
-func (m *Document) XXX_Size() int {
- return xxx_messageInfo_Document.Size(m)
-}
-func (m *Document) XXX_DiscardUnknown() {
- xxx_messageInfo_Document.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Document proto.InternalMessageInfo
-
-func (m *Document) GetSwagger() string {
- if m != nil {
- return m.Swagger
- }
- return ""
-}
-
-func (m *Document) GetInfo() *Info {
- if m != nil {
- return m.Info
- }
- return nil
-}
-
-func (m *Document) GetHost() string {
- if m != nil {
- return m.Host
- }
- return ""
-}
-
-func (m *Document) GetBasePath() string {
- if m != nil {
- return m.BasePath
- }
- return ""
-}
-
-func (m *Document) GetSchemes() []string {
- if m != nil {
- return m.Schemes
- }
- return nil
-}
-
-func (m *Document) GetConsumes() []string {
- if m != nil {
- return m.Consumes
- }
- return nil
-}
-
-func (m *Document) GetProduces() []string {
- if m != nil {
- return m.Produces
- }
- return nil
-}
-
-func (m *Document) GetPaths() *Paths {
- if m != nil {
- return m.Paths
- }
- return nil
-}
-
-func (m *Document) GetDefinitions() *Definitions {
- if m != nil {
- return m.Definitions
- }
- return nil
-}
-
-func (m *Document) GetParameters() *ParameterDefinitions {
- if m != nil {
- return m.Parameters
- }
- return nil
-}
-
-func (m *Document) GetResponses() *ResponseDefinitions {
- if m != nil {
- return m.Responses
- }
- return nil
-}
-
-func (m *Document) GetSecurity() []*SecurityRequirement {
- if m != nil {
- return m.Security
- }
- return nil
-}
-
-func (m *Document) GetSecurityDefinitions() *SecurityDefinitions {
- if m != nil {
- return m.SecurityDefinitions
- }
- return nil
-}
-
-func (m *Document) GetTags() []*Tag {
- if m != nil {
- return m.Tags
- }
- return nil
-}
-
-func (m *Document) GetExternalDocs() *ExternalDocs {
- if m != nil {
- return m.ExternalDocs
- }
- return nil
-}
-
-func (m *Document) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Examples struct {
- AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Examples) Reset() { *m = Examples{} }
-func (m *Examples) String() string { return proto.CompactTextString(m) }
-func (*Examples) ProtoMessage() {}
-func (*Examples) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{9}
-}
-
-func (m *Examples) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Examples.Unmarshal(m, b)
-}
-func (m *Examples) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Examples.Marshal(b, m, deterministic)
-}
-func (m *Examples) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Examples.Merge(m, src)
-}
-func (m *Examples) XXX_Size() int {
- return xxx_messageInfo_Examples.Size(m)
-}
-func (m *Examples) XXX_DiscardUnknown() {
- xxx_messageInfo_Examples.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Examples proto.InternalMessageInfo
-
-func (m *Examples) GetAdditionalProperties() []*NamedAny {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-// information about external documentation
-type ExternalDocs struct {
- Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
- Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ExternalDocs) Reset() { *m = ExternalDocs{} }
-func (m *ExternalDocs) String() string { return proto.CompactTextString(m) }
-func (*ExternalDocs) ProtoMessage() {}
-func (*ExternalDocs) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{10}
-}
-
-func (m *ExternalDocs) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ExternalDocs.Unmarshal(m, b)
-}
-func (m *ExternalDocs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ExternalDocs.Marshal(b, m, deterministic)
-}
-func (m *ExternalDocs) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ExternalDocs.Merge(m, src)
-}
-func (m *ExternalDocs) XXX_Size() int {
- return xxx_messageInfo_ExternalDocs.Size(m)
-}
-func (m *ExternalDocs) XXX_DiscardUnknown() {
- xxx_messageInfo_ExternalDocs.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ExternalDocs proto.InternalMessageInfo
-
-func (m *ExternalDocs) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *ExternalDocs) GetUrl() string {
- if m != nil {
- return m.Url
- }
- return ""
-}
-
-func (m *ExternalDocs) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-// A deterministic version of a JSON Schema object.
-type FileSchema struct {
- Format string `protobuf:"bytes,1,opt,name=format,proto3" json:"format,omitempty"`
- Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
- Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
- Default *Any `protobuf:"bytes,4,opt,name=default,proto3" json:"default,omitempty"`
- Required []string `protobuf:"bytes,5,rep,name=required,proto3" json:"required,omitempty"`
- Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"`
- ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
- ExternalDocs *ExternalDocs `protobuf:"bytes,8,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"`
- Example *Any `protobuf:"bytes,9,opt,name=example,proto3" json:"example,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FileSchema) Reset() { *m = FileSchema{} }
-func (m *FileSchema) String() string { return proto.CompactTextString(m) }
-func (*FileSchema) ProtoMessage() {}
-func (*FileSchema) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{11}
-}
-
-func (m *FileSchema) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FileSchema.Unmarshal(m, b)
-}
-func (m *FileSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FileSchema.Marshal(b, m, deterministic)
-}
-func (m *FileSchema) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FileSchema.Merge(m, src)
-}
-func (m *FileSchema) XXX_Size() int {
- return xxx_messageInfo_FileSchema.Size(m)
-}
-func (m *FileSchema) XXX_DiscardUnknown() {
- xxx_messageInfo_FileSchema.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FileSchema proto.InternalMessageInfo
-
-func (m *FileSchema) GetFormat() string {
- if m != nil {
- return m.Format
- }
- return ""
-}
-
-func (m *FileSchema) GetTitle() string {
- if m != nil {
- return m.Title
- }
- return ""
-}
-
-func (m *FileSchema) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *FileSchema) GetDefault() *Any {
- if m != nil {
- return m.Default
- }
- return nil
-}
-
-func (m *FileSchema) GetRequired() []string {
- if m != nil {
- return m.Required
- }
- return nil
-}
-
-func (m *FileSchema) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *FileSchema) GetReadOnly() bool {
- if m != nil {
- return m.ReadOnly
- }
- return false
-}
-
-func (m *FileSchema) GetExternalDocs() *ExternalDocs {
- if m != nil {
- return m.ExternalDocs
- }
- return nil
-}
-
-func (m *FileSchema) GetExample() *Any {
- if m != nil {
- return m.Example
- }
- return nil
-}
-
-func (m *FileSchema) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type FormDataParameterSubSchema struct {
- // Determines whether or not this parameter is required or optional.
- Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"`
- // Determines the location of the parameter.
- In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"`
- // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
- Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
- // The name of the parameter.
- Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
- // allows sending a parameter by name only or with an empty value.
- AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"`
- Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"`
- Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"`
- Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"`
- CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"`
- Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"`
- Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"`
- ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"`
- Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"`
- ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"`
- MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"`
- MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"`
- Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"`
- MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"`
- MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"`
- UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"`
- Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"`
- MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *FormDataParameterSubSchema) Reset() { *m = FormDataParameterSubSchema{} }
-func (m *FormDataParameterSubSchema) String() string { return proto.CompactTextString(m) }
-func (*FormDataParameterSubSchema) ProtoMessage() {}
-func (*FormDataParameterSubSchema) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{12}
-}
-
-func (m *FormDataParameterSubSchema) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_FormDataParameterSubSchema.Unmarshal(m, b)
-}
-func (m *FormDataParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_FormDataParameterSubSchema.Marshal(b, m, deterministic)
-}
-func (m *FormDataParameterSubSchema) XXX_Merge(src proto.Message) {
- xxx_messageInfo_FormDataParameterSubSchema.Merge(m, src)
-}
-func (m *FormDataParameterSubSchema) XXX_Size() int {
- return xxx_messageInfo_FormDataParameterSubSchema.Size(m)
-}
-func (m *FormDataParameterSubSchema) XXX_DiscardUnknown() {
- xxx_messageInfo_FormDataParameterSubSchema.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_FormDataParameterSubSchema proto.InternalMessageInfo
-
-func (m *FormDataParameterSubSchema) GetRequired() bool {
- if m != nil {
- return m.Required
- }
- return false
-}
-
-func (m *FormDataParameterSubSchema) GetIn() string {
- if m != nil {
- return m.In
- }
- return ""
-}
-
-func (m *FormDataParameterSubSchema) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *FormDataParameterSubSchema) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *FormDataParameterSubSchema) GetAllowEmptyValue() bool {
- if m != nil {
- return m.AllowEmptyValue
- }
- return false
-}
-
-func (m *FormDataParameterSubSchema) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *FormDataParameterSubSchema) GetFormat() string {
- if m != nil {
- return m.Format
- }
- return ""
-}
-
-func (m *FormDataParameterSubSchema) GetItems() *PrimitivesItems {
- if m != nil {
- return m.Items
- }
- return nil
-}
-
-func (m *FormDataParameterSubSchema) GetCollectionFormat() string {
- if m != nil {
- return m.CollectionFormat
- }
- return ""
-}
-
-func (m *FormDataParameterSubSchema) GetDefault() *Any {
- if m != nil {
- return m.Default
- }
- return nil
-}
-
-func (m *FormDataParameterSubSchema) GetMaximum() float64 {
- if m != nil {
- return m.Maximum
- }
- return 0
-}
-
-func (m *FormDataParameterSubSchema) GetExclusiveMaximum() bool {
- if m != nil {
- return m.ExclusiveMaximum
- }
- return false
-}
-
-func (m *FormDataParameterSubSchema) GetMinimum() float64 {
- if m != nil {
- return m.Minimum
- }
- return 0
-}
-
-func (m *FormDataParameterSubSchema) GetExclusiveMinimum() bool {
- if m != nil {
- return m.ExclusiveMinimum
- }
- return false
-}
-
-func (m *FormDataParameterSubSchema) GetMaxLength() int64 {
- if m != nil {
- return m.MaxLength
- }
- return 0
-}
-
-func (m *FormDataParameterSubSchema) GetMinLength() int64 {
- if m != nil {
- return m.MinLength
- }
- return 0
-}
-
-func (m *FormDataParameterSubSchema) GetPattern() string {
- if m != nil {
- return m.Pattern
- }
- return ""
-}
-
-func (m *FormDataParameterSubSchema) GetMaxItems() int64 {
- if m != nil {
- return m.MaxItems
- }
- return 0
-}
-
-func (m *FormDataParameterSubSchema) GetMinItems() int64 {
- if m != nil {
- return m.MinItems
- }
- return 0
-}
-
-func (m *FormDataParameterSubSchema) GetUniqueItems() bool {
- if m != nil {
- return m.UniqueItems
- }
- return false
-}
-
-func (m *FormDataParameterSubSchema) GetEnum() []*Any {
- if m != nil {
- return m.Enum
- }
- return nil
-}
-
-func (m *FormDataParameterSubSchema) GetMultipleOf() float64 {
- if m != nil {
- return m.MultipleOf
- }
- return 0
-}
-
-func (m *FormDataParameterSubSchema) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Header struct {
- Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
- Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"`
- Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"`
- CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"`
- Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"`
- Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"`
- ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"`
- Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"`
- ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"`
- MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"`
- MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"`
- Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"`
- MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"`
- MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"`
- UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"`
- Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"`
- MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"`
- Description string `protobuf:"bytes,18,opt,name=description,proto3" json:"description,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,19,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Header) Reset() { *m = Header{} }
-func (m *Header) String() string { return proto.CompactTextString(m) }
-func (*Header) ProtoMessage() {}
-func (*Header) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{13}
-}
-
-func (m *Header) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Header.Unmarshal(m, b)
-}
-func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Header.Marshal(b, m, deterministic)
-}
-func (m *Header) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Header.Merge(m, src)
-}
-func (m *Header) XXX_Size() int {
- return xxx_messageInfo_Header.Size(m)
-}
-func (m *Header) XXX_DiscardUnknown() {
- xxx_messageInfo_Header.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Header proto.InternalMessageInfo
-
-func (m *Header) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *Header) GetFormat() string {
- if m != nil {
- return m.Format
- }
- return ""
-}
-
-func (m *Header) GetItems() *PrimitivesItems {
- if m != nil {
- return m.Items
- }
- return nil
-}
-
-func (m *Header) GetCollectionFormat() string {
- if m != nil {
- return m.CollectionFormat
- }
- return ""
-}
-
-func (m *Header) GetDefault() *Any {
- if m != nil {
- return m.Default
- }
- return nil
-}
-
-func (m *Header) GetMaximum() float64 {
- if m != nil {
- return m.Maximum
- }
- return 0
-}
-
-func (m *Header) GetExclusiveMaximum() bool {
- if m != nil {
- return m.ExclusiveMaximum
- }
- return false
-}
-
-func (m *Header) GetMinimum() float64 {
- if m != nil {
- return m.Minimum
- }
- return 0
-}
-
-func (m *Header) GetExclusiveMinimum() bool {
- if m != nil {
- return m.ExclusiveMinimum
- }
- return false
-}
-
-func (m *Header) GetMaxLength() int64 {
- if m != nil {
- return m.MaxLength
- }
- return 0
-}
-
-func (m *Header) GetMinLength() int64 {
- if m != nil {
- return m.MinLength
- }
- return 0
-}
-
-func (m *Header) GetPattern() string {
- if m != nil {
- return m.Pattern
- }
- return ""
-}
-
-func (m *Header) GetMaxItems() int64 {
- if m != nil {
- return m.MaxItems
- }
- return 0
-}
-
-func (m *Header) GetMinItems() int64 {
- if m != nil {
- return m.MinItems
- }
- return 0
-}
-
-func (m *Header) GetUniqueItems() bool {
- if m != nil {
- return m.UniqueItems
- }
- return false
-}
-
-func (m *Header) GetEnum() []*Any {
- if m != nil {
- return m.Enum
- }
- return nil
-}
-
-func (m *Header) GetMultipleOf() float64 {
- if m != nil {
- return m.MultipleOf
- }
- return 0
-}
-
-func (m *Header) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *Header) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type HeaderParameterSubSchema struct {
- // Determines whether or not this parameter is required or optional.
- Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"`
- // Determines the location of the parameter.
- In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"`
- // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
- Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
- // The name of the parameter.
- Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
- Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"`
- Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"`
- Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"`
- CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"`
- Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"`
- Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"`
- ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"`
- Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"`
- ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"`
- MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"`
- MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"`
- Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"`
- MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"`
- MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"`
- UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"`
- Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"`
- MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HeaderParameterSubSchema) Reset() { *m = HeaderParameterSubSchema{} }
-func (m *HeaderParameterSubSchema) String() string { return proto.CompactTextString(m) }
-func (*HeaderParameterSubSchema) ProtoMessage() {}
-func (*HeaderParameterSubSchema) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{14}
-}
-
-func (m *HeaderParameterSubSchema) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_HeaderParameterSubSchema.Unmarshal(m, b)
-}
-func (m *HeaderParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_HeaderParameterSubSchema.Marshal(b, m, deterministic)
-}
-func (m *HeaderParameterSubSchema) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HeaderParameterSubSchema.Merge(m, src)
-}
-func (m *HeaderParameterSubSchema) XXX_Size() int {
- return xxx_messageInfo_HeaderParameterSubSchema.Size(m)
-}
-func (m *HeaderParameterSubSchema) XXX_DiscardUnknown() {
- xxx_messageInfo_HeaderParameterSubSchema.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HeaderParameterSubSchema proto.InternalMessageInfo
-
-func (m *HeaderParameterSubSchema) GetRequired() bool {
- if m != nil {
- return m.Required
- }
- return false
-}
-
-func (m *HeaderParameterSubSchema) GetIn() string {
- if m != nil {
- return m.In
- }
- return ""
-}
-
-func (m *HeaderParameterSubSchema) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *HeaderParameterSubSchema) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *HeaderParameterSubSchema) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *HeaderParameterSubSchema) GetFormat() string {
- if m != nil {
- return m.Format
- }
- return ""
-}
-
-func (m *HeaderParameterSubSchema) GetItems() *PrimitivesItems {
- if m != nil {
- return m.Items
- }
- return nil
-}
-
-func (m *HeaderParameterSubSchema) GetCollectionFormat() string {
- if m != nil {
- return m.CollectionFormat
- }
- return ""
-}
-
-func (m *HeaderParameterSubSchema) GetDefault() *Any {
- if m != nil {
- return m.Default
- }
- return nil
-}
-
-func (m *HeaderParameterSubSchema) GetMaximum() float64 {
- if m != nil {
- return m.Maximum
- }
- return 0
-}
-
-func (m *HeaderParameterSubSchema) GetExclusiveMaximum() bool {
- if m != nil {
- return m.ExclusiveMaximum
- }
- return false
-}
-
-func (m *HeaderParameterSubSchema) GetMinimum() float64 {
- if m != nil {
- return m.Minimum
- }
- return 0
-}
-
-func (m *HeaderParameterSubSchema) GetExclusiveMinimum() bool {
- if m != nil {
- return m.ExclusiveMinimum
- }
- return false
-}
-
-func (m *HeaderParameterSubSchema) GetMaxLength() int64 {
- if m != nil {
- return m.MaxLength
- }
- return 0
-}
-
-func (m *HeaderParameterSubSchema) GetMinLength() int64 {
- if m != nil {
- return m.MinLength
- }
- return 0
-}
-
-func (m *HeaderParameterSubSchema) GetPattern() string {
- if m != nil {
- return m.Pattern
- }
- return ""
-}
-
-func (m *HeaderParameterSubSchema) GetMaxItems() int64 {
- if m != nil {
- return m.MaxItems
- }
- return 0
-}
-
-func (m *HeaderParameterSubSchema) GetMinItems() int64 {
- if m != nil {
- return m.MinItems
- }
- return 0
-}
-
-func (m *HeaderParameterSubSchema) GetUniqueItems() bool {
- if m != nil {
- return m.UniqueItems
- }
- return false
-}
-
-func (m *HeaderParameterSubSchema) GetEnum() []*Any {
- if m != nil {
- return m.Enum
- }
- return nil
-}
-
-func (m *HeaderParameterSubSchema) GetMultipleOf() float64 {
- if m != nil {
- return m.MultipleOf
- }
- return 0
-}
-
-func (m *HeaderParameterSubSchema) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Headers struct {
- AdditionalProperties []*NamedHeader `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Headers) Reset() { *m = Headers{} }
-func (m *Headers) String() string { return proto.CompactTextString(m) }
-func (*Headers) ProtoMessage() {}
-func (*Headers) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{15}
-}
-
-func (m *Headers) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Headers.Unmarshal(m, b)
-}
-func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Headers.Marshal(b, m, deterministic)
-}
-func (m *Headers) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Headers.Merge(m, src)
-}
-func (m *Headers) XXX_Size() int {
- return xxx_messageInfo_Headers.Size(m)
-}
-func (m *Headers) XXX_DiscardUnknown() {
- xxx_messageInfo_Headers.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Headers proto.InternalMessageInfo
-
-func (m *Headers) GetAdditionalProperties() []*NamedHeader {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-// General information about the API.
-type Info struct {
- // A unique and precise title of the API.
- Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
- // A semantic version number of the API.
- Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
- // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed.
- Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
- // The terms of service for the API.
- TermsOfService string `protobuf:"bytes,4,opt,name=terms_of_service,json=termsOfService,proto3" json:"terms_of_service,omitempty"`
- Contact *Contact `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"`
- License *License `protobuf:"bytes,6,opt,name=license,proto3" json:"license,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Info) Reset() { *m = Info{} }
-func (m *Info) String() string { return proto.CompactTextString(m) }
-func (*Info) ProtoMessage() {}
-func (*Info) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{16}
-}
-
-func (m *Info) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Info.Unmarshal(m, b)
-}
-func (m *Info) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Info.Marshal(b, m, deterministic)
-}
-func (m *Info) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Info.Merge(m, src)
-}
-func (m *Info) XXX_Size() int {
- return xxx_messageInfo_Info.Size(m)
-}
-func (m *Info) XXX_DiscardUnknown() {
- xxx_messageInfo_Info.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Info proto.InternalMessageInfo
-
-func (m *Info) GetTitle() string {
- if m != nil {
- return m.Title
- }
- return ""
-}
-
-func (m *Info) GetVersion() string {
- if m != nil {
- return m.Version
- }
- return ""
-}
-
-func (m *Info) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *Info) GetTermsOfService() string {
- if m != nil {
- return m.TermsOfService
- }
- return ""
-}
-
-func (m *Info) GetContact() *Contact {
- if m != nil {
- return m.Contact
- }
- return nil
-}
-
-func (m *Info) GetLicense() *License {
- if m != nil {
- return m.License
- }
- return nil
-}
-
-func (m *Info) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type ItemsItem struct {
- Schema []*Schema `protobuf:"bytes,1,rep,name=schema,proto3" json:"schema,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ItemsItem) Reset() { *m = ItemsItem{} }
-func (m *ItemsItem) String() string { return proto.CompactTextString(m) }
-func (*ItemsItem) ProtoMessage() {}
-func (*ItemsItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{17}
-}
-
-func (m *ItemsItem) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ItemsItem.Unmarshal(m, b)
-}
-func (m *ItemsItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ItemsItem.Marshal(b, m, deterministic)
-}
-func (m *ItemsItem) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ItemsItem.Merge(m, src)
-}
-func (m *ItemsItem) XXX_Size() int {
- return xxx_messageInfo_ItemsItem.Size(m)
-}
-func (m *ItemsItem) XXX_DiscardUnknown() {
- xxx_messageInfo_ItemsItem.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ItemsItem proto.InternalMessageInfo
-
-func (m *ItemsItem) GetSchema() []*Schema {
- if m != nil {
- return m.Schema
- }
- return nil
-}
-
-type JsonReference struct {
- XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"`
- Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *JsonReference) Reset() { *m = JsonReference{} }
-func (m *JsonReference) String() string { return proto.CompactTextString(m) }
-func (*JsonReference) ProtoMessage() {}
-func (*JsonReference) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{18}
-}
-
-func (m *JsonReference) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_JsonReference.Unmarshal(m, b)
-}
-func (m *JsonReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_JsonReference.Marshal(b, m, deterministic)
-}
-func (m *JsonReference) XXX_Merge(src proto.Message) {
- xxx_messageInfo_JsonReference.Merge(m, src)
-}
-func (m *JsonReference) XXX_Size() int {
- return xxx_messageInfo_JsonReference.Size(m)
-}
-func (m *JsonReference) XXX_DiscardUnknown() {
- xxx_messageInfo_JsonReference.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_JsonReference proto.InternalMessageInfo
-
-func (m *JsonReference) GetXRef() string {
- if m != nil {
- return m.XRef
- }
- return ""
-}
-
-func (m *JsonReference) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-type License struct {
- // The name of the license type. It's encouraged to use an OSI compatible license.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // The URL pointing to the license.
- Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *License) Reset() { *m = License{} }
-func (m *License) String() string { return proto.CompactTextString(m) }
-func (*License) ProtoMessage() {}
-func (*License) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{19}
-}
-
-func (m *License) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_License.Unmarshal(m, b)
-}
-func (m *License) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_License.Marshal(b, m, deterministic)
-}
-func (m *License) XXX_Merge(src proto.Message) {
- xxx_messageInfo_License.Merge(m, src)
-}
-func (m *License) XXX_Size() int {
- return xxx_messageInfo_License.Size(m)
-}
-func (m *License) XXX_DiscardUnknown() {
- xxx_messageInfo_License.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_License proto.InternalMessageInfo
-
-func (m *License) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *License) GetUrl() string {
- if m != nil {
- return m.Url
- }
- return ""
-}
-
-func (m *License) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs.
-type NamedAny struct {
- // Map key
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Mapped value
- Value *Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamedAny) Reset() { *m = NamedAny{} }
-func (m *NamedAny) String() string { return proto.CompactTextString(m) }
-func (*NamedAny) ProtoMessage() {}
-func (*NamedAny) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{20}
-}
-
-func (m *NamedAny) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NamedAny.Unmarshal(m, b)
-}
-func (m *NamedAny) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NamedAny.Marshal(b, m, deterministic)
-}
-func (m *NamedAny) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedAny.Merge(m, src)
-}
-func (m *NamedAny) XXX_Size() int {
- return xxx_messageInfo_NamedAny.Size(m)
-}
-func (m *NamedAny) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedAny.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamedAny proto.InternalMessageInfo
-
-func (m *NamedAny) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *NamedAny) GetValue() *Any {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-// Automatically-generated message used to represent maps of Header as ordered (name,value) pairs.
-type NamedHeader struct {
- // Map key
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Mapped value
- Value *Header `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamedHeader) Reset() { *m = NamedHeader{} }
-func (m *NamedHeader) String() string { return proto.CompactTextString(m) }
-func (*NamedHeader) ProtoMessage() {}
-func (*NamedHeader) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{21}
-}
-
-func (m *NamedHeader) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NamedHeader.Unmarshal(m, b)
-}
-func (m *NamedHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NamedHeader.Marshal(b, m, deterministic)
-}
-func (m *NamedHeader) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedHeader.Merge(m, src)
-}
-func (m *NamedHeader) XXX_Size() int {
- return xxx_messageInfo_NamedHeader.Size(m)
-}
-func (m *NamedHeader) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedHeader.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamedHeader proto.InternalMessageInfo
-
-func (m *NamedHeader) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *NamedHeader) GetValue() *Header {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs.
-type NamedParameter struct {
- // Map key
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Mapped value
- Value *Parameter `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamedParameter) Reset() { *m = NamedParameter{} }
-func (m *NamedParameter) String() string { return proto.CompactTextString(m) }
-func (*NamedParameter) ProtoMessage() {}
-func (*NamedParameter) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{22}
-}
-
-func (m *NamedParameter) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NamedParameter.Unmarshal(m, b)
-}
-func (m *NamedParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NamedParameter.Marshal(b, m, deterministic)
-}
-func (m *NamedParameter) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedParameter.Merge(m, src)
-}
-func (m *NamedParameter) XXX_Size() int {
- return xxx_messageInfo_NamedParameter.Size(m)
-}
-func (m *NamedParameter) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedParameter.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamedParameter proto.InternalMessageInfo
-
-func (m *NamedParameter) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *NamedParameter) GetValue() *Parameter {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs.
-type NamedPathItem struct {
- // Map key
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Mapped value
- Value *PathItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamedPathItem) Reset() { *m = NamedPathItem{} }
-func (m *NamedPathItem) String() string { return proto.CompactTextString(m) }
-func (*NamedPathItem) ProtoMessage() {}
-func (*NamedPathItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{23}
-}
-
-func (m *NamedPathItem) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NamedPathItem.Unmarshal(m, b)
-}
-func (m *NamedPathItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NamedPathItem.Marshal(b, m, deterministic)
-}
-func (m *NamedPathItem) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedPathItem.Merge(m, src)
-}
-func (m *NamedPathItem) XXX_Size() int {
- return xxx_messageInfo_NamedPathItem.Size(m)
-}
-func (m *NamedPathItem) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedPathItem.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamedPathItem proto.InternalMessageInfo
-
-func (m *NamedPathItem) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *NamedPathItem) GetValue() *PathItem {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-// Automatically-generated message used to represent maps of Response as ordered (name,value) pairs.
-type NamedResponse struct {
- // Map key
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Mapped value
- Value *Response `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamedResponse) Reset() { *m = NamedResponse{} }
-func (m *NamedResponse) String() string { return proto.CompactTextString(m) }
-func (*NamedResponse) ProtoMessage() {}
-func (*NamedResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{24}
-}
-
-func (m *NamedResponse) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NamedResponse.Unmarshal(m, b)
-}
-func (m *NamedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NamedResponse.Marshal(b, m, deterministic)
-}
-func (m *NamedResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResponse.Merge(m, src)
-}
-func (m *NamedResponse) XXX_Size() int {
- return xxx_messageInfo_NamedResponse.Size(m)
-}
-func (m *NamedResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamedResponse proto.InternalMessageInfo
-
-func (m *NamedResponse) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *NamedResponse) GetValue() *Response {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-// Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs.
-type NamedResponseValue struct {
- // Map key
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Mapped value
- Value *ResponseValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamedResponseValue) Reset() { *m = NamedResponseValue{} }
-func (m *NamedResponseValue) String() string { return proto.CompactTextString(m) }
-func (*NamedResponseValue) ProtoMessage() {}
-func (*NamedResponseValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{25}
-}
-
-func (m *NamedResponseValue) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NamedResponseValue.Unmarshal(m, b)
-}
-func (m *NamedResponseValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NamedResponseValue.Marshal(b, m, deterministic)
-}
-func (m *NamedResponseValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedResponseValue.Merge(m, src)
-}
-func (m *NamedResponseValue) XXX_Size() int {
- return xxx_messageInfo_NamedResponseValue.Size(m)
-}
-func (m *NamedResponseValue) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedResponseValue.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamedResponseValue proto.InternalMessageInfo
-
-func (m *NamedResponseValue) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *NamedResponseValue) GetValue() *ResponseValue {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs.
-type NamedSchema struct {
- // Map key
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Mapped value
- Value *Schema `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamedSchema) Reset() { *m = NamedSchema{} }
-func (m *NamedSchema) String() string { return proto.CompactTextString(m) }
-func (*NamedSchema) ProtoMessage() {}
-func (*NamedSchema) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{26}
-}
-
-func (m *NamedSchema) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NamedSchema.Unmarshal(m, b)
-}
-func (m *NamedSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NamedSchema.Marshal(b, m, deterministic)
-}
-func (m *NamedSchema) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedSchema.Merge(m, src)
-}
-func (m *NamedSchema) XXX_Size() int {
- return xxx_messageInfo_NamedSchema.Size(m)
-}
-func (m *NamedSchema) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedSchema.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamedSchema proto.InternalMessageInfo
-
-func (m *NamedSchema) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *NamedSchema) GetValue() *Schema {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-// Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs.
-type NamedSecurityDefinitionsItem struct {
- // Map key
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Mapped value
- Value *SecurityDefinitionsItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamedSecurityDefinitionsItem) Reset() { *m = NamedSecurityDefinitionsItem{} }
-func (m *NamedSecurityDefinitionsItem) String() string { return proto.CompactTextString(m) }
-func (*NamedSecurityDefinitionsItem) ProtoMessage() {}
-func (*NamedSecurityDefinitionsItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{27}
-}
-
-func (m *NamedSecurityDefinitionsItem) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NamedSecurityDefinitionsItem.Unmarshal(m, b)
-}
-func (m *NamedSecurityDefinitionsItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NamedSecurityDefinitionsItem.Marshal(b, m, deterministic)
-}
-func (m *NamedSecurityDefinitionsItem) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedSecurityDefinitionsItem.Merge(m, src)
-}
-func (m *NamedSecurityDefinitionsItem) XXX_Size() int {
- return xxx_messageInfo_NamedSecurityDefinitionsItem.Size(m)
-}
-func (m *NamedSecurityDefinitionsItem) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedSecurityDefinitionsItem.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamedSecurityDefinitionsItem proto.InternalMessageInfo
-
-func (m *NamedSecurityDefinitionsItem) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *NamedSecurityDefinitionsItem) GetValue() *SecurityDefinitionsItem {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-// Automatically-generated message used to represent maps of string as ordered (name,value) pairs.
-type NamedString struct {
- // Map key
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Mapped value
- Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamedString) Reset() { *m = NamedString{} }
-func (m *NamedString) String() string { return proto.CompactTextString(m) }
-func (*NamedString) ProtoMessage() {}
-func (*NamedString) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{28}
-}
-
-func (m *NamedString) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NamedString.Unmarshal(m, b)
-}
-func (m *NamedString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NamedString.Marshal(b, m, deterministic)
-}
-func (m *NamedString) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedString.Merge(m, src)
-}
-func (m *NamedString) XXX_Size() int {
- return xxx_messageInfo_NamedString.Size(m)
-}
-func (m *NamedString) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedString.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamedString proto.InternalMessageInfo
-
-func (m *NamedString) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *NamedString) GetValue() string {
- if m != nil {
- return m.Value
- }
- return ""
-}
-
-// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs.
-type NamedStringArray struct {
- // Map key
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Mapped value
- Value *StringArray `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamedStringArray) Reset() { *m = NamedStringArray{} }
-func (m *NamedStringArray) String() string { return proto.CompactTextString(m) }
-func (*NamedStringArray) ProtoMessage() {}
-func (*NamedStringArray) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{29}
-}
-
-func (m *NamedStringArray) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NamedStringArray.Unmarshal(m, b)
-}
-func (m *NamedStringArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NamedStringArray.Marshal(b, m, deterministic)
-}
-func (m *NamedStringArray) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamedStringArray.Merge(m, src)
-}
-func (m *NamedStringArray) XXX_Size() int {
- return xxx_messageInfo_NamedStringArray.Size(m)
-}
-func (m *NamedStringArray) XXX_DiscardUnknown() {
- xxx_messageInfo_NamedStringArray.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamedStringArray proto.InternalMessageInfo
-
-func (m *NamedStringArray) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *NamedStringArray) GetValue() *StringArray {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-type NonBodyParameter struct {
- // Types that are valid to be assigned to Oneof:
- // *NonBodyParameter_HeaderParameterSubSchema
- // *NonBodyParameter_FormDataParameterSubSchema
- // *NonBodyParameter_QueryParameterSubSchema
- // *NonBodyParameter_PathParameterSubSchema
- Oneof isNonBodyParameter_Oneof `protobuf_oneof:"oneof"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NonBodyParameter) Reset() { *m = NonBodyParameter{} }
-func (m *NonBodyParameter) String() string { return proto.CompactTextString(m) }
-func (*NonBodyParameter) ProtoMessage() {}
-func (*NonBodyParameter) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{30}
-}
-
-func (m *NonBodyParameter) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_NonBodyParameter.Unmarshal(m, b)
-}
-func (m *NonBodyParameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_NonBodyParameter.Marshal(b, m, deterministic)
-}
-func (m *NonBodyParameter) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NonBodyParameter.Merge(m, src)
-}
-func (m *NonBodyParameter) XXX_Size() int {
- return xxx_messageInfo_NonBodyParameter.Size(m)
-}
-func (m *NonBodyParameter) XXX_DiscardUnknown() {
- xxx_messageInfo_NonBodyParameter.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NonBodyParameter proto.InternalMessageInfo
-
-type isNonBodyParameter_Oneof interface {
- isNonBodyParameter_Oneof()
-}
-
-type NonBodyParameter_HeaderParameterSubSchema struct {
- HeaderParameterSubSchema *HeaderParameterSubSchema `protobuf:"bytes,1,opt,name=header_parameter_sub_schema,json=headerParameterSubSchema,proto3,oneof"`
-}
-
-type NonBodyParameter_FormDataParameterSubSchema struct {
- FormDataParameterSubSchema *FormDataParameterSubSchema `protobuf:"bytes,2,opt,name=form_data_parameter_sub_schema,json=formDataParameterSubSchema,proto3,oneof"`
-}
-
-type NonBodyParameter_QueryParameterSubSchema struct {
- QueryParameterSubSchema *QueryParameterSubSchema `protobuf:"bytes,3,opt,name=query_parameter_sub_schema,json=queryParameterSubSchema,proto3,oneof"`
-}
-
-type NonBodyParameter_PathParameterSubSchema struct {
- PathParameterSubSchema *PathParameterSubSchema `protobuf:"bytes,4,opt,name=path_parameter_sub_schema,json=pathParameterSubSchema,proto3,oneof"`
-}
-
-func (*NonBodyParameter_HeaderParameterSubSchema) isNonBodyParameter_Oneof() {}
-
-func (*NonBodyParameter_FormDataParameterSubSchema) isNonBodyParameter_Oneof() {}
-
-func (*NonBodyParameter_QueryParameterSubSchema) isNonBodyParameter_Oneof() {}
-
-func (*NonBodyParameter_PathParameterSubSchema) isNonBodyParameter_Oneof() {}
-
-func (m *NonBodyParameter) GetOneof() isNonBodyParameter_Oneof {
- if m != nil {
- return m.Oneof
- }
- return nil
-}
-
-func (m *NonBodyParameter) GetHeaderParameterSubSchema() *HeaderParameterSubSchema {
- if x, ok := m.GetOneof().(*NonBodyParameter_HeaderParameterSubSchema); ok {
- return x.HeaderParameterSubSchema
- }
- return nil
-}
-
-func (m *NonBodyParameter) GetFormDataParameterSubSchema() *FormDataParameterSubSchema {
- if x, ok := m.GetOneof().(*NonBodyParameter_FormDataParameterSubSchema); ok {
- return x.FormDataParameterSubSchema
- }
- return nil
-}
-
-func (m *NonBodyParameter) GetQueryParameterSubSchema() *QueryParameterSubSchema {
- if x, ok := m.GetOneof().(*NonBodyParameter_QueryParameterSubSchema); ok {
- return x.QueryParameterSubSchema
- }
- return nil
-}
-
-func (m *NonBodyParameter) GetPathParameterSubSchema() *PathParameterSubSchema {
- if x, ok := m.GetOneof().(*NonBodyParameter_PathParameterSubSchema); ok {
- return x.PathParameterSubSchema
- }
- return nil
-}
-
-// XXX_OneofWrappers is for the internal use of the proto package.
-func (*NonBodyParameter) XXX_OneofWrappers() []interface{} {
- return []interface{}{
- (*NonBodyParameter_HeaderParameterSubSchema)(nil),
- (*NonBodyParameter_FormDataParameterSubSchema)(nil),
- (*NonBodyParameter_QueryParameterSubSchema)(nil),
- (*NonBodyParameter_PathParameterSubSchema)(nil),
- }
-}
-
-type Oauth2AccessCodeSecurity struct {
- Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
- Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"`
- Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"`
- AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"`
- TokenUrl string `protobuf:"bytes,5,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"`
- Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Oauth2AccessCodeSecurity) Reset() { *m = Oauth2AccessCodeSecurity{} }
-func (m *Oauth2AccessCodeSecurity) String() string { return proto.CompactTextString(m) }
-func (*Oauth2AccessCodeSecurity) ProtoMessage() {}
-func (*Oauth2AccessCodeSecurity) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{31}
-}
-
-func (m *Oauth2AccessCodeSecurity) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Oauth2AccessCodeSecurity.Unmarshal(m, b)
-}
-func (m *Oauth2AccessCodeSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Oauth2AccessCodeSecurity.Marshal(b, m, deterministic)
-}
-func (m *Oauth2AccessCodeSecurity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Oauth2AccessCodeSecurity.Merge(m, src)
-}
-func (m *Oauth2AccessCodeSecurity) XXX_Size() int {
- return xxx_messageInfo_Oauth2AccessCodeSecurity.Size(m)
-}
-func (m *Oauth2AccessCodeSecurity) XXX_DiscardUnknown() {
- xxx_messageInfo_Oauth2AccessCodeSecurity.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Oauth2AccessCodeSecurity proto.InternalMessageInfo
-
-func (m *Oauth2AccessCodeSecurity) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *Oauth2AccessCodeSecurity) GetFlow() string {
- if m != nil {
- return m.Flow
- }
- return ""
-}
-
-func (m *Oauth2AccessCodeSecurity) GetScopes() *Oauth2Scopes {
- if m != nil {
- return m.Scopes
- }
- return nil
-}
-
-func (m *Oauth2AccessCodeSecurity) GetAuthorizationUrl() string {
- if m != nil {
- return m.AuthorizationUrl
- }
- return ""
-}
-
-func (m *Oauth2AccessCodeSecurity) GetTokenUrl() string {
- if m != nil {
- return m.TokenUrl
- }
- return ""
-}
-
-func (m *Oauth2AccessCodeSecurity) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *Oauth2AccessCodeSecurity) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Oauth2ApplicationSecurity struct {
- Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
- Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"`
- Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"`
- TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"`
- Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Oauth2ApplicationSecurity) Reset() { *m = Oauth2ApplicationSecurity{} }
-func (m *Oauth2ApplicationSecurity) String() string { return proto.CompactTextString(m) }
-func (*Oauth2ApplicationSecurity) ProtoMessage() {}
-func (*Oauth2ApplicationSecurity) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{32}
-}
-
-func (m *Oauth2ApplicationSecurity) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Oauth2ApplicationSecurity.Unmarshal(m, b)
-}
-func (m *Oauth2ApplicationSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Oauth2ApplicationSecurity.Marshal(b, m, deterministic)
-}
-func (m *Oauth2ApplicationSecurity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Oauth2ApplicationSecurity.Merge(m, src)
-}
-func (m *Oauth2ApplicationSecurity) XXX_Size() int {
- return xxx_messageInfo_Oauth2ApplicationSecurity.Size(m)
-}
-func (m *Oauth2ApplicationSecurity) XXX_DiscardUnknown() {
- xxx_messageInfo_Oauth2ApplicationSecurity.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Oauth2ApplicationSecurity proto.InternalMessageInfo
-
-func (m *Oauth2ApplicationSecurity) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *Oauth2ApplicationSecurity) GetFlow() string {
- if m != nil {
- return m.Flow
- }
- return ""
-}
-
-func (m *Oauth2ApplicationSecurity) GetScopes() *Oauth2Scopes {
- if m != nil {
- return m.Scopes
- }
- return nil
-}
-
-func (m *Oauth2ApplicationSecurity) GetTokenUrl() string {
- if m != nil {
- return m.TokenUrl
- }
- return ""
-}
-
-func (m *Oauth2ApplicationSecurity) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *Oauth2ApplicationSecurity) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Oauth2ImplicitSecurity struct {
- Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
- Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"`
- Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"`
- AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"`
- Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Oauth2ImplicitSecurity) Reset() { *m = Oauth2ImplicitSecurity{} }
-func (m *Oauth2ImplicitSecurity) String() string { return proto.CompactTextString(m) }
-func (*Oauth2ImplicitSecurity) ProtoMessage() {}
-func (*Oauth2ImplicitSecurity) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{33}
-}
-
-func (m *Oauth2ImplicitSecurity) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Oauth2ImplicitSecurity.Unmarshal(m, b)
-}
-func (m *Oauth2ImplicitSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Oauth2ImplicitSecurity.Marshal(b, m, deterministic)
-}
-func (m *Oauth2ImplicitSecurity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Oauth2ImplicitSecurity.Merge(m, src)
-}
-func (m *Oauth2ImplicitSecurity) XXX_Size() int {
- return xxx_messageInfo_Oauth2ImplicitSecurity.Size(m)
-}
-func (m *Oauth2ImplicitSecurity) XXX_DiscardUnknown() {
- xxx_messageInfo_Oauth2ImplicitSecurity.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Oauth2ImplicitSecurity proto.InternalMessageInfo
-
-func (m *Oauth2ImplicitSecurity) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *Oauth2ImplicitSecurity) GetFlow() string {
- if m != nil {
- return m.Flow
- }
- return ""
-}
-
-func (m *Oauth2ImplicitSecurity) GetScopes() *Oauth2Scopes {
- if m != nil {
- return m.Scopes
- }
- return nil
-}
-
-func (m *Oauth2ImplicitSecurity) GetAuthorizationUrl() string {
- if m != nil {
- return m.AuthorizationUrl
- }
- return ""
-}
-
-func (m *Oauth2ImplicitSecurity) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *Oauth2ImplicitSecurity) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Oauth2PasswordSecurity struct {
- Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
- Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"`
- Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"`
- TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"`
- Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Oauth2PasswordSecurity) Reset() { *m = Oauth2PasswordSecurity{} }
-func (m *Oauth2PasswordSecurity) String() string { return proto.CompactTextString(m) }
-func (*Oauth2PasswordSecurity) ProtoMessage() {}
-func (*Oauth2PasswordSecurity) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{34}
-}
-
-func (m *Oauth2PasswordSecurity) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Oauth2PasswordSecurity.Unmarshal(m, b)
-}
-func (m *Oauth2PasswordSecurity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Oauth2PasswordSecurity.Marshal(b, m, deterministic)
-}
-func (m *Oauth2PasswordSecurity) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Oauth2PasswordSecurity.Merge(m, src)
-}
-func (m *Oauth2PasswordSecurity) XXX_Size() int {
- return xxx_messageInfo_Oauth2PasswordSecurity.Size(m)
-}
-func (m *Oauth2PasswordSecurity) XXX_DiscardUnknown() {
- xxx_messageInfo_Oauth2PasswordSecurity.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Oauth2PasswordSecurity proto.InternalMessageInfo
-
-func (m *Oauth2PasswordSecurity) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *Oauth2PasswordSecurity) GetFlow() string {
- if m != nil {
- return m.Flow
- }
- return ""
-}
-
-func (m *Oauth2PasswordSecurity) GetScopes() *Oauth2Scopes {
- if m != nil {
- return m.Scopes
- }
- return nil
-}
-
-func (m *Oauth2PasswordSecurity) GetTokenUrl() string {
- if m != nil {
- return m.TokenUrl
- }
- return ""
-}
-
-func (m *Oauth2PasswordSecurity) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *Oauth2PasswordSecurity) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Oauth2Scopes struct {
- AdditionalProperties []*NamedString `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Oauth2Scopes) Reset() { *m = Oauth2Scopes{} }
-func (m *Oauth2Scopes) String() string { return proto.CompactTextString(m) }
-func (*Oauth2Scopes) ProtoMessage() {}
-func (*Oauth2Scopes) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{35}
-}
-
-func (m *Oauth2Scopes) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Oauth2Scopes.Unmarshal(m, b)
-}
-func (m *Oauth2Scopes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Oauth2Scopes.Marshal(b, m, deterministic)
-}
-func (m *Oauth2Scopes) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Oauth2Scopes.Merge(m, src)
-}
-func (m *Oauth2Scopes) XXX_Size() int {
- return xxx_messageInfo_Oauth2Scopes.Size(m)
-}
-func (m *Oauth2Scopes) XXX_DiscardUnknown() {
- xxx_messageInfo_Oauth2Scopes.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Oauth2Scopes proto.InternalMessageInfo
-
-func (m *Oauth2Scopes) GetAdditionalProperties() []*NamedString {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-type Operation struct {
- Tags []string `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"`
- // A brief summary of the operation.
- Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"`
- // A longer description of the operation, GitHub Flavored Markdown is allowed.
- Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
- ExternalDocs *ExternalDocs `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"`
- // A unique identifier of the operation.
- OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"`
- // A list of MIME types the API can produce.
- Produces []string `protobuf:"bytes,6,rep,name=produces,proto3" json:"produces,omitempty"`
- // A list of MIME types the API can consume.
- Consumes []string `protobuf:"bytes,7,rep,name=consumes,proto3" json:"consumes,omitempty"`
- // The parameters needed to send a valid API call.
- Parameters []*ParametersItem `protobuf:"bytes,8,rep,name=parameters,proto3" json:"parameters,omitempty"`
- Responses *Responses `protobuf:"bytes,9,opt,name=responses,proto3" json:"responses,omitempty"`
- // The transfer protocol of the API.
- Schemes []string `protobuf:"bytes,10,rep,name=schemes,proto3" json:"schemes,omitempty"`
- Deprecated bool `protobuf:"varint,11,opt,name=deprecated,proto3" json:"deprecated,omitempty"`
- Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,13,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Operation) Reset() { *m = Operation{} }
-func (m *Operation) String() string { return proto.CompactTextString(m) }
-func (*Operation) ProtoMessage() {}
-func (*Operation) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{36}
-}
-
-func (m *Operation) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Operation.Unmarshal(m, b)
-}
-func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Operation.Marshal(b, m, deterministic)
-}
-func (m *Operation) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Operation.Merge(m, src)
-}
-func (m *Operation) XXX_Size() int {
- return xxx_messageInfo_Operation.Size(m)
-}
-func (m *Operation) XXX_DiscardUnknown() {
- xxx_messageInfo_Operation.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Operation proto.InternalMessageInfo
-
-func (m *Operation) GetTags() []string {
- if m != nil {
- return m.Tags
- }
- return nil
-}
-
-func (m *Operation) GetSummary() string {
- if m != nil {
- return m.Summary
- }
- return ""
-}
-
-func (m *Operation) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *Operation) GetExternalDocs() *ExternalDocs {
- if m != nil {
- return m.ExternalDocs
- }
- return nil
-}
-
-func (m *Operation) GetOperationId() string {
- if m != nil {
- return m.OperationId
- }
- return ""
-}
-
-func (m *Operation) GetProduces() []string {
- if m != nil {
- return m.Produces
- }
- return nil
-}
-
-func (m *Operation) GetConsumes() []string {
- if m != nil {
- return m.Consumes
- }
- return nil
-}
-
-func (m *Operation) GetParameters() []*ParametersItem {
- if m != nil {
- return m.Parameters
- }
- return nil
-}
-
-func (m *Operation) GetResponses() *Responses {
- if m != nil {
- return m.Responses
- }
- return nil
-}
-
-func (m *Operation) GetSchemes() []string {
- if m != nil {
- return m.Schemes
- }
- return nil
-}
-
-func (m *Operation) GetDeprecated() bool {
- if m != nil {
- return m.Deprecated
- }
- return false
-}
-
-func (m *Operation) GetSecurity() []*SecurityRequirement {
- if m != nil {
- return m.Security
- }
- return nil
-}
-
-func (m *Operation) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Parameter struct {
- // Types that are valid to be assigned to Oneof:
- // *Parameter_BodyParameter
- // *Parameter_NonBodyParameter
- Oneof isParameter_Oneof `protobuf_oneof:"oneof"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Parameter) Reset() { *m = Parameter{} }
-func (m *Parameter) String() string { return proto.CompactTextString(m) }
-func (*Parameter) ProtoMessage() {}
-func (*Parameter) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{37}
-}
-
-func (m *Parameter) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Parameter.Unmarshal(m, b)
-}
-func (m *Parameter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Parameter.Marshal(b, m, deterministic)
-}
-func (m *Parameter) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Parameter.Merge(m, src)
-}
-func (m *Parameter) XXX_Size() int {
- return xxx_messageInfo_Parameter.Size(m)
-}
-func (m *Parameter) XXX_DiscardUnknown() {
- xxx_messageInfo_Parameter.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Parameter proto.InternalMessageInfo
-
-type isParameter_Oneof interface {
- isParameter_Oneof()
-}
-
-type Parameter_BodyParameter struct {
- BodyParameter *BodyParameter `protobuf:"bytes,1,opt,name=body_parameter,json=bodyParameter,proto3,oneof"`
-}
-
-type Parameter_NonBodyParameter struct {
- NonBodyParameter *NonBodyParameter `protobuf:"bytes,2,opt,name=non_body_parameter,json=nonBodyParameter,proto3,oneof"`
-}
-
-func (*Parameter_BodyParameter) isParameter_Oneof() {}
-
-func (*Parameter_NonBodyParameter) isParameter_Oneof() {}
-
-func (m *Parameter) GetOneof() isParameter_Oneof {
- if m != nil {
- return m.Oneof
- }
- return nil
-}
-
-func (m *Parameter) GetBodyParameter() *BodyParameter {
- if x, ok := m.GetOneof().(*Parameter_BodyParameter); ok {
- return x.BodyParameter
- }
- return nil
-}
-
-func (m *Parameter) GetNonBodyParameter() *NonBodyParameter {
- if x, ok := m.GetOneof().(*Parameter_NonBodyParameter); ok {
- return x.NonBodyParameter
- }
- return nil
-}
-
-// XXX_OneofWrappers is for the internal use of the proto package.
-func (*Parameter) XXX_OneofWrappers() []interface{} {
- return []interface{}{
- (*Parameter_BodyParameter)(nil),
- (*Parameter_NonBodyParameter)(nil),
- }
-}
-
-// One or more JSON representations for parameters
-type ParameterDefinitions struct {
- AdditionalProperties []*NamedParameter `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ParameterDefinitions) Reset() { *m = ParameterDefinitions{} }
-func (m *ParameterDefinitions) String() string { return proto.CompactTextString(m) }
-func (*ParameterDefinitions) ProtoMessage() {}
-func (*ParameterDefinitions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{38}
-}
-
-func (m *ParameterDefinitions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ParameterDefinitions.Unmarshal(m, b)
-}
-func (m *ParameterDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ParameterDefinitions.Marshal(b, m, deterministic)
-}
-func (m *ParameterDefinitions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ParameterDefinitions.Merge(m, src)
-}
-func (m *ParameterDefinitions) XXX_Size() int {
- return xxx_messageInfo_ParameterDefinitions.Size(m)
-}
-func (m *ParameterDefinitions) XXX_DiscardUnknown() {
- xxx_messageInfo_ParameterDefinitions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ParameterDefinitions proto.InternalMessageInfo
-
-func (m *ParameterDefinitions) GetAdditionalProperties() []*NamedParameter {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-type ParametersItem struct {
- // Types that are valid to be assigned to Oneof:
- // *ParametersItem_Parameter
- // *ParametersItem_JsonReference
- Oneof isParametersItem_Oneof `protobuf_oneof:"oneof"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ParametersItem) Reset() { *m = ParametersItem{} }
-func (m *ParametersItem) String() string { return proto.CompactTextString(m) }
-func (*ParametersItem) ProtoMessage() {}
-func (*ParametersItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{39}
-}
-
-func (m *ParametersItem) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ParametersItem.Unmarshal(m, b)
-}
-func (m *ParametersItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ParametersItem.Marshal(b, m, deterministic)
-}
-func (m *ParametersItem) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ParametersItem.Merge(m, src)
-}
-func (m *ParametersItem) XXX_Size() int {
- return xxx_messageInfo_ParametersItem.Size(m)
-}
-func (m *ParametersItem) XXX_DiscardUnknown() {
- xxx_messageInfo_ParametersItem.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ParametersItem proto.InternalMessageInfo
-
-type isParametersItem_Oneof interface {
- isParametersItem_Oneof()
-}
-
-type ParametersItem_Parameter struct {
- Parameter *Parameter `protobuf:"bytes,1,opt,name=parameter,proto3,oneof"`
-}
-
-type ParametersItem_JsonReference struct {
- JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"`
-}
-
-func (*ParametersItem_Parameter) isParametersItem_Oneof() {}
-
-func (*ParametersItem_JsonReference) isParametersItem_Oneof() {}
-
-func (m *ParametersItem) GetOneof() isParametersItem_Oneof {
- if m != nil {
- return m.Oneof
- }
- return nil
-}
-
-func (m *ParametersItem) GetParameter() *Parameter {
- if x, ok := m.GetOneof().(*ParametersItem_Parameter); ok {
- return x.Parameter
- }
- return nil
-}
-
-func (m *ParametersItem) GetJsonReference() *JsonReference {
- if x, ok := m.GetOneof().(*ParametersItem_JsonReference); ok {
- return x.JsonReference
- }
- return nil
-}
-
-// XXX_OneofWrappers is for the internal use of the proto package.
-func (*ParametersItem) XXX_OneofWrappers() []interface{} {
- return []interface{}{
- (*ParametersItem_Parameter)(nil),
- (*ParametersItem_JsonReference)(nil),
- }
-}
-
-type PathItem struct {
- XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"`
- Get *Operation `protobuf:"bytes,2,opt,name=get,proto3" json:"get,omitempty"`
- Put *Operation `protobuf:"bytes,3,opt,name=put,proto3" json:"put,omitempty"`
- Post *Operation `protobuf:"bytes,4,opt,name=post,proto3" json:"post,omitempty"`
- Delete *Operation `protobuf:"bytes,5,opt,name=delete,proto3" json:"delete,omitempty"`
- Options *Operation `protobuf:"bytes,6,opt,name=options,proto3" json:"options,omitempty"`
- Head *Operation `protobuf:"bytes,7,opt,name=head,proto3" json:"head,omitempty"`
- Patch *Operation `protobuf:"bytes,8,opt,name=patch,proto3" json:"patch,omitempty"`
- // The parameters needed to send a valid API call.
- Parameters []*ParametersItem `protobuf:"bytes,9,rep,name=parameters,proto3" json:"parameters,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PathItem) Reset() { *m = PathItem{} }
-func (m *PathItem) String() string { return proto.CompactTextString(m) }
-func (*PathItem) ProtoMessage() {}
-func (*PathItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{40}
-}
-
-func (m *PathItem) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_PathItem.Unmarshal(m, b)
-}
-func (m *PathItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_PathItem.Marshal(b, m, deterministic)
-}
-func (m *PathItem) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PathItem.Merge(m, src)
-}
-func (m *PathItem) XXX_Size() int {
- return xxx_messageInfo_PathItem.Size(m)
-}
-func (m *PathItem) XXX_DiscardUnknown() {
- xxx_messageInfo_PathItem.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PathItem proto.InternalMessageInfo
-
-func (m *PathItem) GetXRef() string {
- if m != nil {
- return m.XRef
- }
- return ""
-}
-
-func (m *PathItem) GetGet() *Operation {
- if m != nil {
- return m.Get
- }
- return nil
-}
-
-func (m *PathItem) GetPut() *Operation {
- if m != nil {
- return m.Put
- }
- return nil
-}
-
-func (m *PathItem) GetPost() *Operation {
- if m != nil {
- return m.Post
- }
- return nil
-}
-
-func (m *PathItem) GetDelete() *Operation {
- if m != nil {
- return m.Delete
- }
- return nil
-}
-
-func (m *PathItem) GetOptions() *Operation {
- if m != nil {
- return m.Options
- }
- return nil
-}
-
-func (m *PathItem) GetHead() *Operation {
- if m != nil {
- return m.Head
- }
- return nil
-}
-
-func (m *PathItem) GetPatch() *Operation {
- if m != nil {
- return m.Patch
- }
- return nil
-}
-
-func (m *PathItem) GetParameters() []*ParametersItem {
- if m != nil {
- return m.Parameters
- }
- return nil
-}
-
-func (m *PathItem) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type PathParameterSubSchema struct {
- // Determines whether or not this parameter is required or optional.
- Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"`
- // Determines the location of the parameter.
- In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"`
- // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
- Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
- // The name of the parameter.
- Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
- Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"`
- Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"`
- Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"`
- CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"`
- Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"`
- Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"`
- ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"`
- Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"`
- ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"`
- MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"`
- MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"`
- Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"`
- MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"`
- MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"`
- UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"`
- Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"`
- MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PathParameterSubSchema) Reset() { *m = PathParameterSubSchema{} }
-func (m *PathParameterSubSchema) String() string { return proto.CompactTextString(m) }
-func (*PathParameterSubSchema) ProtoMessage() {}
-func (*PathParameterSubSchema) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{41}
-}
-
-func (m *PathParameterSubSchema) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_PathParameterSubSchema.Unmarshal(m, b)
-}
-func (m *PathParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_PathParameterSubSchema.Marshal(b, m, deterministic)
-}
-func (m *PathParameterSubSchema) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PathParameterSubSchema.Merge(m, src)
-}
-func (m *PathParameterSubSchema) XXX_Size() int {
- return xxx_messageInfo_PathParameterSubSchema.Size(m)
-}
-func (m *PathParameterSubSchema) XXX_DiscardUnknown() {
- xxx_messageInfo_PathParameterSubSchema.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PathParameterSubSchema proto.InternalMessageInfo
-
-func (m *PathParameterSubSchema) GetRequired() bool {
- if m != nil {
- return m.Required
- }
- return false
-}
-
-func (m *PathParameterSubSchema) GetIn() string {
- if m != nil {
- return m.In
- }
- return ""
-}
-
-func (m *PathParameterSubSchema) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *PathParameterSubSchema) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *PathParameterSubSchema) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *PathParameterSubSchema) GetFormat() string {
- if m != nil {
- return m.Format
- }
- return ""
-}
-
-func (m *PathParameterSubSchema) GetItems() *PrimitivesItems {
- if m != nil {
- return m.Items
- }
- return nil
-}
-
-func (m *PathParameterSubSchema) GetCollectionFormat() string {
- if m != nil {
- return m.CollectionFormat
- }
- return ""
-}
-
-func (m *PathParameterSubSchema) GetDefault() *Any {
- if m != nil {
- return m.Default
- }
- return nil
-}
-
-func (m *PathParameterSubSchema) GetMaximum() float64 {
- if m != nil {
- return m.Maximum
- }
- return 0
-}
-
-func (m *PathParameterSubSchema) GetExclusiveMaximum() bool {
- if m != nil {
- return m.ExclusiveMaximum
- }
- return false
-}
-
-func (m *PathParameterSubSchema) GetMinimum() float64 {
- if m != nil {
- return m.Minimum
- }
- return 0
-}
-
-func (m *PathParameterSubSchema) GetExclusiveMinimum() bool {
- if m != nil {
- return m.ExclusiveMinimum
- }
- return false
-}
-
-func (m *PathParameterSubSchema) GetMaxLength() int64 {
- if m != nil {
- return m.MaxLength
- }
- return 0
-}
-
-func (m *PathParameterSubSchema) GetMinLength() int64 {
- if m != nil {
- return m.MinLength
- }
- return 0
-}
-
-func (m *PathParameterSubSchema) GetPattern() string {
- if m != nil {
- return m.Pattern
- }
- return ""
-}
-
-func (m *PathParameterSubSchema) GetMaxItems() int64 {
- if m != nil {
- return m.MaxItems
- }
- return 0
-}
-
-func (m *PathParameterSubSchema) GetMinItems() int64 {
- if m != nil {
- return m.MinItems
- }
- return 0
-}
-
-func (m *PathParameterSubSchema) GetUniqueItems() bool {
- if m != nil {
- return m.UniqueItems
- }
- return false
-}
-
-func (m *PathParameterSubSchema) GetEnum() []*Any {
- if m != nil {
- return m.Enum
- }
- return nil
-}
-
-func (m *PathParameterSubSchema) GetMultipleOf() float64 {
- if m != nil {
- return m.MultipleOf
- }
- return 0
-}
-
-func (m *PathParameterSubSchema) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-// Relative paths to the individual endpoints. They must be relative to the 'basePath'.
-type Paths struct {
- VendorExtension []*NamedAny `protobuf:"bytes,1,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- Path []*NamedPathItem `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Paths) Reset() { *m = Paths{} }
-func (m *Paths) String() string { return proto.CompactTextString(m) }
-func (*Paths) ProtoMessage() {}
-func (*Paths) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{42}
-}
-
-func (m *Paths) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Paths.Unmarshal(m, b)
-}
-func (m *Paths) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Paths.Marshal(b, m, deterministic)
-}
-func (m *Paths) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Paths.Merge(m, src)
-}
-func (m *Paths) XXX_Size() int {
- return xxx_messageInfo_Paths.Size(m)
-}
-func (m *Paths) XXX_DiscardUnknown() {
- xxx_messageInfo_Paths.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Paths proto.InternalMessageInfo
-
-func (m *Paths) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-func (m *Paths) GetPath() []*NamedPathItem {
- if m != nil {
- return m.Path
- }
- return nil
-}
-
-type PrimitivesItems struct {
- Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
- Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"`
- Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"`
- CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"`
- Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"`
- Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"`
- ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"`
- Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"`
- ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"`
- MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"`
- MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"`
- Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"`
- MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"`
- MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"`
- UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"`
- Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"`
- MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,18,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PrimitivesItems) Reset() { *m = PrimitivesItems{} }
-func (m *PrimitivesItems) String() string { return proto.CompactTextString(m) }
-func (*PrimitivesItems) ProtoMessage() {}
-func (*PrimitivesItems) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{43}
-}
-
-func (m *PrimitivesItems) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_PrimitivesItems.Unmarshal(m, b)
-}
-func (m *PrimitivesItems) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_PrimitivesItems.Marshal(b, m, deterministic)
-}
-func (m *PrimitivesItems) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PrimitivesItems.Merge(m, src)
-}
-func (m *PrimitivesItems) XXX_Size() int {
- return xxx_messageInfo_PrimitivesItems.Size(m)
-}
-func (m *PrimitivesItems) XXX_DiscardUnknown() {
- xxx_messageInfo_PrimitivesItems.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PrimitivesItems proto.InternalMessageInfo
-
-func (m *PrimitivesItems) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *PrimitivesItems) GetFormat() string {
- if m != nil {
- return m.Format
- }
- return ""
-}
-
-func (m *PrimitivesItems) GetItems() *PrimitivesItems {
- if m != nil {
- return m.Items
- }
- return nil
-}
-
-func (m *PrimitivesItems) GetCollectionFormat() string {
- if m != nil {
- return m.CollectionFormat
- }
- return ""
-}
-
-func (m *PrimitivesItems) GetDefault() *Any {
- if m != nil {
- return m.Default
- }
- return nil
-}
-
-func (m *PrimitivesItems) GetMaximum() float64 {
- if m != nil {
- return m.Maximum
- }
- return 0
-}
-
-func (m *PrimitivesItems) GetExclusiveMaximum() bool {
- if m != nil {
- return m.ExclusiveMaximum
- }
- return false
-}
-
-func (m *PrimitivesItems) GetMinimum() float64 {
- if m != nil {
- return m.Minimum
- }
- return 0
-}
-
-func (m *PrimitivesItems) GetExclusiveMinimum() bool {
- if m != nil {
- return m.ExclusiveMinimum
- }
- return false
-}
-
-func (m *PrimitivesItems) GetMaxLength() int64 {
- if m != nil {
- return m.MaxLength
- }
- return 0
-}
-
-func (m *PrimitivesItems) GetMinLength() int64 {
- if m != nil {
- return m.MinLength
- }
- return 0
-}
-
-func (m *PrimitivesItems) GetPattern() string {
- if m != nil {
- return m.Pattern
- }
- return ""
-}
-
-func (m *PrimitivesItems) GetMaxItems() int64 {
- if m != nil {
- return m.MaxItems
- }
- return 0
-}
-
-func (m *PrimitivesItems) GetMinItems() int64 {
- if m != nil {
- return m.MinItems
- }
- return 0
-}
-
-func (m *PrimitivesItems) GetUniqueItems() bool {
- if m != nil {
- return m.UniqueItems
- }
- return false
-}
-
-func (m *PrimitivesItems) GetEnum() []*Any {
- if m != nil {
- return m.Enum
- }
- return nil
-}
-
-func (m *PrimitivesItems) GetMultipleOf() float64 {
- if m != nil {
- return m.MultipleOf
- }
- return 0
-}
-
-func (m *PrimitivesItems) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Properties struct {
- AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Properties) Reset() { *m = Properties{} }
-func (m *Properties) String() string { return proto.CompactTextString(m) }
-func (*Properties) ProtoMessage() {}
-func (*Properties) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{44}
-}
-
-func (m *Properties) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Properties.Unmarshal(m, b)
-}
-func (m *Properties) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Properties.Marshal(b, m, deterministic)
-}
-func (m *Properties) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Properties.Merge(m, src)
-}
-func (m *Properties) XXX_Size() int {
- return xxx_messageInfo_Properties.Size(m)
-}
-func (m *Properties) XXX_DiscardUnknown() {
- xxx_messageInfo_Properties.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Properties proto.InternalMessageInfo
-
-func (m *Properties) GetAdditionalProperties() []*NamedSchema {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-type QueryParameterSubSchema struct {
- // Determines whether or not this parameter is required or optional.
- Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"`
- // Determines the location of the parameter.
- In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"`
- // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
- Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
- // The name of the parameter.
- Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
- // allows sending a parameter by name only or with an empty value.
- AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"`
- Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"`
- Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"`
- Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"`
- CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"`
- Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"`
- Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"`
- ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"`
- Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"`
- ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"`
- MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"`
- MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"`
- Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"`
- MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"`
- MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"`
- UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"`
- Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"`
- MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *QueryParameterSubSchema) Reset() { *m = QueryParameterSubSchema{} }
-func (m *QueryParameterSubSchema) String() string { return proto.CompactTextString(m) }
-func (*QueryParameterSubSchema) ProtoMessage() {}
-func (*QueryParameterSubSchema) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{45}
-}
-
-func (m *QueryParameterSubSchema) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_QueryParameterSubSchema.Unmarshal(m, b)
-}
-func (m *QueryParameterSubSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_QueryParameterSubSchema.Marshal(b, m, deterministic)
-}
-func (m *QueryParameterSubSchema) XXX_Merge(src proto.Message) {
- xxx_messageInfo_QueryParameterSubSchema.Merge(m, src)
-}
-func (m *QueryParameterSubSchema) XXX_Size() int {
- return xxx_messageInfo_QueryParameterSubSchema.Size(m)
-}
-func (m *QueryParameterSubSchema) XXX_DiscardUnknown() {
- xxx_messageInfo_QueryParameterSubSchema.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_QueryParameterSubSchema proto.InternalMessageInfo
-
-func (m *QueryParameterSubSchema) GetRequired() bool {
- if m != nil {
- return m.Required
- }
- return false
-}
-
-func (m *QueryParameterSubSchema) GetIn() string {
- if m != nil {
- return m.In
- }
- return ""
-}
-
-func (m *QueryParameterSubSchema) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *QueryParameterSubSchema) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *QueryParameterSubSchema) GetAllowEmptyValue() bool {
- if m != nil {
- return m.AllowEmptyValue
- }
- return false
-}
-
-func (m *QueryParameterSubSchema) GetType() string {
- if m != nil {
- return m.Type
- }
- return ""
-}
-
-func (m *QueryParameterSubSchema) GetFormat() string {
- if m != nil {
- return m.Format
- }
- return ""
-}
-
-func (m *QueryParameterSubSchema) GetItems() *PrimitivesItems {
- if m != nil {
- return m.Items
- }
- return nil
-}
-
-func (m *QueryParameterSubSchema) GetCollectionFormat() string {
- if m != nil {
- return m.CollectionFormat
- }
- return ""
-}
-
-func (m *QueryParameterSubSchema) GetDefault() *Any {
- if m != nil {
- return m.Default
- }
- return nil
-}
-
-func (m *QueryParameterSubSchema) GetMaximum() float64 {
- if m != nil {
- return m.Maximum
- }
- return 0
-}
-
-func (m *QueryParameterSubSchema) GetExclusiveMaximum() bool {
- if m != nil {
- return m.ExclusiveMaximum
- }
- return false
-}
-
-func (m *QueryParameterSubSchema) GetMinimum() float64 {
- if m != nil {
- return m.Minimum
- }
- return 0
-}
-
-func (m *QueryParameterSubSchema) GetExclusiveMinimum() bool {
- if m != nil {
- return m.ExclusiveMinimum
- }
- return false
-}
-
-func (m *QueryParameterSubSchema) GetMaxLength() int64 {
- if m != nil {
- return m.MaxLength
- }
- return 0
-}
-
-func (m *QueryParameterSubSchema) GetMinLength() int64 {
- if m != nil {
- return m.MinLength
- }
- return 0
-}
-
-func (m *QueryParameterSubSchema) GetPattern() string {
- if m != nil {
- return m.Pattern
- }
- return ""
-}
-
-func (m *QueryParameterSubSchema) GetMaxItems() int64 {
- if m != nil {
- return m.MaxItems
- }
- return 0
-}
-
-func (m *QueryParameterSubSchema) GetMinItems() int64 {
- if m != nil {
- return m.MinItems
- }
- return 0
-}
-
-func (m *QueryParameterSubSchema) GetUniqueItems() bool {
- if m != nil {
- return m.UniqueItems
- }
- return false
-}
-
-func (m *QueryParameterSubSchema) GetEnum() []*Any {
- if m != nil {
- return m.Enum
- }
- return nil
-}
-
-func (m *QueryParameterSubSchema) GetMultipleOf() float64 {
- if m != nil {
- return m.MultipleOf
- }
- return 0
-}
-
-func (m *QueryParameterSubSchema) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type Response struct {
- Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
- Schema *SchemaItem `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"`
- Headers *Headers `protobuf:"bytes,3,opt,name=headers,proto3" json:"headers,omitempty"`
- Examples *Examples `protobuf:"bytes,4,opt,name=examples,proto3" json:"examples,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Response) Reset() { *m = Response{} }
-func (m *Response) String() string { return proto.CompactTextString(m) }
-func (*Response) ProtoMessage() {}
-func (*Response) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{46}
-}
-
-func (m *Response) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Response.Unmarshal(m, b)
-}
-func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Response.Marshal(b, m, deterministic)
-}
-func (m *Response) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Response.Merge(m, src)
-}
-func (m *Response) XXX_Size() int {
- return xxx_messageInfo_Response.Size(m)
-}
-func (m *Response) XXX_DiscardUnknown() {
- xxx_messageInfo_Response.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Response proto.InternalMessageInfo
-
-func (m *Response) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *Response) GetSchema() *SchemaItem {
- if m != nil {
- return m.Schema
- }
- return nil
-}
-
-func (m *Response) GetHeaders() *Headers {
- if m != nil {
- return m.Headers
- }
- return nil
-}
-
-func (m *Response) GetExamples() *Examples {
- if m != nil {
- return m.Examples
- }
- return nil
-}
-
-func (m *Response) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-// One or more JSON representations for parameters
-type ResponseDefinitions struct {
- AdditionalProperties []*NamedResponse `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ResponseDefinitions) Reset() { *m = ResponseDefinitions{} }
-func (m *ResponseDefinitions) String() string { return proto.CompactTextString(m) }
-func (*ResponseDefinitions) ProtoMessage() {}
-func (*ResponseDefinitions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{47}
-}
-
-func (m *ResponseDefinitions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ResponseDefinitions.Unmarshal(m, b)
-}
-func (m *ResponseDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ResponseDefinitions.Marshal(b, m, deterministic)
-}
-func (m *ResponseDefinitions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResponseDefinitions.Merge(m, src)
-}
-func (m *ResponseDefinitions) XXX_Size() int {
- return xxx_messageInfo_ResponseDefinitions.Size(m)
-}
-func (m *ResponseDefinitions) XXX_DiscardUnknown() {
- xxx_messageInfo_ResponseDefinitions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResponseDefinitions proto.InternalMessageInfo
-
-func (m *ResponseDefinitions) GetAdditionalProperties() []*NamedResponse {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-type ResponseValue struct {
- // Types that are valid to be assigned to Oneof:
- // *ResponseValue_Response
- // *ResponseValue_JsonReference
- Oneof isResponseValue_Oneof `protobuf_oneof:"oneof"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ResponseValue) Reset() { *m = ResponseValue{} }
-func (m *ResponseValue) String() string { return proto.CompactTextString(m) }
-func (*ResponseValue) ProtoMessage() {}
-func (*ResponseValue) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{48}
-}
-
-func (m *ResponseValue) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_ResponseValue.Unmarshal(m, b)
-}
-func (m *ResponseValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_ResponseValue.Marshal(b, m, deterministic)
-}
-func (m *ResponseValue) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResponseValue.Merge(m, src)
-}
-func (m *ResponseValue) XXX_Size() int {
- return xxx_messageInfo_ResponseValue.Size(m)
-}
-func (m *ResponseValue) XXX_DiscardUnknown() {
- xxx_messageInfo_ResponseValue.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResponseValue proto.InternalMessageInfo
-
-type isResponseValue_Oneof interface {
- isResponseValue_Oneof()
-}
-
-type ResponseValue_Response struct {
- Response *Response `protobuf:"bytes,1,opt,name=response,proto3,oneof"`
-}
-
-type ResponseValue_JsonReference struct {
- JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"`
-}
-
-func (*ResponseValue_Response) isResponseValue_Oneof() {}
-
-func (*ResponseValue_JsonReference) isResponseValue_Oneof() {}
-
-func (m *ResponseValue) GetOneof() isResponseValue_Oneof {
- if m != nil {
- return m.Oneof
- }
- return nil
-}
-
-func (m *ResponseValue) GetResponse() *Response {
- if x, ok := m.GetOneof().(*ResponseValue_Response); ok {
- return x.Response
- }
- return nil
-}
-
-func (m *ResponseValue) GetJsonReference() *JsonReference {
- if x, ok := m.GetOneof().(*ResponseValue_JsonReference); ok {
- return x.JsonReference
- }
- return nil
-}
-
-// XXX_OneofWrappers is for the internal use of the proto package.
-func (*ResponseValue) XXX_OneofWrappers() []interface{} {
- return []interface{}{
- (*ResponseValue_Response)(nil),
- (*ResponseValue_JsonReference)(nil),
- }
-}
-
-// Response objects names can either be any valid HTTP status code or 'default'.
-type Responses struct {
- ResponseCode []*NamedResponseValue `protobuf:"bytes,1,rep,name=response_code,json=responseCode,proto3" json:"response_code,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,2,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Responses) Reset() { *m = Responses{} }
-func (m *Responses) String() string { return proto.CompactTextString(m) }
-func (*Responses) ProtoMessage() {}
-func (*Responses) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{49}
-}
-
-func (m *Responses) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Responses.Unmarshal(m, b)
-}
-func (m *Responses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Responses.Marshal(b, m, deterministic)
-}
-func (m *Responses) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Responses.Merge(m, src)
-}
-func (m *Responses) XXX_Size() int {
- return xxx_messageInfo_Responses.Size(m)
-}
-func (m *Responses) XXX_DiscardUnknown() {
- xxx_messageInfo_Responses.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Responses proto.InternalMessageInfo
-
-func (m *Responses) GetResponseCode() []*NamedResponseValue {
- if m != nil {
- return m.ResponseCode
- }
- return nil
-}
-
-func (m *Responses) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-// A deterministic version of a JSON Schema object.
-type Schema struct {
- XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"`
- Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"`
- Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
- Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
- Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"`
- MultipleOf float64 `protobuf:"fixed64,6,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"`
- Maximum float64 `protobuf:"fixed64,7,opt,name=maximum,proto3" json:"maximum,omitempty"`
- ExclusiveMaximum bool `protobuf:"varint,8,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"`
- Minimum float64 `protobuf:"fixed64,9,opt,name=minimum,proto3" json:"minimum,omitempty"`
- ExclusiveMinimum bool `protobuf:"varint,10,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"`
- MaxLength int64 `protobuf:"varint,11,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"`
- MinLength int64 `protobuf:"varint,12,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"`
- Pattern string `protobuf:"bytes,13,opt,name=pattern,proto3" json:"pattern,omitempty"`
- MaxItems int64 `protobuf:"varint,14,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"`
- MinItems int64 `protobuf:"varint,15,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"`
- UniqueItems bool `protobuf:"varint,16,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"`
- MaxProperties int64 `protobuf:"varint,17,opt,name=max_properties,json=maxProperties,proto3" json:"max_properties,omitempty"`
- MinProperties int64 `protobuf:"varint,18,opt,name=min_properties,json=minProperties,proto3" json:"min_properties,omitempty"`
- Required []string `protobuf:"bytes,19,rep,name=required,proto3" json:"required,omitempty"`
- Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"`
- AdditionalProperties *AdditionalPropertiesItem `protobuf:"bytes,21,opt,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- Type *TypeItem `protobuf:"bytes,22,opt,name=type,proto3" json:"type,omitempty"`
- Items *ItemsItem `protobuf:"bytes,23,opt,name=items,proto3" json:"items,omitempty"`
- AllOf []*Schema `protobuf:"bytes,24,rep,name=all_of,json=allOf,proto3" json:"all_of,omitempty"`
- Properties *Properties `protobuf:"bytes,25,opt,name=properties,proto3" json:"properties,omitempty"`
- Discriminator string `protobuf:"bytes,26,opt,name=discriminator,proto3" json:"discriminator,omitempty"`
- ReadOnly bool `protobuf:"varint,27,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
- Xml *Xml `protobuf:"bytes,28,opt,name=xml,proto3" json:"xml,omitempty"`
- ExternalDocs *ExternalDocs `protobuf:"bytes,29,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"`
- Example *Any `protobuf:"bytes,30,opt,name=example,proto3" json:"example,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,31,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Schema) Reset() { *m = Schema{} }
-func (m *Schema) String() string { return proto.CompactTextString(m) }
-func (*Schema) ProtoMessage() {}
-func (*Schema) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{50}
-}
-
-func (m *Schema) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Schema.Unmarshal(m, b)
-}
-func (m *Schema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Schema.Marshal(b, m, deterministic)
-}
-func (m *Schema) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Schema.Merge(m, src)
-}
-func (m *Schema) XXX_Size() int {
- return xxx_messageInfo_Schema.Size(m)
-}
-func (m *Schema) XXX_DiscardUnknown() {
- xxx_messageInfo_Schema.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Schema proto.InternalMessageInfo
-
-func (m *Schema) GetXRef() string {
- if m != nil {
- return m.XRef
- }
- return ""
-}
-
-func (m *Schema) GetFormat() string {
- if m != nil {
- return m.Format
- }
- return ""
-}
-
-func (m *Schema) GetTitle() string {
- if m != nil {
- return m.Title
- }
- return ""
-}
-
-func (m *Schema) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *Schema) GetDefault() *Any {
- if m != nil {
- return m.Default
- }
- return nil
-}
-
-func (m *Schema) GetMultipleOf() float64 {
- if m != nil {
- return m.MultipleOf
- }
- return 0
-}
-
-func (m *Schema) GetMaximum() float64 {
- if m != nil {
- return m.Maximum
- }
- return 0
-}
-
-func (m *Schema) GetExclusiveMaximum() bool {
- if m != nil {
- return m.ExclusiveMaximum
- }
- return false
-}
-
-func (m *Schema) GetMinimum() float64 {
- if m != nil {
- return m.Minimum
- }
- return 0
-}
-
-func (m *Schema) GetExclusiveMinimum() bool {
- if m != nil {
- return m.ExclusiveMinimum
- }
- return false
-}
-
-func (m *Schema) GetMaxLength() int64 {
- if m != nil {
- return m.MaxLength
- }
- return 0
-}
-
-func (m *Schema) GetMinLength() int64 {
- if m != nil {
- return m.MinLength
- }
- return 0
-}
-
-func (m *Schema) GetPattern() string {
- if m != nil {
- return m.Pattern
- }
- return ""
-}
-
-func (m *Schema) GetMaxItems() int64 {
- if m != nil {
- return m.MaxItems
- }
- return 0
-}
-
-func (m *Schema) GetMinItems() int64 {
- if m != nil {
- return m.MinItems
- }
- return 0
-}
-
-func (m *Schema) GetUniqueItems() bool {
- if m != nil {
- return m.UniqueItems
- }
- return false
-}
-
-func (m *Schema) GetMaxProperties() int64 {
- if m != nil {
- return m.MaxProperties
- }
- return 0
-}
-
-func (m *Schema) GetMinProperties() int64 {
- if m != nil {
- return m.MinProperties
- }
- return 0
-}
-
-func (m *Schema) GetRequired() []string {
- if m != nil {
- return m.Required
- }
- return nil
-}
-
-func (m *Schema) GetEnum() []*Any {
- if m != nil {
- return m.Enum
- }
- return nil
-}
-
-func (m *Schema) GetAdditionalProperties() *AdditionalPropertiesItem {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-func (m *Schema) GetType() *TypeItem {
- if m != nil {
- return m.Type
- }
- return nil
-}
-
-func (m *Schema) GetItems() *ItemsItem {
- if m != nil {
- return m.Items
- }
- return nil
-}
-
-func (m *Schema) GetAllOf() []*Schema {
- if m != nil {
- return m.AllOf
- }
- return nil
-}
-
-func (m *Schema) GetProperties() *Properties {
- if m != nil {
- return m.Properties
- }
- return nil
-}
-
-func (m *Schema) GetDiscriminator() string {
- if m != nil {
- return m.Discriminator
- }
- return ""
-}
-
-func (m *Schema) GetReadOnly() bool {
- if m != nil {
- return m.ReadOnly
- }
- return false
-}
-
-func (m *Schema) GetXml() *Xml {
- if m != nil {
- return m.Xml
- }
- return nil
-}
-
-func (m *Schema) GetExternalDocs() *ExternalDocs {
- if m != nil {
- return m.ExternalDocs
- }
- return nil
-}
-
-func (m *Schema) GetExample() *Any {
- if m != nil {
- return m.Example
- }
- return nil
-}
-
-func (m *Schema) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type SchemaItem struct {
- // Types that are valid to be assigned to Oneof:
- // *SchemaItem_Schema
- // *SchemaItem_FileSchema
- Oneof isSchemaItem_Oneof `protobuf_oneof:"oneof"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SchemaItem) Reset() { *m = SchemaItem{} }
-func (m *SchemaItem) String() string { return proto.CompactTextString(m) }
-func (*SchemaItem) ProtoMessage() {}
-func (*SchemaItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{51}
-}
-
-func (m *SchemaItem) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SchemaItem.Unmarshal(m, b)
-}
-func (m *SchemaItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SchemaItem.Marshal(b, m, deterministic)
-}
-func (m *SchemaItem) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SchemaItem.Merge(m, src)
-}
-func (m *SchemaItem) XXX_Size() int {
- return xxx_messageInfo_SchemaItem.Size(m)
-}
-func (m *SchemaItem) XXX_DiscardUnknown() {
- xxx_messageInfo_SchemaItem.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SchemaItem proto.InternalMessageInfo
-
-type isSchemaItem_Oneof interface {
- isSchemaItem_Oneof()
-}
-
-type SchemaItem_Schema struct {
- Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"`
-}
-
-type SchemaItem_FileSchema struct {
- FileSchema *FileSchema `protobuf:"bytes,2,opt,name=file_schema,json=fileSchema,proto3,oneof"`
-}
-
-func (*SchemaItem_Schema) isSchemaItem_Oneof() {}
-
-func (*SchemaItem_FileSchema) isSchemaItem_Oneof() {}
-
-func (m *SchemaItem) GetOneof() isSchemaItem_Oneof {
- if m != nil {
- return m.Oneof
- }
- return nil
-}
-
-func (m *SchemaItem) GetSchema() *Schema {
- if x, ok := m.GetOneof().(*SchemaItem_Schema); ok {
- return x.Schema
- }
- return nil
-}
-
-func (m *SchemaItem) GetFileSchema() *FileSchema {
- if x, ok := m.GetOneof().(*SchemaItem_FileSchema); ok {
- return x.FileSchema
- }
- return nil
-}
-
-// XXX_OneofWrappers is for the internal use of the proto package.
-func (*SchemaItem) XXX_OneofWrappers() []interface{} {
- return []interface{}{
- (*SchemaItem_Schema)(nil),
- (*SchemaItem_FileSchema)(nil),
- }
-}
-
-type SecurityDefinitions struct {
- AdditionalProperties []*NamedSecurityDefinitionsItem `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SecurityDefinitions) Reset() { *m = SecurityDefinitions{} }
-func (m *SecurityDefinitions) String() string { return proto.CompactTextString(m) }
-func (*SecurityDefinitions) ProtoMessage() {}
-func (*SecurityDefinitions) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{52}
-}
-
-func (m *SecurityDefinitions) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SecurityDefinitions.Unmarshal(m, b)
-}
-func (m *SecurityDefinitions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SecurityDefinitions.Marshal(b, m, deterministic)
-}
-func (m *SecurityDefinitions) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SecurityDefinitions.Merge(m, src)
-}
-func (m *SecurityDefinitions) XXX_Size() int {
- return xxx_messageInfo_SecurityDefinitions.Size(m)
-}
-func (m *SecurityDefinitions) XXX_DiscardUnknown() {
- xxx_messageInfo_SecurityDefinitions.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SecurityDefinitions proto.InternalMessageInfo
-
-func (m *SecurityDefinitions) GetAdditionalProperties() []*NamedSecurityDefinitionsItem {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-type SecurityDefinitionsItem struct {
- // Types that are valid to be assigned to Oneof:
- // *SecurityDefinitionsItem_BasicAuthenticationSecurity
- // *SecurityDefinitionsItem_ApiKeySecurity
- // *SecurityDefinitionsItem_Oauth2ImplicitSecurity
- // *SecurityDefinitionsItem_Oauth2PasswordSecurity
- // *SecurityDefinitionsItem_Oauth2ApplicationSecurity
- // *SecurityDefinitionsItem_Oauth2AccessCodeSecurity
- Oneof isSecurityDefinitionsItem_Oneof `protobuf_oneof:"oneof"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SecurityDefinitionsItem) Reset() { *m = SecurityDefinitionsItem{} }
-func (m *SecurityDefinitionsItem) String() string { return proto.CompactTextString(m) }
-func (*SecurityDefinitionsItem) ProtoMessage() {}
-func (*SecurityDefinitionsItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{53}
-}
-
-func (m *SecurityDefinitionsItem) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SecurityDefinitionsItem.Unmarshal(m, b)
-}
-func (m *SecurityDefinitionsItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SecurityDefinitionsItem.Marshal(b, m, deterministic)
-}
-func (m *SecurityDefinitionsItem) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SecurityDefinitionsItem.Merge(m, src)
-}
-func (m *SecurityDefinitionsItem) XXX_Size() int {
- return xxx_messageInfo_SecurityDefinitionsItem.Size(m)
-}
-func (m *SecurityDefinitionsItem) XXX_DiscardUnknown() {
- xxx_messageInfo_SecurityDefinitionsItem.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SecurityDefinitionsItem proto.InternalMessageInfo
-
-type isSecurityDefinitionsItem_Oneof interface {
- isSecurityDefinitionsItem_Oneof()
-}
-
-type SecurityDefinitionsItem_BasicAuthenticationSecurity struct {
- BasicAuthenticationSecurity *BasicAuthenticationSecurity `protobuf:"bytes,1,opt,name=basic_authentication_security,json=basicAuthenticationSecurity,proto3,oneof"`
-}
-
-type SecurityDefinitionsItem_ApiKeySecurity struct {
- ApiKeySecurity *ApiKeySecurity `protobuf:"bytes,2,opt,name=api_key_security,json=apiKeySecurity,proto3,oneof"`
-}
-
-type SecurityDefinitionsItem_Oauth2ImplicitSecurity struct {
- Oauth2ImplicitSecurity *Oauth2ImplicitSecurity `protobuf:"bytes,3,opt,name=oauth2_implicit_security,json=oauth2ImplicitSecurity,proto3,oneof"`
-}
-
-type SecurityDefinitionsItem_Oauth2PasswordSecurity struct {
- Oauth2PasswordSecurity *Oauth2PasswordSecurity `protobuf:"bytes,4,opt,name=oauth2_password_security,json=oauth2PasswordSecurity,proto3,oneof"`
-}
-
-type SecurityDefinitionsItem_Oauth2ApplicationSecurity struct {
- Oauth2ApplicationSecurity *Oauth2ApplicationSecurity `protobuf:"bytes,5,opt,name=oauth2_application_security,json=oauth2ApplicationSecurity,proto3,oneof"`
-}
-
-type SecurityDefinitionsItem_Oauth2AccessCodeSecurity struct {
- Oauth2AccessCodeSecurity *Oauth2AccessCodeSecurity `protobuf:"bytes,6,opt,name=oauth2_access_code_security,json=oauth2AccessCodeSecurity,proto3,oneof"`
-}
-
-func (*SecurityDefinitionsItem_BasicAuthenticationSecurity) isSecurityDefinitionsItem_Oneof() {}
-
-func (*SecurityDefinitionsItem_ApiKeySecurity) isSecurityDefinitionsItem_Oneof() {}
-
-func (*SecurityDefinitionsItem_Oauth2ImplicitSecurity) isSecurityDefinitionsItem_Oneof() {}
-
-func (*SecurityDefinitionsItem_Oauth2PasswordSecurity) isSecurityDefinitionsItem_Oneof() {}
-
-func (*SecurityDefinitionsItem_Oauth2ApplicationSecurity) isSecurityDefinitionsItem_Oneof() {}
-
-func (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity) isSecurityDefinitionsItem_Oneof() {}
-
-func (m *SecurityDefinitionsItem) GetOneof() isSecurityDefinitionsItem_Oneof {
- if m != nil {
- return m.Oneof
- }
- return nil
-}
-
-func (m *SecurityDefinitionsItem) GetBasicAuthenticationSecurity() *BasicAuthenticationSecurity {
- if x, ok := m.GetOneof().(*SecurityDefinitionsItem_BasicAuthenticationSecurity); ok {
- return x.BasicAuthenticationSecurity
- }
- return nil
-}
-
-func (m *SecurityDefinitionsItem) GetApiKeySecurity() *ApiKeySecurity {
- if x, ok := m.GetOneof().(*SecurityDefinitionsItem_ApiKeySecurity); ok {
- return x.ApiKeySecurity
- }
- return nil
-}
-
-func (m *SecurityDefinitionsItem) GetOauth2ImplicitSecurity() *Oauth2ImplicitSecurity {
- if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2ImplicitSecurity); ok {
- return x.Oauth2ImplicitSecurity
- }
- return nil
-}
-
-func (m *SecurityDefinitionsItem) GetOauth2PasswordSecurity() *Oauth2PasswordSecurity {
- if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2PasswordSecurity); ok {
- return x.Oauth2PasswordSecurity
- }
- return nil
-}
-
-func (m *SecurityDefinitionsItem) GetOauth2ApplicationSecurity() *Oauth2ApplicationSecurity {
- if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2ApplicationSecurity); ok {
- return x.Oauth2ApplicationSecurity
- }
- return nil
-}
-
-func (m *SecurityDefinitionsItem) GetOauth2AccessCodeSecurity() *Oauth2AccessCodeSecurity {
- if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2AccessCodeSecurity); ok {
- return x.Oauth2AccessCodeSecurity
- }
- return nil
-}
-
-// XXX_OneofWrappers is for the internal use of the proto package.
-func (*SecurityDefinitionsItem) XXX_OneofWrappers() []interface{} {
- return []interface{}{
- (*SecurityDefinitionsItem_BasicAuthenticationSecurity)(nil),
- (*SecurityDefinitionsItem_ApiKeySecurity)(nil),
- (*SecurityDefinitionsItem_Oauth2ImplicitSecurity)(nil),
- (*SecurityDefinitionsItem_Oauth2PasswordSecurity)(nil),
- (*SecurityDefinitionsItem_Oauth2ApplicationSecurity)(nil),
- (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity)(nil),
- }
-}
-
-type SecurityRequirement struct {
- AdditionalProperties []*NamedStringArray `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SecurityRequirement) Reset() { *m = SecurityRequirement{} }
-func (m *SecurityRequirement) String() string { return proto.CompactTextString(m) }
-func (*SecurityRequirement) ProtoMessage() {}
-func (*SecurityRequirement) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{54}
-}
-
-func (m *SecurityRequirement) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_SecurityRequirement.Unmarshal(m, b)
-}
-func (m *SecurityRequirement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_SecurityRequirement.Marshal(b, m, deterministic)
-}
-func (m *SecurityRequirement) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SecurityRequirement.Merge(m, src)
-}
-func (m *SecurityRequirement) XXX_Size() int {
- return xxx_messageInfo_SecurityRequirement.Size(m)
-}
-func (m *SecurityRequirement) XXX_DiscardUnknown() {
- xxx_messageInfo_SecurityRequirement.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SecurityRequirement proto.InternalMessageInfo
-
-func (m *SecurityRequirement) GetAdditionalProperties() []*NamedStringArray {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-type StringArray struct {
- Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *StringArray) Reset() { *m = StringArray{} }
-func (m *StringArray) String() string { return proto.CompactTextString(m) }
-func (*StringArray) ProtoMessage() {}
-func (*StringArray) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{55}
-}
-
-func (m *StringArray) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_StringArray.Unmarshal(m, b)
-}
-func (m *StringArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_StringArray.Marshal(b, m, deterministic)
-}
-func (m *StringArray) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StringArray.Merge(m, src)
-}
-func (m *StringArray) XXX_Size() int {
- return xxx_messageInfo_StringArray.Size(m)
-}
-func (m *StringArray) XXX_DiscardUnknown() {
- xxx_messageInfo_StringArray.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StringArray proto.InternalMessageInfo
-
-func (m *StringArray) GetValue() []string {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-type Tag struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
- ExternalDocs *ExternalDocs `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Tag) Reset() { *m = Tag{} }
-func (m *Tag) String() string { return proto.CompactTextString(m) }
-func (*Tag) ProtoMessage() {}
-func (*Tag) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{56}
-}
-
-func (m *Tag) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Tag.Unmarshal(m, b)
-}
-func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Tag.Marshal(b, m, deterministic)
-}
-func (m *Tag) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Tag.Merge(m, src)
-}
-func (m *Tag) XXX_Size() int {
- return xxx_messageInfo_Tag.Size(m)
-}
-func (m *Tag) XXX_DiscardUnknown() {
- xxx_messageInfo_Tag.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Tag proto.InternalMessageInfo
-
-func (m *Tag) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *Tag) GetDescription() string {
- if m != nil {
- return m.Description
- }
- return ""
-}
-
-func (m *Tag) GetExternalDocs() *ExternalDocs {
- if m != nil {
- return m.ExternalDocs
- }
- return nil
-}
-
-func (m *Tag) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-type TypeItem struct {
- Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TypeItem) Reset() { *m = TypeItem{} }
-func (m *TypeItem) String() string { return proto.CompactTextString(m) }
-func (*TypeItem) ProtoMessage() {}
-func (*TypeItem) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{57}
-}
-
-func (m *TypeItem) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_TypeItem.Unmarshal(m, b)
-}
-func (m *TypeItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_TypeItem.Marshal(b, m, deterministic)
-}
-func (m *TypeItem) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TypeItem.Merge(m, src)
-}
-func (m *TypeItem) XXX_Size() int {
- return xxx_messageInfo_TypeItem.Size(m)
-}
-func (m *TypeItem) XXX_DiscardUnknown() {
- xxx_messageInfo_TypeItem.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TypeItem proto.InternalMessageInfo
-
-func (m *TypeItem) GetValue() []string {
- if m != nil {
- return m.Value
- }
- return nil
-}
-
-// Any property starting with x- is valid.
-type VendorExtension struct {
- AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *VendorExtension) Reset() { *m = VendorExtension{} }
-func (m *VendorExtension) String() string { return proto.CompactTextString(m) }
-func (*VendorExtension) ProtoMessage() {}
-func (*VendorExtension) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{58}
-}
-
-func (m *VendorExtension) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_VendorExtension.Unmarshal(m, b)
-}
-func (m *VendorExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_VendorExtension.Marshal(b, m, deterministic)
-}
-func (m *VendorExtension) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VendorExtension.Merge(m, src)
-}
-func (m *VendorExtension) XXX_Size() int {
- return xxx_messageInfo_VendorExtension.Size(m)
-}
-func (m *VendorExtension) XXX_DiscardUnknown() {
- xxx_messageInfo_VendorExtension.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_VendorExtension proto.InternalMessageInfo
-
-func (m *VendorExtension) GetAdditionalProperties() []*NamedAny {
- if m != nil {
- return m.AdditionalProperties
- }
- return nil
-}
-
-type Xml struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
- Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"`
- Attribute bool `protobuf:"varint,4,opt,name=attribute,proto3" json:"attribute,omitempty"`
- Wrapped bool `protobuf:"varint,5,opt,name=wrapped,proto3" json:"wrapped,omitempty"`
- VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Xml) Reset() { *m = Xml{} }
-func (m *Xml) String() string { return proto.CompactTextString(m) }
-func (*Xml) ProtoMessage() {}
-func (*Xml) Descriptor() ([]byte, []int) {
- return fileDescriptor_a43d10d209cd31c2, []int{59}
-}
-
-func (m *Xml) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Xml.Unmarshal(m, b)
-}
-func (m *Xml) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Xml.Marshal(b, m, deterministic)
-}
-func (m *Xml) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Xml.Merge(m, src)
-}
-func (m *Xml) XXX_Size() int {
- return xxx_messageInfo_Xml.Size(m)
-}
-func (m *Xml) XXX_DiscardUnknown() {
- xxx_messageInfo_Xml.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Xml proto.InternalMessageInfo
-
-func (m *Xml) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-func (m *Xml) GetNamespace() string {
- if m != nil {
- return m.Namespace
- }
- return ""
-}
-
-func (m *Xml) GetPrefix() string {
- if m != nil {
- return m.Prefix
- }
- return ""
-}
-
-func (m *Xml) GetAttribute() bool {
- if m != nil {
- return m.Attribute
- }
- return false
-}
-
-func (m *Xml) GetWrapped() bool {
- if m != nil {
- return m.Wrapped
- }
- return false
-}
-
-func (m *Xml) GetVendorExtension() []*NamedAny {
- if m != nil {
- return m.VendorExtension
- }
- return nil
-}
-
-func init() {
- proto.RegisterType((*AdditionalPropertiesItem)(nil), "openapi.v2.AdditionalPropertiesItem")
- proto.RegisterType((*Any)(nil), "openapi.v2.Any")
- proto.RegisterType((*ApiKeySecurity)(nil), "openapi.v2.ApiKeySecurity")
- proto.RegisterType((*BasicAuthenticationSecurity)(nil), "openapi.v2.BasicAuthenticationSecurity")
- proto.RegisterType((*BodyParameter)(nil), "openapi.v2.BodyParameter")
- proto.RegisterType((*Contact)(nil), "openapi.v2.Contact")
- proto.RegisterType((*Default)(nil), "openapi.v2.Default")
- proto.RegisterType((*Definitions)(nil), "openapi.v2.Definitions")
- proto.RegisterType((*Document)(nil), "openapi.v2.Document")
- proto.RegisterType((*Examples)(nil), "openapi.v2.Examples")
- proto.RegisterType((*ExternalDocs)(nil), "openapi.v2.ExternalDocs")
- proto.RegisterType((*FileSchema)(nil), "openapi.v2.FileSchema")
- proto.RegisterType((*FormDataParameterSubSchema)(nil), "openapi.v2.FormDataParameterSubSchema")
- proto.RegisterType((*Header)(nil), "openapi.v2.Header")
- proto.RegisterType((*HeaderParameterSubSchema)(nil), "openapi.v2.HeaderParameterSubSchema")
- proto.RegisterType((*Headers)(nil), "openapi.v2.Headers")
- proto.RegisterType((*Info)(nil), "openapi.v2.Info")
- proto.RegisterType((*ItemsItem)(nil), "openapi.v2.ItemsItem")
- proto.RegisterType((*JsonReference)(nil), "openapi.v2.JsonReference")
- proto.RegisterType((*License)(nil), "openapi.v2.License")
- proto.RegisterType((*NamedAny)(nil), "openapi.v2.NamedAny")
- proto.RegisterType((*NamedHeader)(nil), "openapi.v2.NamedHeader")
- proto.RegisterType((*NamedParameter)(nil), "openapi.v2.NamedParameter")
- proto.RegisterType((*NamedPathItem)(nil), "openapi.v2.NamedPathItem")
- proto.RegisterType((*NamedResponse)(nil), "openapi.v2.NamedResponse")
- proto.RegisterType((*NamedResponseValue)(nil), "openapi.v2.NamedResponseValue")
- proto.RegisterType((*NamedSchema)(nil), "openapi.v2.NamedSchema")
- proto.RegisterType((*NamedSecurityDefinitionsItem)(nil), "openapi.v2.NamedSecurityDefinitionsItem")
- proto.RegisterType((*NamedString)(nil), "openapi.v2.NamedString")
- proto.RegisterType((*NamedStringArray)(nil), "openapi.v2.NamedStringArray")
- proto.RegisterType((*NonBodyParameter)(nil), "openapi.v2.NonBodyParameter")
- proto.RegisterType((*Oauth2AccessCodeSecurity)(nil), "openapi.v2.Oauth2AccessCodeSecurity")
- proto.RegisterType((*Oauth2ApplicationSecurity)(nil), "openapi.v2.Oauth2ApplicationSecurity")
- proto.RegisterType((*Oauth2ImplicitSecurity)(nil), "openapi.v2.Oauth2ImplicitSecurity")
- proto.RegisterType((*Oauth2PasswordSecurity)(nil), "openapi.v2.Oauth2PasswordSecurity")
- proto.RegisterType((*Oauth2Scopes)(nil), "openapi.v2.Oauth2Scopes")
- proto.RegisterType((*Operation)(nil), "openapi.v2.Operation")
- proto.RegisterType((*Parameter)(nil), "openapi.v2.Parameter")
- proto.RegisterType((*ParameterDefinitions)(nil), "openapi.v2.ParameterDefinitions")
- proto.RegisterType((*ParametersItem)(nil), "openapi.v2.ParametersItem")
- proto.RegisterType((*PathItem)(nil), "openapi.v2.PathItem")
- proto.RegisterType((*PathParameterSubSchema)(nil), "openapi.v2.PathParameterSubSchema")
- proto.RegisterType((*Paths)(nil), "openapi.v2.Paths")
- proto.RegisterType((*PrimitivesItems)(nil), "openapi.v2.PrimitivesItems")
- proto.RegisterType((*Properties)(nil), "openapi.v2.Properties")
- proto.RegisterType((*QueryParameterSubSchema)(nil), "openapi.v2.QueryParameterSubSchema")
- proto.RegisterType((*Response)(nil), "openapi.v2.Response")
- proto.RegisterType((*ResponseDefinitions)(nil), "openapi.v2.ResponseDefinitions")
- proto.RegisterType((*ResponseValue)(nil), "openapi.v2.ResponseValue")
- proto.RegisterType((*Responses)(nil), "openapi.v2.Responses")
- proto.RegisterType((*Schema)(nil), "openapi.v2.Schema")
- proto.RegisterType((*SchemaItem)(nil), "openapi.v2.SchemaItem")
- proto.RegisterType((*SecurityDefinitions)(nil), "openapi.v2.SecurityDefinitions")
- proto.RegisterType((*SecurityDefinitionsItem)(nil), "openapi.v2.SecurityDefinitionsItem")
- proto.RegisterType((*SecurityRequirement)(nil), "openapi.v2.SecurityRequirement")
- proto.RegisterType((*StringArray)(nil), "openapi.v2.StringArray")
- proto.RegisterType((*Tag)(nil), "openapi.v2.Tag")
- proto.RegisterType((*TypeItem)(nil), "openapi.v2.TypeItem")
- proto.RegisterType((*VendorExtension)(nil), "openapi.v2.VendorExtension")
- proto.RegisterType((*Xml)(nil), "openapi.v2.Xml")
-}
-
-func init() { proto.RegisterFile("openapiv2/OpenAPIv2.proto", fileDescriptor_a43d10d209cd31c2) }
-
-var fileDescriptor_a43d10d209cd31c2 = []byte{
- // 3130 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x3b, 0x4b, 0x73, 0x1c, 0x57,
- 0xd5, 0xf3, 0x7e, 0x1c, 0x69, 0x46, 0xa3, 0x96, 0x2c, 0xb7, 0x24, 0xc7, 0x71, 0xe4, 0x3c, 0x6c,
- 0xe7, 0xb3, 0x9c, 0x4f, 0x29, 0x48, 0x05, 0x2a, 0x05, 0xf2, 0xab, 0xc6, 0xc4, 0x44, 0x4a, 0xcb,
- 0x0e, 0x09, 0x04, 0xba, 0xae, 0x66, 0xee, 0x48, 0x9d, 0x74, 0xf7, 0x6d, 0x77, 0xf7, 0xc8, 0x1a,
- 0x16, 0x2c, 0xa0, 0x8a, 0x35, 0x50, 0x59, 0x53, 0x15, 0x16, 0x14, 0x55, 0x59, 0xb0, 0x62, 0xc5,
- 0x1f, 0x60, 0xc7, 0x3f, 0x60, 0x0d, 0x5b, 0xaa, 0x58, 0x51, 0x3c, 0xea, 0xbe, 0xa6, 0x5f, 0xb7,
- 0xe7, 0x61, 0xb9, 0x80, 0x02, 0xad, 0x66, 0xee, 0x3d, 0xe7, 0x9e, 0x7b, 0xfa, 0xf4, 0x79, 0xdd,
- 0x73, 0x6e, 0xc3, 0x3a, 0xf1, 0xb0, 0x8b, 0x3c, 0xeb, 0x64, 0xe7, 0xd6, 0x9e, 0x87, 0xdd, 0xdd,
- 0xfd, 0x07, 0x27, 0x3b, 0xdb, 0x9e, 0x4f, 0x42, 0xa2, 0x81, 0x00, 0x6d, 0x9f, 0xec, 0x6c, 0xac,
- 0x1f, 0x11, 0x72, 0x64, 0xe3, 0x5b, 0x0c, 0x72, 0x38, 0x1c, 0xdc, 0x42, 0xee, 0x88, 0xa3, 0x6d,
- 0x39, 0xa0, 0xef, 0xf6, 0xfb, 0x56, 0x68, 0x11, 0x17, 0xd9, 0xfb, 0x3e, 0xf1, 0xb0, 0x1f, 0x5a,
- 0x38, 0x78, 0x10, 0x62, 0x47, 0xfb, 0x3f, 0xa8, 0x05, 0xbd, 0x63, 0xec, 0x20, 0xbd, 0x78, 0xa5,
- 0x78, 0x6d, 0x61, 0x47, 0xdb, 0x8e, 0x68, 0x6e, 0x1f, 0x30, 0x48, 0xb7, 0x60, 0x08, 0x1c, 0x6d,
- 0x03, 0xea, 0x87, 0x84, 0xd8, 0x18, 0xb9, 0x7a, 0xe9, 0x4a, 0xf1, 0x5a, 0xa3, 0x5b, 0x30, 0xe4,
- 0xc4, 0xed, 0x3a, 0x54, 0x89, 0x8b, 0xc9, 0x60, 0xeb, 0x1e, 0x94, 0x77, 0xdd, 0x91, 0x76, 0x03,
- 0xaa, 0x27, 0xc8, 0x1e, 0x62, 0x41, 0x78, 0x75, 0x9b, 0x33, 0xb8, 0x2d, 0x19, 0xdc, 0xde, 0x75,
- 0x47, 0x06, 0x47, 0xd1, 0x34, 0xa8, 0x8c, 0x90, 0x63, 0x33, 0xa2, 0x4d, 0x83, 0xfd, 0xdf, 0xfa,
- 0xa2, 0x08, 0xed, 0x5d, 0xcf, 0x7a, 0x17, 0x8f, 0x0e, 0x70, 0x6f, 0xe8, 0x5b, 0xe1, 0x88, 0xa2,
- 0x85, 0x23, 0x8f, 0x53, 0x6c, 0x1a, 0xec, 0x3f, 0x9d, 0x73, 0x91, 0x83, 0xe5, 0x52, 0xfa, 0x5f,
- 0x6b, 0x43, 0xc9, 0x72, 0xf5, 0x32, 0x9b, 0x29, 0x59, 0xae, 0x76, 0x05, 0x16, 0xfa, 0x38, 0xe8,
- 0xf9, 0x96, 0x47, 0x65, 0xa0, 0x57, 0x18, 0x20, 0x3e, 0xa5, 0x7d, 0x0d, 0x3a, 0x27, 0xd8, 0xed,
- 0x13, 0xdf, 0xc4, 0xa7, 0x21, 0x76, 0x03, 0x8a, 0x56, 0xbd, 0x52, 0x66, 0x7c, 0xc7, 0x04, 0xf2,
- 0x1e, 0x72, 0x70, 0x9f, 0xf2, 0xbd, 0xc4, 0xb1, 0xef, 0x49, 0xe4, 0xad, 0xcf, 0x8a, 0xb0, 0x79,
- 0x1b, 0x05, 0x56, 0x6f, 0x77, 0x18, 0x1e, 0x63, 0x37, 0xb4, 0x7a, 0x88, 0x12, 0x9e, 0xc8, 0x7a,
- 0x8a, 0xad, 0xd2, 0x6c, 0x6c, 0x95, 0xe7, 0x61, 0xeb, 0x0f, 0x45, 0x68, 0xdd, 0x26, 0xfd, 0xd1,
- 0x3e, 0xf2, 0x91, 0x83, 0x43, 0xec, 0xa7, 0x37, 0x2d, 0x66, 0x37, 0x9d, 0x45, 0xa2, 0x1b, 0xd0,
- 0xf0, 0xf1, 0x93, 0xa1, 0xe5, 0xe3, 0x3e, 0x13, 0x67, 0xc3, 0x18, 0x8f, 0xb5, 0x1b, 0x63, 0x95,
- 0xaa, 0xe6, 0xa9, 0xd4, 0x58, 0xa1, 0x54, 0x0f, 0x58, 0x9b, 0xe7, 0x01, 0x7f, 0x5c, 0x84, 0xfa,
- 0x1d, 0xe2, 0x86, 0xa8, 0x17, 0x8e, 0x19, 0x2f, 0xc6, 0x18, 0xef, 0x40, 0x79, 0xe8, 0x4b, 0xc5,
- 0xa2, 0x7f, 0xb5, 0x55, 0xa8, 0x62, 0x07, 0x59, 0xb6, 0x78, 0x1a, 0x3e, 0x50, 0x32, 0x52, 0x99,
- 0x87, 0x91, 0x47, 0x50, 0xbf, 0x8b, 0x07, 0x68, 0x68, 0x87, 0xda, 0x03, 0xb8, 0x80, 0xc6, 0xf6,
- 0x66, 0x7a, 0x63, 0x83, 0xd3, 0x8b, 0x13, 0x08, 0xae, 0x22, 0x85, 0x89, 0x6e, 0x7d, 0x07, 0x16,
- 0xee, 0xe2, 0x81, 0xe5, 0x32, 0x48, 0xa0, 0x3d, 0x9c, 0x4c, 0xf9, 0x62, 0x86, 0xb2, 0x10, 0xb7,
- 0x9a, 0xf8, 0x1f, 0xab, 0xd0, 0xb8, 0x4b, 0x7a, 0x43, 0x07, 0xbb, 0xa1, 0xa6, 0x43, 0x3d, 0x78,
- 0x8a, 0x8e, 0x8e, 0xb0, 0x2f, 0xe4, 0x27, 0x87, 0xda, 0xcb, 0x50, 0xb1, 0xdc, 0x01, 0x61, 0x32,
- 0x5c, 0xd8, 0xe9, 0xc4, 0xf7, 0x78, 0xe0, 0x0e, 0x88, 0xc1, 0xa0, 0x54, 0xf8, 0xc7, 0x24, 0x08,
- 0x85, 0x54, 0xd9, 0x7f, 0x6d, 0x13, 0x9a, 0x87, 0x28, 0xc0, 0xa6, 0x87, 0xc2, 0x63, 0x61, 0x75,
- 0x0d, 0x3a, 0xb1, 0x8f, 0xc2, 0x63, 0xb6, 0x21, 0xe5, 0x0e, 0x07, 0xcc, 0xd2, 0xe8, 0x86, 0x7c,
- 0x48, 0x95, 0xab, 0x47, 0xdc, 0x60, 0x48, 0x41, 0x35, 0x06, 0x1a, 0x8f, 0x29, 0xcc, 0xf3, 0x49,
- 0x7f, 0xd8, 0xc3, 0x81, 0x5e, 0xe7, 0x30, 0x39, 0xd6, 0x5e, 0x83, 0x2a, 0xdd, 0x29, 0xd0, 0x1b,
- 0x8c, 0xd3, 0xe5, 0x38, 0xa7, 0x74, 0xcb, 0xc0, 0xe0, 0x70, 0xed, 0x6d, 0x6a, 0x03, 0x63, 0xa9,
- 0xea, 0x4d, 0x86, 0x9e, 0x10, 0x5e, 0x4c, 0xe8, 0x46, 0x1c, 0x57, 0xfb, 0x3a, 0x80, 0x27, 0x6d,
- 0x29, 0xd0, 0x81, 0xad, 0xbc, 0x92, 0xdc, 0x48, 0x40, 0xe3, 0x24, 0x62, 0x6b, 0xb4, 0x77, 0xa0,
- 0xe9, 0xe3, 0xc0, 0x23, 0x6e, 0x80, 0x03, 0x7d, 0x81, 0x11, 0x78, 0x31, 0x4e, 0xc0, 0x10, 0xc0,
- 0xf8, 0xfa, 0x68, 0x85, 0xf6, 0x55, 0x68, 0x04, 0xc2, 0xa9, 0xe8, 0x8b, 0xec, 0xad, 0x27, 0x56,
- 0x4b, 0x87, 0x63, 0x70, 0x6b, 0xa4, 0xaf, 0xd6, 0x18, 0x2f, 0xd0, 0x0c, 0x58, 0x95, 0xff, 0xcd,
- 0xb8, 0x04, 0x5a, 0x59, 0x36, 0x24, 0xa1, 0x38, 0x1b, 0x2b, 0x41, 0x76, 0x52, 0xbb, 0x0a, 0x95,
- 0x10, 0x1d, 0x05, 0x7a, 0x9b, 0x31, 0xb3, 0x14, 0xa7, 0xf1, 0x08, 0x1d, 0x19, 0x0c, 0xa8, 0xbd,
- 0x03, 0x2d, 0x6a, 0x57, 0x3e, 0x55, 0xdb, 0x3e, 0xe9, 0x05, 0xfa, 0x12, 0xdb, 0x51, 0x8f, 0x63,
- 0xdf, 0x13, 0x08, 0x77, 0x49, 0x2f, 0x30, 0x16, 0x71, 0x6c, 0xa4, 0xb4, 0xce, 0xce, 0x3c, 0xd6,
- 0xf9, 0x18, 0x1a, 0xf7, 0x4e, 0x91, 0xe3, 0xd9, 0x38, 0x78, 0x9e, 0xe6, 0xf9, 0xa3, 0x22, 0x2c,
- 0xc6, 0xd9, 0x9e, 0xc1, 0xbb, 0x66, 0x1d, 0xd2, 0x99, 0x9d, 0xfc, 0x3f, 0x4a, 0x00, 0xf7, 0x2d,
- 0x1b, 0x73, 0x63, 0xd7, 0xd6, 0xa0, 0x36, 0x20, 0xbe, 0x83, 0x42, 0xb1, 0xbd, 0x18, 0x51, 0xc7,
- 0x17, 0x5a, 0xa1, 0x2d, 0x1d, 0x3b, 0x1f, 0xa4, 0x39, 0x2e, 0x67, 0x39, 0xbe, 0x0e, 0xf5, 0x3e,
- 0xf7, 0x6c, 0xcc, 0x86, 0x53, 0xef, 0x98, 0x72, 0x24, 0xe1, 0x89, 0xb0, 0xc0, 0x8d, 0x3a, 0x0a,
- 0x0b, 0x32, 0x02, 0xd6, 0x62, 0x11, 0x70, 0x93, 0xda, 0x02, 0xea, 0x9b, 0xc4, 0xb5, 0x47, 0x7a,
- 0x5d, 0xc6, 0x11, 0xd4, 0xdf, 0x73, 0xed, 0x51, 0x56, 0x67, 0x1a, 0x73, 0xe9, 0xcc, 0x75, 0xa8,
- 0x63, 0xfe, 0xca, 0x85, 0x81, 0x67, 0xd9, 0x16, 0x70, 0xe5, 0x1b, 0x80, 0x79, 0xde, 0xc0, 0x17,
- 0x35, 0xd8, 0xb8, 0x4f, 0x7c, 0xe7, 0x2e, 0x0a, 0xd1, 0xd8, 0x01, 0x1c, 0x0c, 0x0f, 0x0f, 0x64,
- 0xda, 0x14, 0x89, 0xa5, 0x98, 0x8a, 0x96, 0x3c, 0xb2, 0x96, 0xf2, 0x72, 0x95, 0x72, 0x7e, 0x7c,
- 0xae, 0xc4, 0xc2, 0xdc, 0x0d, 0x58, 0x46, 0xb6, 0x4d, 0x9e, 0x9a, 0xd8, 0xf1, 0xc2, 0x91, 0xc9,
- 0x13, 0xaf, 0x2a, 0xdb, 0x6a, 0x89, 0x01, 0xee, 0xd1, 0xf9, 0x0f, 0x64, 0xb2, 0x95, 0x79, 0x11,
- 0x91, 0xce, 0xd4, 0x13, 0x3a, 0xf3, 0xff, 0x50, 0xb5, 0x42, 0xec, 0x48, 0xd9, 0x6f, 0x26, 0x3c,
- 0x9d, 0x6f, 0x39, 0x56, 0x68, 0x9d, 0xf0, 0x4c, 0x32, 0x30, 0x38, 0xa6, 0xf6, 0x3a, 0x2c, 0xf7,
- 0x88, 0x6d, 0xe3, 0x1e, 0x65, 0xd6, 0x14, 0x54, 0x9b, 0x8c, 0x6a, 0x27, 0x02, 0xdc, 0xe7, 0xf4,
- 0x63, 0xba, 0x05, 0x53, 0x74, 0x4b, 0x87, 0xba, 0x83, 0x4e, 0x2d, 0x67, 0xe8, 0x30, 0xaf, 0x59,
- 0x34, 0xe4, 0x90, 0xee, 0x88, 0x4f, 0x7b, 0xf6, 0x30, 0xb0, 0x4e, 0xb0, 0x29, 0x71, 0x16, 0xd9,
- 0xc3, 0x77, 0xc6, 0x80, 0x6f, 0x0a, 0x64, 0x4a, 0xc6, 0x72, 0x19, 0x4a, 0x4b, 0x90, 0xe1, 0xc3,
- 0x14, 0x19, 0x81, 0xd3, 0x4e, 0x93, 0x11, 0xc8, 0x2f, 0x00, 0x38, 0xe8, 0xd4, 0xb4, 0xb1, 0x7b,
- 0x14, 0x1e, 0x33, 0x6f, 0x56, 0x36, 0x9a, 0x0e, 0x3a, 0x7d, 0xc8, 0x26, 0x18, 0xd8, 0x72, 0x25,
- 0xb8, 0x23, 0xc0, 0x96, 0x2b, 0xc0, 0x3a, 0xd4, 0x3d, 0x14, 0x52, 0x65, 0xd5, 0x97, 0x79, 0xb0,
- 0x15, 0x43, 0x6a, 0x11, 0x94, 0x2e, 0x17, 0xba, 0xc6, 0xd6, 0x35, 0x1c, 0x74, 0xca, 0x24, 0xcc,
- 0x80, 0x96, 0x2b, 0x80, 0x2b, 0x02, 0x68, 0xb9, 0x1c, 0xf8, 0x12, 0x2c, 0x0e, 0x5d, 0xeb, 0xc9,
- 0x10, 0x0b, 0xf8, 0x2a, 0xe3, 0x7c, 0x81, 0xcf, 0x71, 0x94, 0xab, 0x50, 0xc1, 0xee, 0xd0, 0xd1,
- 0x2f, 0x64, 0x5d, 0x35, 0x15, 0x35, 0x03, 0x6a, 0x2f, 0xc2, 0x82, 0x33, 0xb4, 0x43, 0xcb, 0xb3,
- 0xb1, 0x49, 0x06, 0xfa, 0x1a, 0x13, 0x12, 0xc8, 0xa9, 0xbd, 0x81, 0xd2, 0x5a, 0x2e, 0xce, 0x65,
- 0x2d, 0x55, 0xa8, 0x75, 0x31, 0xea, 0x63, 0x5f, 0x99, 0x16, 0x47, 0xba, 0x58, 0x52, 0xeb, 0x62,
- 0xf9, 0x6c, 0xba, 0x58, 0x99, 0xae, 0x8b, 0xd5, 0xd9, 0x75, 0xb1, 0x36, 0x83, 0x2e, 0xd6, 0xa7,
- 0xeb, 0x62, 0x63, 0x06, 0x5d, 0x6c, 0xce, 0xa4, 0x8b, 0x30, 0x59, 0x17, 0x17, 0x26, 0xe8, 0xe2,
- 0xe2, 0x04, 0x5d, 0x6c, 0x4d, 0xd2, 0xc5, 0xf6, 0x14, 0x5d, 0x5c, 0xca, 0xd7, 0xc5, 0xce, 0x1c,
- 0xba, 0xb8, 0x9c, 0xd1, 0xc5, 0x94, 0xb7, 0xd4, 0x66, 0x3b, 0x42, 0xad, 0xcc, 0xa3, 0xad, 0x7f,
- 0xab, 0x82, 0xce, 0xb5, 0xf5, 0xdf, 0xe2, 0xd9, 0xa5, 0x85, 0x54, 0x95, 0x16, 0x52, 0x53, 0x5b,
- 0x48, 0xfd, 0x6c, 0x16, 0xd2, 0x98, 0x6e, 0x21, 0xcd, 0xd9, 0x2d, 0x04, 0x66, 0xb0, 0x90, 0x85,
- 0xe9, 0x16, 0xb2, 0x38, 0x83, 0x85, 0xb4, 0x66, 0xb2, 0x90, 0xf6, 0x64, 0x0b, 0x59, 0x9a, 0x60,
- 0x21, 0x9d, 0x09, 0x16, 0xb2, 0x3c, 0xc9, 0x42, 0xb4, 0x29, 0x16, 0xb2, 0x92, 0x6f, 0x21, 0xab,
- 0x73, 0x58, 0xc8, 0x85, 0x99, 0xbc, 0xf5, 0xda, 0x3c, 0xfa, 0xff, 0x2d, 0xa8, 0x73, 0xf5, 0x7f,
- 0x86, 0xe3, 0x27, 0x5f, 0x98, 0x93, 0x3c, 0x7f, 0x5e, 0x82, 0x0a, 0x3d, 0x40, 0x46, 0x89, 0x69,
- 0x31, 0x9e, 0x98, 0xea, 0x50, 0x3f, 0xc1, 0x7e, 0x10, 0x55, 0x46, 0xe4, 0x70, 0x06, 0x43, 0xba,
- 0x06, 0x9d, 0x10, 0xfb, 0x4e, 0x60, 0x92, 0x81, 0x19, 0x60, 0xff, 0xc4, 0xea, 0x49, 0xa3, 0x6a,
- 0xb3, 0xf9, 0xbd, 0xc1, 0x01, 0x9f, 0xd5, 0x6e, 0x42, 0xbd, 0xc7, 0xcb, 0x07, 0xc2, 0xe9, 0xaf,
- 0xc4, 0x1f, 0x42, 0x54, 0x16, 0x0c, 0x89, 0x43, 0xd1, 0x6d, 0xab, 0x87, 0xdd, 0x80, 0xa7, 0x4f,
- 0x29, 0xf4, 0x87, 0x1c, 0x64, 0x48, 0x1c, 0xa5, 0xf0, 0xeb, 0xf3, 0x08, 0xff, 0x2d, 0x68, 0x32,
- 0x65, 0x60, 0xb5, 0xba, 0x1b, 0xb1, 0x5a, 0x5d, 0x79, 0x72, 0x61, 0x65, 0xeb, 0x2e, 0xb4, 0xbe,
- 0x11, 0x10, 0xd7, 0xc0, 0x03, 0xec, 0x63, 0xb7, 0x87, 0xb5, 0x65, 0xa8, 0x98, 0x3e, 0x1e, 0x08,
- 0x19, 0x97, 0x0d, 0x3c, 0x98, 0x5e, 0x7f, 0xda, 0xf2, 0xa0, 0x2e, 0x9e, 0x69, 0xc6, 0xe2, 0xca,
- 0x99, 0xcf, 0x32, 0xf7, 0xa0, 0x21, 0x81, 0xca, 0x2d, 0x5f, 0x91, 0x55, 0xc5, 0x92, 0xda, 0x01,
- 0x71, 0xe8, 0xd6, 0xbb, 0xb0, 0x10, 0x53, 0x40, 0x25, 0xa5, 0x6b, 0x49, 0x4a, 0x09, 0x61, 0x0a,
- 0xbd, 0x15, 0xc4, 0xde, 0x87, 0x36, 0x23, 0x16, 0x15, 0xd1, 0x54, 0xf4, 0x5e, 0x4f, 0xd2, 0xbb,
- 0xa0, 0x2c, 0x0a, 0x48, 0x92, 0x7b, 0xd0, 0x12, 0x24, 0xc3, 0x63, 0xf6, 0x6e, 0x55, 0x14, 0x6f,
- 0x24, 0x29, 0xae, 0xa6, 0xeb, 0x19, 0x74, 0x61, 0x9a, 0xa0, 0xac, 0x1e, 0xcc, 0x4d, 0x50, 0x2e,
- 0x94, 0x04, 0x3f, 0x02, 0x2d, 0x41, 0x70, 0x7c, 0x76, 0xc8, 0x50, 0xbd, 0x95, 0xa4, 0xba, 0xae,
- 0xa2, 0xca, 0x56, 0xa7, 0x5f, 0x8e, 0x88, 0xa1, 0xf3, 0xbe, 0x1c, 0xa1, 0xe9, 0x82, 0x98, 0x03,
- 0x97, 0x38, 0xb1, 0x6c, 0x69, 0x22, 0x57, 0xb0, 0x6f, 0x27, 0xa9, 0x5f, 0x9d, 0x52, 0xf7, 0x88,
- 0xcb, 0xf9, 0x2d, 0xc9, 0x7b, 0xe8, 0x5b, 0xee, 0x91, 0x92, 0xfa, 0x6a, 0x9c, 0x7a, 0x53, 0x2e,
- 0x7c, 0x0c, 0x9d, 0xd8, 0xc2, 0x5d, 0xdf, 0x47, 0x6a, 0x05, 0xbf, 0x99, 0xe4, 0x2d, 0xe1, 0x53,
- 0x63, 0x6b, 0x25, 0xd9, 0xdf, 0x94, 0xa1, 0xf3, 0x1e, 0x71, 0x93, 0x35, 0x5e, 0x0c, 0x9b, 0xc7,
- 0x4c, 0x83, 0xcd, 0x71, 0xdd, 0xc9, 0x0c, 0x86, 0x87, 0x66, 0xa2, 0xd2, 0xff, 0x72, 0x56, 0xe1,
- 0xb3, 0x09, 0x4e, 0xb7, 0x60, 0xe8, 0xc7, 0x79, 0xc9, 0x8f, 0x0d, 0x97, 0x69, 0xc2, 0x60, 0xf6,
- 0x51, 0x88, 0xd4, 0x3b, 0xf1, 0x67, 0x78, 0x35, 0xbe, 0x53, 0xfe, 0x31, 0xb9, 0x5b, 0x30, 0x36,
- 0x06, 0xf9, 0x87, 0xe8, 0x43, 0xd8, 0x78, 0x32, 0xc4, 0xfe, 0x48, 0xbd, 0x53, 0x39, 0xfb, 0x26,
- 0xdf, 0xa7, 0xd8, 0xca, 0x6d, 0x2e, 0x3e, 0x51, 0x83, 0x34, 0x13, 0xd6, 0x3d, 0x14, 0x1e, 0xab,
- 0xb7, 0xe0, 0xc5, 0x8f, 0xad, 0xb4, 0x15, 0x2a, 0x77, 0x58, 0xf3, 0x94, 0x90, 0xa8, 0x49, 0xf2,
- 0x79, 0x09, 0xf4, 0x3d, 0x34, 0x0c, 0x8f, 0x77, 0x76, 0x7b, 0x3d, 0x1c, 0x04, 0x77, 0x48, 0x1f,
- 0x4f, 0xeb, 0x73, 0x0c, 0x6c, 0xf2, 0x54, 0x56, 0xe5, 0xe9, 0x7f, 0xed, 0x0d, 0x1a, 0x10, 0x88,
- 0x87, 0xe5, 0x91, 0x28, 0x51, 0x1a, 0xe1, 0xd4, 0x0f, 0x18, 0xdc, 0x10, 0x78, 0x34, 0x6b, 0xa2,
- 0xd3, 0xc4, 0xb7, 0xbe, 0xcf, 0xfa, 0x13, 0x26, 0xf5, 0xdf, 0xe2, 0x40, 0x94, 0x00, 0x3c, 0xf6,
- 0x6d, 0x9a, 0xc0, 0x84, 0xe4, 0x53, 0xcc, 0x91, 0x78, 0xfe, 0xd9, 0x60, 0x13, 0x14, 0x98, 0x0a,
- 0x1e, 0xb5, 0xd9, 0x32, 0xef, 0xb9, 0x82, 0xdf, 0x5f, 0x8a, 0xb0, 0x2e, 0x64, 0xe4, 0x79, 0xf6,
- 0x2c, 0x1d, 0x95, 0xe7, 0x23, 0xa4, 0xc4, 0x73, 0x57, 0x26, 0x3f, 0x77, 0x75, 0xb6, 0xe7, 0x9e,
- 0xab, 0xa7, 0xf1, 0xc3, 0x12, 0xac, 0x71, 0xc6, 0x1e, 0x38, 0xf4, 0xb9, 0xad, 0xf0, 0x3f, 0x4d,
- 0x33, 0xfe, 0x05, 0x42, 0xf8, 0x73, 0x51, 0x0a, 0x61, 0x1f, 0x05, 0xc1, 0x53, 0xe2, 0xf7, 0xff,
- 0x07, 0xde, 0xfc, 0xc7, 0xb0, 0x18, 0xe7, 0xeb, 0x19, 0xfa, 0x3d, 0x2c, 0x42, 0xe4, 0x24, 0xdc,
- 0x3f, 0xaf, 0x40, 0x73, 0xcf, 0xc3, 0x3e, 0x92, 0x87, 0x4d, 0x56, 0xb7, 0x2f, 0xb2, 0x3a, 0x2d,
- 0x2f, 0xd3, 0xeb, 0x50, 0x0f, 0x86, 0x8e, 0x83, 0xfc, 0x91, 0xcc, 0xb9, 0xc5, 0x70, 0x86, 0x9c,
- 0x3b, 0x53, 0xae, 0xad, 0xcc, 0x55, 0xae, 0x7d, 0x09, 0x16, 0x89, 0xe4, 0xcd, 0xb4, 0xfa, 0x52,
- 0xbc, 0xe3, 0xb9, 0x07, 0xfd, 0x44, 0xef, 0xa7, 0x96, 0xea, 0xfd, 0xc4, 0x7b, 0x46, 0xf5, 0x54,
- 0xcf, 0xe8, 0x2b, 0x89, 0x9e, 0x4d, 0x83, 0x89, 0x6e, 0x43, 0x99, 0x9e, 0xf1, 0x50, 0x1f, 0xef,
- 0xd6, 0xbc, 0x19, 0xef, 0xd6, 0x34, 0xb3, 0x99, 0x9d, 0x4c, 0x70, 0x12, 0x3d, 0x9a, 0x58, 0x6b,
- 0x0b, 0x92, 0xad, 0xad, 0xcb, 0x00, 0x7d, 0xec, 0xf9, 0xb8, 0x87, 0x42, 0xdc, 0x17, 0xa7, 0xde,
- 0xd8, 0xcc, 0xd9, 0xba, 0x3b, 0x2a, 0xf5, 0x6b, 0xcd, 0xa3, 0x7e, 0xbf, 0x2c, 0x42, 0x33, 0xca,
- 0x22, 0x6e, 0x43, 0xfb, 0x90, 0xf4, 0x63, 0xf1, 0x56, 0x24, 0x0e, 0x89, 0x04, 0x2f, 0x91, 0x78,
- 0x74, 0x0b, 0x46, 0xeb, 0x30, 0x91, 0x89, 0x3c, 0x04, 0xcd, 0x25, 0xae, 0x99, 0xa2, 0xc3, 0xd3,
- 0x82, 0x4b, 0x09, 0xa6, 0x52, 0x39, 0x4c, 0xb7, 0x60, 0x74, 0xdc, 0xd4, 0x5c, 0x14, 0x3d, 0x8f,
- 0x60, 0x55, 0xd5, 0x67, 0xd3, 0xf6, 0x26, 0xdb, 0xcb, 0x46, 0x46, 0x0c, 0x51, 0x62, 0xae, 0x36,
- 0x99, 0xcf, 0x8a, 0xd0, 0x4e, 0x6a, 0x87, 0xf6, 0x25, 0x68, 0xa6, 0x25, 0xa2, 0xce, 0xf5, 0xbb,
- 0x05, 0x23, 0xc2, 0xa4, 0xd2, 0xfc, 0x24, 0x20, 0x2e, 0x3d, 0x83, 0xf1, 0x13, 0x99, 0x2a, 0x5d,
- 0x4e, 0x1c, 0xd9, 0xa8, 0x34, 0x3f, 0x89, 0x4f, 0x44, 0xcf, 0xff, 0xfb, 0x32, 0x34, 0xc6, 0x47,
- 0x07, 0xc5, 0xc9, 0xee, 0x35, 0x28, 0x1f, 0xe1, 0x50, 0x75, 0x12, 0x19, 0xdb, 0xbf, 0x41, 0x31,
- 0x28, 0xa2, 0x37, 0x0c, 0x85, 0x7f, 0xcc, 0x43, 0xf4, 0x86, 0xa1, 0x76, 0x1d, 0x2a, 0x1e, 0x09,
- 0x64, 0x07, 0x28, 0x07, 0x93, 0xa1, 0x68, 0x37, 0xa1, 0xd6, 0xc7, 0x36, 0x0e, 0xb1, 0x38, 0x51,
- 0xe7, 0x20, 0x0b, 0x24, 0xed, 0x16, 0xd4, 0x89, 0xc7, 0xdb, 0x90, 0xb5, 0x49, 0xf8, 0x12, 0x8b,
- 0xb2, 0x42, 0x53, 0x52, 0x51, 0xe4, 0xca, 0x63, 0x85, 0xa2, 0xd0, 0x33, 0x99, 0x87, 0xc2, 0xde,
- 0xb1, 0x68, 0x5f, 0xe4, 0xe0, 0x72, 0x9c, 0x94, 0x9b, 0x68, 0xce, 0xe5, 0x26, 0xce, 0xdc, 0x41,
- 0xfa, 0x6b, 0x15, 0xd6, 0xd4, 0xd9, 0xe4, 0x79, 0x8d, 0xf1, 0xbc, 0xc6, 0xf8, 0xdf, 0x5e, 0x63,
- 0x7c, 0x0a, 0x55, 0x76, 0x41, 0x43, 0x49, 0xa9, 0x38, 0x07, 0x25, 0xed, 0x26, 0x54, 0xd8, 0x6d,
- 0x93, 0x12, 0x5b, 0xb4, 0xae, 0x70, 0xf8, 0xa2, 0x6e, 0xc2, 0xd0, 0xb6, 0x7e, 0x56, 0x85, 0xa5,
- 0x94, 0xd6, 0x9e, 0xf7, 0xa4, 0xce, 0x7b, 0x52, 0x67, 0xea, 0x49, 0xa9, 0x74, 0x58, 0x9b, 0xc7,
- 0x1a, 0xbe, 0x0d, 0x10, 0xa5, 0x20, 0xcf, 0xf9, 0xce, 0xd7, 0xaf, 0x6a, 0x70, 0x31, 0xa7, 0x30,
- 0x72, 0x7e, 0x4d, 0xe1, 0xfc, 0x9a, 0xc2, 0xf9, 0x35, 0x85, 0xc8, 0x0c, 0xff, 0x5e, 0x84, 0xc6,
- 0xb8, 0x9c, 0x3e, 0xfd, 0x62, 0xd7, 0xf6, 0xb8, 0x3b, 0xc3, 0xd3, 0xee, 0xb5, 0x6c, 0xcd, 0x9a,
- 0x05, 0x1e, 0x79, 0xf5, 0xf5, 0x26, 0xd4, 0x79, 0x65, 0x55, 0x06, 0x8f, 0x95, 0x6c, 0x41, 0x36,
- 0x30, 0x24, 0x8e, 0xf6, 0x06, 0x34, 0xc4, 0x75, 0x25, 0x79, 0xb2, 0x5e, 0x4d, 0x9e, 0xac, 0x39,
- 0xcc, 0x18, 0x63, 0x9d, 0xfd, 0x4e, 0x33, 0x86, 0x15, 0xc5, 0x65, 0x44, 0xed, 0xbd, 0xc9, 0x0e,
- 0x29, 0x1b, 0x73, 0xc7, 0xad, 0x05, 0xb5, 0x4b, 0xfa, 0x49, 0x11, 0x5a, 0xc9, 0x2e, 0xc3, 0x0e,
- 0x75, 0x44, 0x7c, 0x62, 0x7c, 0x7b, 0x5c, 0x71, 0xe6, 0xee, 0x16, 0x8c, 0x31, 0xde, 0xf3, 0x3d,
- 0x5f, 0xfd, 0xb4, 0x08, 0xcd, 0xf1, 0xc9, 0x5e, 0xbb, 0x03, 0x2d, 0xb9, 0x8d, 0xd9, 0x23, 0x7d,
- 0x2c, 0x1e, 0xf4, 0x72, 0xee, 0x83, 0xf2, 0x6e, 0xc7, 0xa2, 0x5c, 0x74, 0x87, 0xf4, 0xd5, 0xad,
- 0xc0, 0xd2, 0x3c, 0x6f, 0xe3, 0xd7, 0x4d, 0xa8, 0x09, 0x47, 0xad, 0x38, 0xf1, 0xe5, 0x25, 0x28,
- 0xe3, 0xde, 0x6a, 0x79, 0xc2, 0xa5, 0xbf, 0xca, 0xc4, 0x4b, 0x7f, 0xd3, 0x12, 0x8f, 0x94, 0x25,
- 0xd6, 0x32, 0x96, 0x18, 0x73, 0x89, 0xf5, 0x19, 0x5c, 0x62, 0x63, 0xba, 0x4b, 0x6c, 0xce, 0xe0,
- 0x12, 0x61, 0x26, 0x97, 0xb8, 0x30, 0xd9, 0x25, 0x2e, 0x4e, 0x70, 0x89, 0xad, 0x09, 0x2e, 0xb1,
- 0x3d, 0xc9, 0x25, 0x2e, 0x4d, 0x71, 0x89, 0x9d, 0xac, 0x4b, 0x7c, 0x05, 0xda, 0x94, 0x78, 0xcc,
- 0xd8, 0xf8, 0x49, 0xa0, 0xe5, 0xa0, 0xd3, 0x58, 0xae, 0x40, 0xd1, 0x2c, 0x37, 0x8e, 0xa6, 0x09,
- 0x34, 0xcb, 0x8d, 0xa1, 0xc5, 0x03, 0xfd, 0x4a, 0xea, 0x9a, 0xe6, 0x4c, 0x27, 0x82, 0x8f, 0xf2,
- 0x5c, 0xc0, 0x85, 0x6c, 0x6b, 0x29, 0xef, 0xd3, 0x13, 0xb5, 0x37, 0xd0, 0xae, 0x89, 0xb0, 0xbf,
- 0x96, 0xb5, 0xfb, 0x47, 0x23, 0x0f, 0xf3, 0xdc, 0x9d, 0x25, 0x03, 0xaf, 0xcb, 0xa0, 0x7f, 0x31,
- 0x7b, 0xb8, 0x1f, 0x37, 0xcd, 0x65, 0xb8, 0xbf, 0x0e, 0x35, 0x64, 0xdb, 0x54, 0x3f, 0xf5, 0xdc,
- 0xde, 0x79, 0x15, 0xd9, 0xf6, 0xde, 0x40, 0xfb, 0x32, 0x40, 0xec, 0x89, 0xd6, 0xb3, 0xce, 0x3c,
- 0xe2, 0xd6, 0x88, 0x61, 0x6a, 0x2f, 0x43, 0xab, 0x6f, 0x51, 0x0b, 0x72, 0x2c, 0x17, 0x85, 0xc4,
- 0xd7, 0x37, 0x98, 0x82, 0x24, 0x27, 0x93, 0x57, 0x5e, 0x37, 0x53, 0x57, 0x5e, 0x5f, 0x82, 0xf2,
- 0xa9, 0x63, 0xeb, 0x97, 0xb2, 0x16, 0xf7, 0xa1, 0x63, 0x1b, 0x14, 0x96, 0x2d, 0xb3, 0xbe, 0xf0,
- 0xac, 0xb7, 0x62, 0x2f, 0x3f, 0xc3, 0xad, 0xd8, 0x17, 0xe7, 0xf1, 0x58, 0x3f, 0x00, 0x88, 0xe2,
- 0xde, 0x9c, 0x5f, 0x1a, 0xbd, 0x0d, 0x0b, 0x03, 0xcb, 0xc6, 0x66, 0x7e, 0x48, 0x8d, 0x6e, 0x3c,
- 0x77, 0x0b, 0x06, 0x0c, 0xc6, 0xa3, 0xc8, 0x8b, 0x87, 0xb0, 0xa2, 0xe8, 0xe6, 0x6a, 0xdf, 0x9d,
- 0x1c, 0xbf, 0xae, 0x65, 0x13, 0xea, 0x9c, 0x96, 0xb0, 0x3a, 0x9c, 0xfd, 0xa9, 0x02, 0x17, 0xf3,
- 0x9a, 0xd1, 0x0e, 0xbc, 0x70, 0x88, 0x02, 0xab, 0x67, 0xa2, 0xc4, 0x57, 0x42, 0xe6, 0xb8, 0xe6,
- 0xcb, 0x45, 0xf3, 0x5a, 0xa2, 0xc2, 0x9a, 0xff, 0x55, 0x51, 0xb7, 0x60, 0x6c, 0x1e, 0x4e, 0xf8,
- 0xe8, 0xe8, 0x3e, 0x74, 0x90, 0x67, 0x99, 0x9f, 0xe2, 0x51, 0xb4, 0x03, 0x97, 0x64, 0xa2, 0xae,
- 0x95, 0xfc, 0xca, 0xaa, 0x5b, 0x30, 0xda, 0x28, 0xf9, 0xdd, 0xd5, 0xf7, 0x40, 0x27, 0xac, 0x2d,
- 0x61, 0x5a, 0xa2, 0x21, 0x15, 0xd1, 0x2b, 0x67, 0xbb, 0xa2, 0xea, 0xde, 0x55, 0xb7, 0x60, 0xac,
- 0x11, 0x75, 0x57, 0x2b, 0xa2, 0xef, 0x89, 0x5e, 0x4f, 0x44, 0xbf, 0x92, 0x47, 0x3f, 0xdd, 0x16,
- 0x8a, 0xe8, 0x67, 0x1a, 0x46, 0x47, 0xb0, 0x29, 0xe8, 0xa3, 0xa8, 0x91, 0x18, 0x6d, 0xc1, 0x03,
- 0xdc, 0x2b, 0xd9, 0x2d, 0x14, 0x6d, 0xc7, 0x6e, 0xc1, 0x58, 0x27, 0xb9, 0x3d, 0x49, 0x1c, 0x6d,
- 0xc4, 0xba, 0xba, 0x2c, 0x5d, 0x88, 0x36, 0xaa, 0x65, 0xbd, 0x63, 0x5e, 0x0f, 0xb8, 0x5b, 0x30,
- 0x84, 0x4c, 0xb2, 0xb0, 0x48, 0xc3, 0x8f, 0x23, 0x0d, 0x8f, 0xb5, 0x04, 0xb4, 0xf7, 0x27, 0x6b,
- 0xf8, 0xa5, 0x9c, 0xb6, 0x11, 0xbf, 0x58, 0xa0, 0xd6, 0xea, 0xab, 0xb0, 0x10, 0xbf, 0xb9, 0xb0,
- 0x1a, 0x7d, 0xdc, 0x57, 0x8e, 0xee, 0x38, 0xfc, 0xb6, 0x08, 0xe5, 0x47, 0x48, 0x7d, 0x2b, 0x62,
- 0xfa, 0xc7, 0x6e, 0x19, 0xcf, 0x56, 0x3e, 0xf3, 0x37, 0x22, 0x73, 0x7d, 0xc1, 0x75, 0x05, 0x1a,
- 0x32, 0xc2, 0xe4, 0x3c, 0xdf, 0xc7, 0xb0, 0xf4, 0x41, 0xaa, 0xde, 0xf4, 0x1c, 0x3f, 0x26, 0xf9,
- 0x5d, 0x11, 0xca, 0x1f, 0x3a, 0xb6, 0x52, 0x7a, 0x97, 0xa0, 0x49, 0x7f, 0x03, 0x0f, 0xf5, 0xe4,
- 0xbd, 0x92, 0x68, 0x82, 0x26, 0x7f, 0x9e, 0x8f, 0x07, 0xd6, 0xa9, 0xc8, 0xf2, 0xc4, 0x88, 0xae,
- 0x42, 0x61, 0xe8, 0x5b, 0x87, 0xc3, 0x10, 0x8b, 0xcf, 0xf4, 0xa2, 0x09, 0x9a, 0xca, 0x3c, 0xf5,
- 0x91, 0xe7, 0xe1, 0xbe, 0x38, 0x82, 0xcb, 0xe1, 0x99, 0xfb, 0x98, 0xb7, 0x5f, 0x85, 0x36, 0xf1,
- 0x8f, 0x24, 0xae, 0x79, 0xb2, 0x73, 0x7b, 0x51, 0x7c, 0xbb, 0xba, 0xef, 0x93, 0x90, 0xec, 0x17,
- 0x7f, 0x51, 0x2a, 0xef, 0xed, 0x1e, 0x1c, 0xd6, 0xd8, 0xc7, 0xa0, 0x6f, 0xfe, 0x33, 0x00, 0x00,
- 0xff, 0xff, 0xdc, 0xb2, 0x46, 0x98, 0xe4, 0x3a, 0x00, 0x00,
-}
diff --git a/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto b/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto
deleted file mode 100644
index 557c8807..00000000
--- a/vendor/github.com/googleapis/gnostic/openapiv2/OpenAPIv2.proto
+++ /dev/null
@@ -1,663 +0,0 @@
-// Copyright 2017 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// THIS FILE IS AUTOMATICALLY GENERATED.
-
-syntax = "proto3";
-
-package openapi.v2;
-
-import "google/protobuf/any.proto";
-
-// This option lets the proto compiler generate Java code inside the package
-// name (see below) instead of inside an outer class. It creates a simpler
-// developer experience by reducing one-level of name nesting and be
-// consistent with most programming languages that don't support outer classes.
-option java_multiple_files = true;
-
-// The Java outer classname should be the filename in UpperCamelCase. This
-// class is only used to hold proto descriptor, so developers don't need to
-// work with it directly.
-option java_outer_classname = "OpenAPIProto";
-
-// The Java package name must be proto package name with proper prefix.
-option java_package = "org.openapi_v2";
-
-// A reasonable prefix for the Objective-C symbols generated from the package.
-// It should at a minimum be 3 characters long, all uppercase, and convention
-// is to use an abbreviation of the package name. Something short, but
-// hopefully unique enough to not conflict with things that may come along in
-// the future. 'GPB' is reserved for the protocol buffer implementation itself.
-option objc_class_prefix = "OAS";
-
-message AdditionalPropertiesItem {
- oneof oneof {
- Schema schema = 1;
- bool boolean = 2;
- }
-}
-
-message Any {
- google.protobuf.Any value = 1;
- string yaml = 2;
-}
-
-message ApiKeySecurity {
- string type = 1;
- string name = 2;
- string in = 3;
- string description = 4;
- repeated NamedAny vendor_extension = 5;
-}
-
-message BasicAuthenticationSecurity {
- string type = 1;
- string description = 2;
- repeated NamedAny vendor_extension = 3;
-}
-
-message BodyParameter {
- // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
- string description = 1;
- // The name of the parameter.
- string name = 2;
- // Determines the location of the parameter.
- string in = 3;
- // Determines whether or not this parameter is required or optional.
- bool required = 4;
- Schema schema = 5;
- repeated NamedAny vendor_extension = 6;
-}
-
-// Contact information for the owners of the API.
-message Contact {
- // The identifying name of the contact person/organization.
- string name = 1;
- // The URL pointing to the contact information.
- string url = 2;
- // The email address of the contact person/organization.
- string email = 3;
- repeated NamedAny vendor_extension = 4;
-}
-
-message Default {
- repeated NamedAny additional_properties = 1;
-}
-
-// One or more JSON objects describing the schemas being consumed and produced by the API.
-message Definitions {
- repeated NamedSchema additional_properties = 1;
-}
-
-message Document {
- // The Swagger version of this document.
- string swagger = 1;
- Info info = 2;
- // The host (name or ip) of the API. Example: 'swagger.io'
- string host = 3;
- // The base path to the API. Example: '/api'.
- string base_path = 4;
- // The transfer protocol of the API.
- repeated string schemes = 5;
- // A list of MIME types accepted by the API.
- repeated string consumes = 6;
- // A list of MIME types the API can produce.
- repeated string produces = 7;
- Paths paths = 8;
- Definitions definitions = 9;
- ParameterDefinitions parameters = 10;
- ResponseDefinitions responses = 11;
- repeated SecurityRequirement security = 12;
- SecurityDefinitions security_definitions = 13;
- repeated Tag tags = 14;
- ExternalDocs external_docs = 15;
- repeated NamedAny vendor_extension = 16;
-}
-
-message Examples {
- repeated NamedAny additional_properties = 1;
-}
-
-// information about external documentation
-message ExternalDocs {
- string description = 1;
- string url = 2;
- repeated NamedAny vendor_extension = 3;
-}
-
-// A deterministic version of a JSON Schema object.
-message FileSchema {
- string format = 1;
- string title = 2;
- string description = 3;
- Any default = 4;
- repeated string required = 5;
- string type = 6;
- bool read_only = 7;
- ExternalDocs external_docs = 8;
- Any example = 9;
- repeated NamedAny vendor_extension = 10;
-}
-
-message FormDataParameterSubSchema {
- // Determines whether or not this parameter is required or optional.
- bool required = 1;
- // Determines the location of the parameter.
- string in = 2;
- // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
- string description = 3;
- // The name of the parameter.
- string name = 4;
- // allows sending a parameter by name only or with an empty value.
- bool allow_empty_value = 5;
- string type = 6;
- string format = 7;
- PrimitivesItems items = 8;
- string collection_format = 9;
- Any default = 10;
- double maximum = 11;
- bool exclusive_maximum = 12;
- double minimum = 13;
- bool exclusive_minimum = 14;
- int64 max_length = 15;
- int64 min_length = 16;
- string pattern = 17;
- int64 max_items = 18;
- int64 min_items = 19;
- bool unique_items = 20;
- repeated Any enum = 21;
- double multiple_of = 22;
- repeated NamedAny vendor_extension = 23;
-}
-
-message Header {
- string type = 1;
- string format = 2;
- PrimitivesItems items = 3;
- string collection_format = 4;
- Any default = 5;
- double maximum = 6;
- bool exclusive_maximum = 7;
- double minimum = 8;
- bool exclusive_minimum = 9;
- int64 max_length = 10;
- int64 min_length = 11;
- string pattern = 12;
- int64 max_items = 13;
- int64 min_items = 14;
- bool unique_items = 15;
- repeated Any enum = 16;
- double multiple_of = 17;
- string description = 18;
- repeated NamedAny vendor_extension = 19;
-}
-
-message HeaderParameterSubSchema {
- // Determines whether or not this parameter is required or optional.
- bool required = 1;
- // Determines the location of the parameter.
- string in = 2;
- // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
- string description = 3;
- // The name of the parameter.
- string name = 4;
- string type = 5;
- string format = 6;
- PrimitivesItems items = 7;
- string collection_format = 8;
- Any default = 9;
- double maximum = 10;
- bool exclusive_maximum = 11;
- double minimum = 12;
- bool exclusive_minimum = 13;
- int64 max_length = 14;
- int64 min_length = 15;
- string pattern = 16;
- int64 max_items = 17;
- int64 min_items = 18;
- bool unique_items = 19;
- repeated Any enum = 20;
- double multiple_of = 21;
- repeated NamedAny vendor_extension = 22;
-}
-
-message Headers {
- repeated NamedHeader additional_properties = 1;
-}
-
-// General information about the API.
-message Info {
- // A unique and precise title of the API.
- string title = 1;
- // A semantic version number of the API.
- string version = 2;
- // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed.
- string description = 3;
- // The terms of service for the API.
- string terms_of_service = 4;
- Contact contact = 5;
- License license = 6;
- repeated NamedAny vendor_extension = 7;
-}
-
-message ItemsItem {
- repeated Schema schema = 1;
-}
-
-message JsonReference {
- string _ref = 1;
- string description = 2;
-}
-
-message License {
- // The name of the license type. It's encouraged to use an OSI compatible license.
- string name = 1;
- // The URL pointing to the license.
- string url = 2;
- repeated NamedAny vendor_extension = 3;
-}
-
-// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs.
-message NamedAny {
- // Map key
- string name = 1;
- // Mapped value
- Any value = 2;
-}
-
-// Automatically-generated message used to represent maps of Header as ordered (name,value) pairs.
-message NamedHeader {
- // Map key
- string name = 1;
- // Mapped value
- Header value = 2;
-}
-
-// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs.
-message NamedParameter {
- // Map key
- string name = 1;
- // Mapped value
- Parameter value = 2;
-}
-
-// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs.
-message NamedPathItem {
- // Map key
- string name = 1;
- // Mapped value
- PathItem value = 2;
-}
-
-// Automatically-generated message used to represent maps of Response as ordered (name,value) pairs.
-message NamedResponse {
- // Map key
- string name = 1;
- // Mapped value
- Response value = 2;
-}
-
-// Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs.
-message NamedResponseValue {
- // Map key
- string name = 1;
- // Mapped value
- ResponseValue value = 2;
-}
-
-// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs.
-message NamedSchema {
- // Map key
- string name = 1;
- // Mapped value
- Schema value = 2;
-}
-
-// Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs.
-message NamedSecurityDefinitionsItem {
- // Map key
- string name = 1;
- // Mapped value
- SecurityDefinitionsItem value = 2;
-}
-
-// Automatically-generated message used to represent maps of string as ordered (name,value) pairs.
-message NamedString {
- // Map key
- string name = 1;
- // Mapped value
- string value = 2;
-}
-
-// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs.
-message NamedStringArray {
- // Map key
- string name = 1;
- // Mapped value
- StringArray value = 2;
-}
-
-message NonBodyParameter {
- oneof oneof {
- HeaderParameterSubSchema header_parameter_sub_schema = 1;
- FormDataParameterSubSchema form_data_parameter_sub_schema = 2;
- QueryParameterSubSchema query_parameter_sub_schema = 3;
- PathParameterSubSchema path_parameter_sub_schema = 4;
- }
-}
-
-message Oauth2AccessCodeSecurity {
- string type = 1;
- string flow = 2;
- Oauth2Scopes scopes = 3;
- string authorization_url = 4;
- string token_url = 5;
- string description = 6;
- repeated NamedAny vendor_extension = 7;
-}
-
-message Oauth2ApplicationSecurity {
- string type = 1;
- string flow = 2;
- Oauth2Scopes scopes = 3;
- string token_url = 4;
- string description = 5;
- repeated NamedAny vendor_extension = 6;
-}
-
-message Oauth2ImplicitSecurity {
- string type = 1;
- string flow = 2;
- Oauth2Scopes scopes = 3;
- string authorization_url = 4;
- string description = 5;
- repeated NamedAny vendor_extension = 6;
-}
-
-message Oauth2PasswordSecurity {
- string type = 1;
- string flow = 2;
- Oauth2Scopes scopes = 3;
- string token_url = 4;
- string description = 5;
- repeated NamedAny vendor_extension = 6;
-}
-
-message Oauth2Scopes {
- repeated NamedString additional_properties = 1;
-}
-
-message Operation {
- repeated string tags = 1;
- // A brief summary of the operation.
- string summary = 2;
- // A longer description of the operation, GitHub Flavored Markdown is allowed.
- string description = 3;
- ExternalDocs external_docs = 4;
- // A unique identifier of the operation.
- string operation_id = 5;
- // A list of MIME types the API can produce.
- repeated string produces = 6;
- // A list of MIME types the API can consume.
- repeated string consumes = 7;
- // The parameters needed to send a valid API call.
- repeated ParametersItem parameters = 8;
- Responses responses = 9;
- // The transfer protocol of the API.
- repeated string schemes = 10;
- bool deprecated = 11;
- repeated SecurityRequirement security = 12;
- repeated NamedAny vendor_extension = 13;
-}
-
-message Parameter {
- oneof oneof {
- BodyParameter body_parameter = 1;
- NonBodyParameter non_body_parameter = 2;
- }
-}
-
-// One or more JSON representations for parameters
-message ParameterDefinitions {
- repeated NamedParameter additional_properties = 1;
-}
-
-message ParametersItem {
- oneof oneof {
- Parameter parameter = 1;
- JsonReference json_reference = 2;
- }
-}
-
-message PathItem {
- string _ref = 1;
- Operation get = 2;
- Operation put = 3;
- Operation post = 4;
- Operation delete = 5;
- Operation options = 6;
- Operation head = 7;
- Operation patch = 8;
- // The parameters needed to send a valid API call.
- repeated ParametersItem parameters = 9;
- repeated NamedAny vendor_extension = 10;
-}
-
-message PathParameterSubSchema {
- // Determines whether or not this parameter is required or optional.
- bool required = 1;
- // Determines the location of the parameter.
- string in = 2;
- // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
- string description = 3;
- // The name of the parameter.
- string name = 4;
- string type = 5;
- string format = 6;
- PrimitivesItems items = 7;
- string collection_format = 8;
- Any default = 9;
- double maximum = 10;
- bool exclusive_maximum = 11;
- double minimum = 12;
- bool exclusive_minimum = 13;
- int64 max_length = 14;
- int64 min_length = 15;
- string pattern = 16;
- int64 max_items = 17;
- int64 min_items = 18;
- bool unique_items = 19;
- repeated Any enum = 20;
- double multiple_of = 21;
- repeated NamedAny vendor_extension = 22;
-}
-
-// Relative paths to the individual endpoints. They must be relative to the 'basePath'.
-message Paths {
- repeated NamedAny vendor_extension = 1;
- repeated NamedPathItem path = 2;
-}
-
-message PrimitivesItems {
- string type = 1;
- string format = 2;
- PrimitivesItems items = 3;
- string collection_format = 4;
- Any default = 5;
- double maximum = 6;
- bool exclusive_maximum = 7;
- double minimum = 8;
- bool exclusive_minimum = 9;
- int64 max_length = 10;
- int64 min_length = 11;
- string pattern = 12;
- int64 max_items = 13;
- int64 min_items = 14;
- bool unique_items = 15;
- repeated Any enum = 16;
- double multiple_of = 17;
- repeated NamedAny vendor_extension = 18;
-}
-
-message Properties {
- repeated NamedSchema additional_properties = 1;
-}
-
-message QueryParameterSubSchema {
- // Determines whether or not this parameter is required or optional.
- bool required = 1;
- // Determines the location of the parameter.
- string in = 2;
- // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.
- string description = 3;
- // The name of the parameter.
- string name = 4;
- // allows sending a parameter by name only or with an empty value.
- bool allow_empty_value = 5;
- string type = 6;
- string format = 7;
- PrimitivesItems items = 8;
- string collection_format = 9;
- Any default = 10;
- double maximum = 11;
- bool exclusive_maximum = 12;
- double minimum = 13;
- bool exclusive_minimum = 14;
- int64 max_length = 15;
- int64 min_length = 16;
- string pattern = 17;
- int64 max_items = 18;
- int64 min_items = 19;
- bool unique_items = 20;
- repeated Any enum = 21;
- double multiple_of = 22;
- repeated NamedAny vendor_extension = 23;
-}
-
-message Response {
- string description = 1;
- SchemaItem schema = 2;
- Headers headers = 3;
- Examples examples = 4;
- repeated NamedAny vendor_extension = 5;
-}
-
-// One or more JSON representations for parameters
-message ResponseDefinitions {
- repeated NamedResponse additional_properties = 1;
-}
-
-message ResponseValue {
- oneof oneof {
- Response response = 1;
- JsonReference json_reference = 2;
- }
-}
-
-// Response objects names can either be any valid HTTP status code or 'default'.
-message Responses {
- repeated NamedResponseValue response_code = 1;
- repeated NamedAny vendor_extension = 2;
-}
-
-// A deterministic version of a JSON Schema object.
-message Schema {
- string _ref = 1;
- string format = 2;
- string title = 3;
- string description = 4;
- Any default = 5;
- double multiple_of = 6;
- double maximum = 7;
- bool exclusive_maximum = 8;
- double minimum = 9;
- bool exclusive_minimum = 10;
- int64 max_length = 11;
- int64 min_length = 12;
- string pattern = 13;
- int64 max_items = 14;
- int64 min_items = 15;
- bool unique_items = 16;
- int64 max_properties = 17;
- int64 min_properties = 18;
- repeated string required = 19;
- repeated Any enum = 20;
- AdditionalPropertiesItem additional_properties = 21;
- TypeItem type = 22;
- ItemsItem items = 23;
- repeated Schema all_of = 24;
- Properties properties = 25;
- string discriminator = 26;
- bool read_only = 27;
- Xml xml = 28;
- ExternalDocs external_docs = 29;
- Any example = 30;
- repeated NamedAny vendor_extension = 31;
-}
-
-message SchemaItem {
- oneof oneof {
- Schema schema = 1;
- FileSchema file_schema = 2;
- }
-}
-
-message SecurityDefinitions {
- repeated NamedSecurityDefinitionsItem additional_properties = 1;
-}
-
-message SecurityDefinitionsItem {
- oneof oneof {
- BasicAuthenticationSecurity basic_authentication_security = 1;
- ApiKeySecurity api_key_security = 2;
- Oauth2ImplicitSecurity oauth2_implicit_security = 3;
- Oauth2PasswordSecurity oauth2_password_security = 4;
- Oauth2ApplicationSecurity oauth2_application_security = 5;
- Oauth2AccessCodeSecurity oauth2_access_code_security = 6;
- }
-}
-
-message SecurityRequirement {
- repeated NamedStringArray additional_properties = 1;
-}
-
-message StringArray {
- repeated string value = 1;
-}
-
-message Tag {
- string name = 1;
- string description = 2;
- ExternalDocs external_docs = 3;
- repeated NamedAny vendor_extension = 4;
-}
-
-message TypeItem {
- repeated string value = 1;
-}
-
-// Any property starting with x- is valid.
-message VendorExtension {
- repeated NamedAny additional_properties = 1;
-}
-
-message Xml {
- string name = 1;
- string namespace = 2;
- string prefix = 3;
- bool attribute = 4;
- bool wrapped = 5;
- repeated NamedAny vendor_extension = 6;
-}
-
diff --git a/vendor/github.com/googleapis/gnostic/openapiv2/README.md b/vendor/github.com/googleapis/gnostic/openapiv2/README.md
deleted file mode 100644
index 836fb32a..00000000
--- a/vendor/github.com/googleapis/gnostic/openapiv2/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# OpenAPI v2 Protocol Buffer Models
-
-This directory contains a Protocol Buffer-language model
-and related code for supporting OpenAPI v2.
-
-Gnostic applications and plugins can use OpenAPIv2.proto
-to generate Protocol Buffer support code for their preferred languages.
-
-OpenAPIv2.go is used by Gnostic to read JSON and YAML OpenAPI
-descriptions into the Protocol Buffer-based datastructures
-generated from OpenAPIv2.proto.
-
-OpenAPIv2.proto and OpenAPIv2.go are generated by the Gnostic
-compiler generator, and OpenAPIv2.pb.go is generated by
-protoc, the Protocol Buffer compiler, and protoc-gen-go, the
-Protocol Buffer Go code generation plugin.
diff --git a/vendor/github.com/googleapis/gnostic/openapiv2/openapi-2.0.json b/vendor/github.com/googleapis/gnostic/openapiv2/openapi-2.0.json
deleted file mode 100644
index 2815a26e..00000000
--- a/vendor/github.com/googleapis/gnostic/openapiv2/openapi-2.0.json
+++ /dev/null
@@ -1,1610 +0,0 @@
-{
- "title": "A JSON Schema for Swagger 2.0 API.",
- "id": "http://swagger.io/v2/schema.json#",
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "required": [
- "swagger",
- "info",
- "paths"
- ],
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "swagger": {
- "type": "string",
- "enum": [
- "2.0"
- ],
- "description": "The Swagger version of this document."
- },
- "info": {
- "$ref": "#/definitions/info"
- },
- "host": {
- "type": "string",
- "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$",
- "description": "The host (name or ip) of the API. Example: 'swagger.io'"
- },
- "basePath": {
- "type": "string",
- "pattern": "^/",
- "description": "The base path to the API. Example: '/api'."
- },
- "schemes": {
- "$ref": "#/definitions/schemesList"
- },
- "consumes": {
- "description": "A list of MIME types accepted by the API.",
- "allOf": [
- {
- "$ref": "#/definitions/mediaTypeList"
- }
- ]
- },
- "produces": {
- "description": "A list of MIME types the API can produce.",
- "allOf": [
- {
- "$ref": "#/definitions/mediaTypeList"
- }
- ]
- },
- "paths": {
- "$ref": "#/definitions/paths"
- },
- "definitions": {
- "$ref": "#/definitions/definitions"
- },
- "parameters": {
- "$ref": "#/definitions/parameterDefinitions"
- },
- "responses": {
- "$ref": "#/definitions/responseDefinitions"
- },
- "security": {
- "$ref": "#/definitions/security"
- },
- "securityDefinitions": {
- "$ref": "#/definitions/securityDefinitions"
- },
- "tags": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/tag"
- },
- "uniqueItems": true
- },
- "externalDocs": {
- "$ref": "#/definitions/externalDocs"
- }
- },
- "definitions": {
- "info": {
- "type": "object",
- "description": "General information about the API.",
- "required": [
- "version",
- "title"
- ],
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "title": {
- "type": "string",
- "description": "A unique and precise title of the API."
- },
- "version": {
- "type": "string",
- "description": "A semantic version number of the API."
- },
- "description": {
- "type": "string",
- "description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."
- },
- "termsOfService": {
- "type": "string",
- "description": "The terms of service for the API."
- },
- "contact": {
- "$ref": "#/definitions/contact"
- },
- "license": {
- "$ref": "#/definitions/license"
- }
- }
- },
- "contact": {
- "type": "object",
- "description": "Contact information for the owners of the API.",
- "additionalProperties": false,
- "properties": {
- "name": {
- "type": "string",
- "description": "The identifying name of the contact person/organization."
- },
- "url": {
- "type": "string",
- "description": "The URL pointing to the contact information.",
- "format": "uri"
- },
- "email": {
- "type": "string",
- "description": "The email address of the contact person/organization.",
- "format": "email"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "license": {
- "type": "object",
- "required": [
- "name"
- ],
- "additionalProperties": false,
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the license type. It's encouraged to use an OSI compatible license."
- },
- "url": {
- "type": "string",
- "description": "The URL pointing to the license.",
- "format": "uri"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "paths": {
- "type": "object",
- "description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.",
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- },
- "^/": {
- "$ref": "#/definitions/pathItem"
- }
- },
- "additionalProperties": false
- },
- "definitions": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/schema"
- },
- "description": "One or more JSON objects describing the schemas being consumed and produced by the API."
- },
- "parameterDefinitions": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/parameter"
- },
- "description": "One or more JSON representations for parameters"
- },
- "responseDefinitions": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/response"
- },
- "description": "One or more JSON representations for parameters"
- },
- "externalDocs": {
- "type": "object",
- "additionalProperties": false,
- "description": "information about external documentation",
- "required": [
- "url"
- ],
- "properties": {
- "description": {
- "type": "string"
- },
- "url": {
- "type": "string",
- "format": "uri"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "examples": {
- "type": "object",
- "additionalProperties": true
- },
- "mimeType": {
- "type": "string",
- "description": "The MIME type of the HTTP message."
- },
- "operation": {
- "type": "object",
- "required": [
- "responses"
- ],
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "uniqueItems": true
- },
- "summary": {
- "type": "string",
- "description": "A brief summary of the operation."
- },
- "description": {
- "type": "string",
- "description": "A longer description of the operation, GitHub Flavored Markdown is allowed."
- },
- "externalDocs": {
- "$ref": "#/definitions/externalDocs"
- },
- "operationId": {
- "type": "string",
- "description": "A unique identifier of the operation."
- },
- "produces": {
- "description": "A list of MIME types the API can produce.",
- "allOf": [
- {
- "$ref": "#/definitions/mediaTypeList"
- }
- ]
- },
- "consumes": {
- "description": "A list of MIME types the API can consume.",
- "allOf": [
- {
- "$ref": "#/definitions/mediaTypeList"
- }
- ]
- },
- "parameters": {
- "$ref": "#/definitions/parametersList"
- },
- "responses": {
- "$ref": "#/definitions/responses"
- },
- "schemes": {
- "$ref": "#/definitions/schemesList"
- },
- "deprecated": {
- "type": "boolean",
- "default": false
- },
- "security": {
- "$ref": "#/definitions/security"
- }
- }
- },
- "pathItem": {
- "type": "object",
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "$ref": {
- "type": "string"
- },
- "get": {
- "$ref": "#/definitions/operation"
- },
- "put": {
- "$ref": "#/definitions/operation"
- },
- "post": {
- "$ref": "#/definitions/operation"
- },
- "delete": {
- "$ref": "#/definitions/operation"
- },
- "options": {
- "$ref": "#/definitions/operation"
- },
- "head": {
- "$ref": "#/definitions/operation"
- },
- "patch": {
- "$ref": "#/definitions/operation"
- },
- "parameters": {
- "$ref": "#/definitions/parametersList"
- }
- }
- },
- "responses": {
- "type": "object",
- "description": "Response objects names can either be any valid HTTP status code or 'default'.",
- "minProperties": 1,
- "additionalProperties": false,
- "patternProperties": {
- "^([0-9]{3})$|^(default)$": {
- "$ref": "#/definitions/responseValue"
- },
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "not": {
- "type": "object",
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- }
- },
- "responseValue": {
- "oneOf": [
- {
- "$ref": "#/definitions/response"
- },
- {
- "$ref": "#/definitions/jsonReference"
- }
- ]
- },
- "response": {
- "type": "object",
- "required": [
- "description"
- ],
- "properties": {
- "description": {
- "type": "string"
- },
- "schema": {
- "oneOf": [
- {
- "$ref": "#/definitions/schema"
- },
- {
- "$ref": "#/definitions/fileSchema"
- }
- ]
- },
- "headers": {
- "$ref": "#/definitions/headers"
- },
- "examples": {
- "$ref": "#/definitions/examples"
- }
- },
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "headers": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/header"
- }
- },
- "header": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "integer",
- "boolean",
- "array"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormat"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "vendorExtension": {
- "description": "Any property starting with x- is valid.",
- "additionalProperties": true,
- "additionalItems": true
- },
- "bodyParameter": {
- "type": "object",
- "required": [
- "name",
- "in",
- "schema"
- ],
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "description": {
- "type": "string",
- "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
- },
- "name": {
- "type": "string",
- "description": "The name of the parameter."
- },
- "in": {
- "type": "string",
- "description": "Determines the location of the parameter.",
- "enum": [
- "body"
- ]
- },
- "required": {
- "type": "boolean",
- "description": "Determines whether or not this parameter is required or optional.",
- "default": false
- },
- "schema": {
- "$ref": "#/definitions/schema"
- }
- },
- "additionalProperties": false
- },
- "headerParameterSubSchema": {
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "required": {
- "type": "boolean",
- "description": "Determines whether or not this parameter is required or optional.",
- "default": false
- },
- "in": {
- "type": "string",
- "description": "Determines the location of the parameter.",
- "enum": [
- "header"
- ]
- },
- "description": {
- "type": "string",
- "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
- },
- "name": {
- "type": "string",
- "description": "The name of the parameter."
- },
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "boolean",
- "integer",
- "array"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormat"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- }
- }
- },
- "queryParameterSubSchema": {
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "required": {
- "type": "boolean",
- "description": "Determines whether or not this parameter is required or optional.",
- "default": false
- },
- "in": {
- "type": "string",
- "description": "Determines the location of the parameter.",
- "enum": [
- "query"
- ]
- },
- "description": {
- "type": "string",
- "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
- },
- "name": {
- "type": "string",
- "description": "The name of the parameter."
- },
- "allowEmptyValue": {
- "type": "boolean",
- "default": false,
- "description": "allows sending a parameter by name only or with an empty value."
- },
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "boolean",
- "integer",
- "array"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormatWithMulti"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- }
- }
- },
- "formDataParameterSubSchema": {
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "required": {
- "type": "boolean",
- "description": "Determines whether or not this parameter is required or optional.",
- "default": false
- },
- "in": {
- "type": "string",
- "description": "Determines the location of the parameter.",
- "enum": [
- "formData"
- ]
- },
- "description": {
- "type": "string",
- "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
- },
- "name": {
- "type": "string",
- "description": "The name of the parameter."
- },
- "allowEmptyValue": {
- "type": "boolean",
- "default": false,
- "description": "allows sending a parameter by name only or with an empty value."
- },
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "boolean",
- "integer",
- "array",
- "file"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormatWithMulti"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- }
- }
- },
- "pathParameterSubSchema": {
- "additionalProperties": false,
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "required": [
- "required"
- ],
- "properties": {
- "required": {
- "type": "boolean",
- "enum": [
- true
- ],
- "description": "Determines whether or not this parameter is required or optional."
- },
- "in": {
- "type": "string",
- "description": "Determines the location of the parameter.",
- "enum": [
- "path"
- ]
- },
- "description": {
- "type": "string",
- "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."
- },
- "name": {
- "type": "string",
- "description": "The name of the parameter."
- },
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "boolean",
- "integer",
- "array"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormat"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- }
- }
- },
- "nonBodyParameter": {
- "type": "object",
- "required": [
- "name",
- "in",
- "type"
- ],
- "oneOf": [
- {
- "$ref": "#/definitions/headerParameterSubSchema"
- },
- {
- "$ref": "#/definitions/formDataParameterSubSchema"
- },
- {
- "$ref": "#/definitions/queryParameterSubSchema"
- },
- {
- "$ref": "#/definitions/pathParameterSubSchema"
- }
- ]
- },
- "parameter": {
- "oneOf": [
- {
- "$ref": "#/definitions/bodyParameter"
- },
- {
- "$ref": "#/definitions/nonBodyParameter"
- }
- ]
- },
- "schema": {
- "type": "object",
- "description": "A deterministic version of a JSON Schema object.",
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "properties": {
- "$ref": {
- "type": "string"
- },
- "format": {
- "type": "string"
- },
- "title": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
- },
- "description": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
- },
- "default": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
- },
- "multipleOf": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
- },
- "maximum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
- },
- "minLength": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
- },
- "pattern": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
- },
- "maxItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
- },
- "minItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
- },
- "uniqueItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
- },
- "maxProperties": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
- },
- "minProperties": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
- },
- "required": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
- },
- "enum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
- },
- "additionalProperties": {
- "oneOf": [
- {
- "$ref": "#/definitions/schema"
- },
- {
- "type": "boolean"
- }
- ],
- "default": {}
- },
- "type": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/type"
- },
- "items": {
- "anyOf": [
- {
- "$ref": "#/definitions/schema"
- },
- {
- "type": "array",
- "minItems": 1,
- "items": {
- "$ref": "#/definitions/schema"
- }
- }
- ],
- "default": {}
- },
- "allOf": {
- "type": "array",
- "minItems": 1,
- "items": {
- "$ref": "#/definitions/schema"
- }
- },
- "properties": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/definitions/schema"
- },
- "default": {}
- },
- "discriminator": {
- "type": "string"
- },
- "readOnly": {
- "type": "boolean",
- "default": false
- },
- "xml": {
- "$ref": "#/definitions/xml"
- },
- "externalDocs": {
- "$ref": "#/definitions/externalDocs"
- },
- "example": {}
- },
- "additionalProperties": false
- },
- "fileSchema": {
- "type": "object",
- "description": "A deterministic version of a JSON Schema object.",
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- },
- "required": [
- "type"
- ],
- "properties": {
- "format": {
- "type": "string"
- },
- "title": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
- },
- "description": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
- },
- "default": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
- },
- "required": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
- },
- "type": {
- "type": "string",
- "enum": [
- "file"
- ]
- },
- "readOnly": {
- "type": "boolean",
- "default": false
- },
- "externalDocs": {
- "$ref": "#/definitions/externalDocs"
- },
- "example": {}
- },
- "additionalProperties": false
- },
- "primitivesItems": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "string",
- "number",
- "integer",
- "boolean",
- "array"
- ]
- },
- "format": {
- "type": "string"
- },
- "items": {
- "$ref": "#/definitions/primitivesItems"
- },
- "collectionFormat": {
- "$ref": "#/definitions/collectionFormat"
- },
- "default": {
- "$ref": "#/definitions/default"
- },
- "maximum": {
- "$ref": "#/definitions/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "#/definitions/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "#/definitions/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "#/definitions/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "#/definitions/maxLength"
- },
- "minLength": {
- "$ref": "#/definitions/minLength"
- },
- "pattern": {
- "$ref": "#/definitions/pattern"
- },
- "maxItems": {
- "$ref": "#/definitions/maxItems"
- },
- "minItems": {
- "$ref": "#/definitions/minItems"
- },
- "uniqueItems": {
- "$ref": "#/definitions/uniqueItems"
- },
- "enum": {
- "$ref": "#/definitions/enum"
- },
- "multipleOf": {
- "$ref": "#/definitions/multipleOf"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "security": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/securityRequirement"
- },
- "uniqueItems": true
- },
- "securityRequirement": {
- "type": "object",
- "additionalProperties": {
- "type": "array",
- "items": {
- "type": "string"
- },
- "uniqueItems": true
- }
- },
- "xml": {
- "type": "object",
- "additionalProperties": false,
- "properties": {
- "name": {
- "type": "string"
- },
- "namespace": {
- "type": "string"
- },
- "prefix": {
- "type": "string"
- },
- "attribute": {
- "type": "boolean",
- "default": false
- },
- "wrapped": {
- "type": "boolean",
- "default": false
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "tag": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "name"
- ],
- "properties": {
- "name": {
- "type": "string"
- },
- "description": {
- "type": "string"
- },
- "externalDocs": {
- "$ref": "#/definitions/externalDocs"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "securityDefinitions": {
- "type": "object",
- "additionalProperties": {
- "oneOf": [
- {
- "$ref": "#/definitions/basicAuthenticationSecurity"
- },
- {
- "$ref": "#/definitions/apiKeySecurity"
- },
- {
- "$ref": "#/definitions/oauth2ImplicitSecurity"
- },
- {
- "$ref": "#/definitions/oauth2PasswordSecurity"
- },
- {
- "$ref": "#/definitions/oauth2ApplicationSecurity"
- },
- {
- "$ref": "#/definitions/oauth2AccessCodeSecurity"
- }
- ]
- }
- },
- "basicAuthenticationSecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "basic"
- ]
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "apiKeySecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type",
- "name",
- "in"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "apiKey"
- ]
- },
- "name": {
- "type": "string"
- },
- "in": {
- "type": "string",
- "enum": [
- "header",
- "query"
- ]
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "oauth2ImplicitSecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type",
- "flow",
- "authorizationUrl"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "oauth2"
- ]
- },
- "flow": {
- "type": "string",
- "enum": [
- "implicit"
- ]
- },
- "scopes": {
- "$ref": "#/definitions/oauth2Scopes"
- },
- "authorizationUrl": {
- "type": "string",
- "format": "uri"
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "oauth2PasswordSecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type",
- "flow",
- "tokenUrl"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "oauth2"
- ]
- },
- "flow": {
- "type": "string",
- "enum": [
- "password"
- ]
- },
- "scopes": {
- "$ref": "#/definitions/oauth2Scopes"
- },
- "tokenUrl": {
- "type": "string",
- "format": "uri"
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "oauth2ApplicationSecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type",
- "flow",
- "tokenUrl"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "oauth2"
- ]
- },
- "flow": {
- "type": "string",
- "enum": [
- "application"
- ]
- },
- "scopes": {
- "$ref": "#/definitions/oauth2Scopes"
- },
- "tokenUrl": {
- "type": "string",
- "format": "uri"
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "oauth2AccessCodeSecurity": {
- "type": "object",
- "additionalProperties": false,
- "required": [
- "type",
- "flow",
- "authorizationUrl",
- "tokenUrl"
- ],
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "oauth2"
- ]
- },
- "flow": {
- "type": "string",
- "enum": [
- "accessCode"
- ]
- },
- "scopes": {
- "$ref": "#/definitions/oauth2Scopes"
- },
- "authorizationUrl": {
- "type": "string",
- "format": "uri"
- },
- "tokenUrl": {
- "type": "string",
- "format": "uri"
- },
- "description": {
- "type": "string"
- }
- },
- "patternProperties": {
- "^x-": {
- "$ref": "#/definitions/vendorExtension"
- }
- }
- },
- "oauth2Scopes": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "mediaTypeList": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/mimeType"
- },
- "uniqueItems": true
- },
- "parametersList": {
- "type": "array",
- "description": "The parameters needed to send a valid API call.",
- "additionalItems": false,
- "items": {
- "oneOf": [
- {
- "$ref": "#/definitions/parameter"
- },
- {
- "$ref": "#/definitions/jsonReference"
- }
- ]
- },
- "uniqueItems": true
- },
- "schemesList": {
- "type": "array",
- "description": "The transfer protocol of the API.",
- "items": {
- "type": "string",
- "enum": [
- "http",
- "https",
- "ws",
- "wss"
- ]
- },
- "uniqueItems": true
- },
- "collectionFormat": {
- "type": "string",
- "enum": [
- "csv",
- "ssv",
- "tsv",
- "pipes"
- ],
- "default": "csv"
- },
- "collectionFormatWithMulti": {
- "type": "string",
- "enum": [
- "csv",
- "ssv",
- "tsv",
- "pipes",
- "multi"
- ],
- "default": "csv"
- },
- "title": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
- },
- "description": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
- },
- "default": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
- },
- "multipleOf": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
- },
- "maximum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
- },
- "exclusiveMaximum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
- },
- "minimum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
- },
- "exclusiveMinimum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
- },
- "maxLength": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
- },
- "minLength": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
- },
- "pattern": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
- },
- "maxItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
- },
- "minItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
- },
- "uniqueItems": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
- },
- "enum": {
- "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
- },
- "jsonReference": {
- "type": "object",
- "required": [
- "$ref"
- ],
- "additionalProperties": false,
- "properties": {
- "$ref": {
- "type": "string"
- },
- "description": {
- "type": "string"
- }
- }
- }
- }
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.gitignore b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.gitignore
deleted file mode 100644
index 2233cff9..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.gitignore
+++ /dev/null
@@ -1,201 +0,0 @@
-#vendor
-vendor/
-
-# Created by .ignore support plugin (hsz.mobi)
-coverage.txt
-### Go template
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-*.test
-*.prof
-### Windows template
-# Windows image file caches
-Thumbs.db
-ehthumbs.db
-
-# Folder config file
-Desktop.ini
-
-# Recycle Bin used on file shares
-$RECYCLE.BIN/
-
-# Windows Installer files
-*.cab
-*.msi
-*.msm
-*.msp
-
-# Windows shortcuts
-*.lnk
-### Kate template
-# Swap Files #
-.*.kate-swp
-.swp.*
-### SublimeText template
-# cache files for sublime text
-*.tmlanguage.cache
-*.tmPreferences.cache
-*.stTheme.cache
-
-# workspace files are user-specific
-*.sublime-workspace
-
-# project files should be checked into the repository, unless a significant
-# proportion of contributors will probably not be using SublimeText
-# *.sublime-project
-
-# sftp configuration file
-sftp-config.json
-### Linux template
-*~
-
-# temporary files which can be created if a process still has a handle open of a deleted file
-.fuse_hidden*
-
-# KDE directory preferences
-.directory
-
-# Linux trash folder which might appear on any partition or disk
-.Trash-*
-### JetBrains template
-# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
-# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
-
-# User-specific stuff:
-.idea
-.idea/tasks.xml
-.idea/dictionaries
-.idea/vcs.xml
-.idea/jsLibraryMappings.xml
-
-# Sensitive or high-churn files:
-.idea/dataSources.ids
-.idea/dataSources.xml
-.idea/dataSources.local.xml
-.idea/sqlDataSources.xml
-.idea/dynamic.xml
-.idea/uiDesigner.xml
-
-# Gradle:
-.idea/gradle.xml
-.idea/libraries
-
-# Mongo Explorer plugin:
-.idea/mongoSettings.xml
-
-## File-based project format:
-*.iws
-
-## Plugin-specific files:
-
-# IntelliJ
-/out/
-
-# mpeltonen/sbt-idea plugin
-.idea_modules/
-
-# JIRA plugin
-atlassian-ide-plugin.xml
-
-# Crashlytics plugin (for Android Studio and IntelliJ)
-com_crashlytics_export_strings.xml
-crashlytics.properties
-crashlytics-build.properties
-fabric.properties
-### Xcode template
-# Xcode
-#
-# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
-
-## Build generated
-build/
-DerivedData/
-
-## Various settings
-*.pbxuser
-!default.pbxuser
-*.mode1v3
-!default.mode1v3
-*.mode2v3
-!default.mode2v3
-*.perspectivev3
-!default.perspectivev3
-xcuserdata/
-
-## Other
-*.moved-aside
-*.xccheckout
-*.xcscmblueprint
-### Eclipse template
-
-.metadata
-bin/
-tmp/
-*.tmp
-*.bak
-*.swp
-*~.nib
-local.properties
-.settings/
-.loadpath
-.recommenders
-
-# Eclipse Core
-.project
-
-# External tool builders
-.externalToolBuilders/
-
-# Locally stored "Eclipse launch configurations"
-*.launch
-
-# PyDev specific (Python IDE for Eclipse)
-*.pydevproject
-
-# CDT-specific (C/C++ Development Tooling)
-.cproject
-
-# JDT-specific (Eclipse Java Development Tools)
-.classpath
-
-# Java annotation processor (APT)
-.factorypath
-
-# PDT-specific (PHP Development Tools)
-.buildpath
-
-# sbteclipse plugin
-.target
-
-# Tern plugin
-.tern-project
-
-# TeXlipse plugin
-.texlipse
-
-# STS (Spring Tool Suite)
-.springBeans
-
-# Code Recommenders
-.recommenders/
-
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.travis.yml b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.travis.yml
deleted file mode 100644
index 2a845b96..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/.travis.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-sudo: false
-language: go
-# * github.com/grpc/grpc-go still supports go1.6
-# - When we drop support for go1.6 we can remove golang.org/x/net/context
-# below as it is part of the Go std library since go1.7
-# * github.com/prometheus/client_golang already requires at least go1.7 since
-# September 2017
-go:
- - 1.6.x
- - 1.7.x
- - 1.8.x
- - 1.9.x
- - 1.10.x
- - master
-
-install:
- - go get github.com/prometheus/client_golang/prometheus
- - go get google.golang.org/grpc
- - go get golang.org/x/net/context
- - go get github.com/stretchr/testify
-script:
- - make test
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/CHANGELOG.md b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/CHANGELOG.md
deleted file mode 100644
index 19a8059e..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/CHANGELOG.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# Changelog
-All notable changes to this project will be documented in this file.
-
-The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
-and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
-
-## [Unreleased]
-
-## [1.2.0](https://github.com/grpc-ecosystem/go-grpc-prometheus/releases/tag/v1.2.0) - 2018-06-04
-
-### Added
-
-* Provide metrics object as `prometheus.Collector`, for conventional metric registration.
-* Support non-default/global Prometheus registry.
-* Allow configuring counters with `prometheus.CounterOpts`.
-
-### Changed
-
-* Remove usage of deprecated `grpc.Code()`.
-* Remove usage of deprecated `grpc.Errorf` and replace with `status.Errorf`.
-
----
-
-This changelog was started with version `v1.2.0`, for earlier versions refer to the respective [GitHub releases](https://github.com/grpc-ecosystem/go-grpc-prometheus/releases).
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE
deleted file mode 100644
index b2b06503..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/README.md b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/README.md
deleted file mode 100644
index 499c5835..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/README.md
+++ /dev/null
@@ -1,247 +0,0 @@
-# Go gRPC Interceptors for Prometheus monitoring
-
-[](https://travis-ci.org/grpc-ecosystem/go-grpc-prometheus)
-[](http://goreportcard.com/report/grpc-ecosystem/go-grpc-prometheus)
-[](https://godoc.org/github.com/grpc-ecosystem/go-grpc-prometheus)
-[](https://sourcegraph.com/github.com/grpc-ecosystem/go-grpc-prometheus/?badge)
-[](https://codecov.io/gh/grpc-ecosystem/go-grpc-prometheus)
-[](LICENSE)
-
-[Prometheus](https://prometheus.io/) monitoring for your [gRPC Go](https://github.com/grpc/grpc-go) servers and clients.
-
-A sister implementation for [gRPC Java](https://github.com/grpc/grpc-java) (same metrics, same semantics) is in [grpc-ecosystem/java-grpc-prometheus](https://github.com/grpc-ecosystem/java-grpc-prometheus).
-
-## Interceptors
-
-[gRPC Go](https://github.com/grpc/grpc-go) recently acquired support for Interceptors, i.e. middleware that is executed
-by a gRPC Server before the request is passed onto the user's application logic. It is a perfect way to implement
-common patterns: auth, logging and... monitoring.
-
-To use Interceptors in chains, please see [`go-grpc-middleware`](https://github.com/mwitkow/go-grpc-middleware).
-
-## Usage
-
-There are two types of interceptors: client-side and server-side. This package provides monitoring Interceptors for both.
-
-### Server-side
-
-```go
-import "github.com/grpc-ecosystem/go-grpc-prometheus"
-...
- // Initialize your gRPC server's interceptor.
- myServer := grpc.NewServer(
- grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor),
- grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),
- )
- // Register your gRPC service implementations.
- myservice.RegisterMyServiceServer(s.server, &myServiceImpl{})
- // After all your registrations, make sure all of the Prometheus metrics are initialized.
- grpc_prometheus.Register(myServer)
- // Register Prometheus metrics handler.
- http.Handle("/metrics", promhttp.Handler())
-...
-```
-
-### Client-side
-
-```go
-import "github.com/grpc-ecosystem/go-grpc-prometheus"
-...
- clientConn, err = grpc.Dial(
- address,
- grpc.WithUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor),
- grpc.WithStreamInterceptor(grpc_prometheus.StreamClientInterceptor)
- )
- client = pb_testproto.NewTestServiceClient(clientConn)
- resp, err := client.PingEmpty(s.ctx, &myservice.Request{Msg: "hello"})
-...
-```
-
-# Metrics
-
-## Labels
-
-All server-side metrics start with `grpc_server` as Prometheus subsystem name. All client-side metrics start with `grpc_client`. Both of them have mirror-concepts. Similarly all methods
-contain the same rich labels:
-
- * `grpc_service` - the [gRPC service](http://www.grpc.io/docs/#defining-a-service) name, which is the combination of protobuf `package` and
- the `grpc_service` section name. E.g. for `package = mwitkow.testproto` and
- `service TestService` the label will be `grpc_service="mwitkow.testproto.TestService"`
- * `grpc_method` - the name of the method called on the gRPC service. E.g.
- `grpc_method="Ping"`
- * `grpc_type` - the gRPC [type of request](http://www.grpc.io/docs/guides/concepts.html#rpc-life-cycle).
- Differentiating between the two is important especially for latency measurements.
-
- - `unary` is single request, single response RPC
- - `client_stream` is a multi-request, single response RPC
- - `server_stream` is a single request, multi-response RPC
- - `bidi_stream` is a multi-request, multi-response RPC
-
-
-Additionally for completed RPCs, the following labels are used:
-
- * `grpc_code` - the human-readable [gRPC status code](https://github.com/grpc/grpc-go/blob/master/codes/codes.go).
- The list of all statuses is to long, but here are some common ones:
-
- - `OK` - means the RPC was successful
- - `IllegalArgument` - RPC contained bad values
- - `Internal` - server-side error not disclosed to the clients
-
-## Counters
-
-The counters and their up to date documentation is in [server_reporter.go](server_reporter.go) and [client_reporter.go](client_reporter.go)
-the respective Prometheus handler (usually `/metrics`).
-
-For the purpose of this documentation we will only discuss `grpc_server` metrics. The `grpc_client` ones contain mirror concepts.
-
-For simplicity, let's assume we're tracking a single server-side RPC call of [`mwitkow.testproto.TestService`](examples/testproto/test.proto),
-calling the method `PingList`. The call succeeds and returns 20 messages in the stream.
-
-First, immediately after the server receives the call it will increment the
-`grpc_server_started_total` and start the handling time clock (if histograms are enabled).
-
-```jsoniq
-grpc_server_started_total{grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1
-```
-
-Then the user logic gets invoked. It receives one message from the client containing the request
-(it's a `server_stream`):
-
-```jsoniq
-grpc_server_msg_received_total{grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1
-```
-
-The user logic may return an error, or send multiple messages back to the client. In this case, on
-each of the 20 messages sent back, a counter will be incremented:
-
-```jsoniq
-grpc_server_msg_sent_total{grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 20
-```
-
-After the call completes, its status (`OK` or other [gRPC status code](https://github.com/grpc/grpc-go/blob/master/codes/codes.go))
-and the relevant call labels increment the `grpc_server_handled_total` counter.
-
-```jsoniq
-grpc_server_handled_total{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1
-```
-
-## Histograms
-
-[Prometheus histograms](https://prometheus.io/docs/concepts/metric_types/#histogram) are a great way
-to measure latency distributions of your RPCs. However, since it is bad practice to have metrics
-of [high cardinality](https://prometheus.io/docs/practices/instrumentation/#do-not-overuse-labels)
-the latency monitoring metrics are disabled by default. To enable them please call the following
-in your server initialization code:
-
-```jsoniq
-grpc_prometheus.EnableHandlingTimeHistogram()
-```
-
-After the call completes, its handling time will be recorded in a [Prometheus histogram](https://prometheus.io/docs/concepts/metric_types/#histogram)
-variable `grpc_server_handling_seconds`. The histogram variable contains three sub-metrics:
-
- * `grpc_server_handling_seconds_count` - the count of all completed RPCs by status and method
- * `grpc_server_handling_seconds_sum` - cumulative time of RPCs by status and method, useful for
- calculating average handling times
- * `grpc_server_handling_seconds_bucket` - contains the counts of RPCs by status and method in respective
- handling-time buckets. These buckets can be used by Prometheus to estimate SLAs (see [here](https://prometheus.io/docs/practices/histograms/))
-
-The counter values will look as follows:
-
-```jsoniq
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.005"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.01"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.025"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.05"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.1"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.25"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="0.5"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="1"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="2.5"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="5"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="10"} 1
-grpc_server_handling_seconds_bucket{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream",le="+Inf"} 1
-grpc_server_handling_seconds_sum{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 0.0003866430000000001
-grpc_server_handling_seconds_count{grpc_code="OK",grpc_method="PingList",grpc_service="mwitkow.testproto.TestService",grpc_type="server_stream"} 1
-```
-
-
-## Useful query examples
-
-Prometheus philosophy is to provide raw metrics to the monitoring system, and
-let the aggregations be handled there. The verbosity of above metrics make it possible to have that
-flexibility. Here's a couple of useful monitoring queries:
-
-
-### request inbound rate
-```jsoniq
-sum(rate(grpc_server_started_total{job="foo"}[1m])) by (grpc_service)
-```
-For `job="foo"` (common label to differentiate between Prometheus monitoring targets), calculate the
-rate of requests per second (1 minute window) for each gRPC `grpc_service` that the job has. Please note
-how the `grpc_method` is being omitted here: all methods of a given gRPC service will be summed together.
-
-### unary request error rate
-```jsoniq
-sum(rate(grpc_server_handled_total{job="foo",grpc_type="unary",grpc_code!="OK"}[1m])) by (grpc_service)
-```
-For `job="foo"`, calculate the per-`grpc_service` rate of `unary` (1:1) RPCs that failed, i.e. the
-ones that didn't finish with `OK` code.
-
-### unary request error percentage
-```jsoniq
-sum(rate(grpc_server_handled_total{job="foo",grpc_type="unary",grpc_code!="OK"}[1m])) by (grpc_service)
- /
-sum(rate(grpc_server_started_total{job="foo",grpc_type="unary"}[1m])) by (grpc_service)
- * 100.0
-```
-For `job="foo"`, calculate the percentage of failed requests by service. It's easy to notice that
-this is a combination of the two above examples. This is an example of a query you would like to
-[alert on](https://prometheus.io/docs/alerting/rules/) in your system for SLA violations, e.g.
-"no more than 1% requests should fail".
-
-### average response stream size
-```jsoniq
-sum(rate(grpc_server_msg_sent_total{job="foo",grpc_type="server_stream"}[10m])) by (grpc_service)
- /
-sum(rate(grpc_server_started_total{job="foo",grpc_type="server_stream"}[10m])) by (grpc_service)
-```
-For `job="foo"` what is the `grpc_service`-wide `10m` average of messages returned for all `
-server_stream` RPCs. This allows you to track the stream sizes returned by your system, e.g. allows
-you to track when clients started to send "wide" queries that ret
-Note the divisor is the number of started RPCs, in order to account for in-flight requests.
-
-### 99%-tile latency of unary requests
-```jsoniq
-histogram_quantile(0.99,
- sum(rate(grpc_server_handling_seconds_bucket{job="foo",grpc_type="unary"}[5m])) by (grpc_service,le)
-)
-```
-For `job="foo"`, returns an 99%-tile [quantile estimation](https://prometheus.io/docs/practices/histograms/#quantiles)
-of the handling time of RPCs per service. Please note the `5m` rate, this means that the quantile
-estimation will take samples in a rolling `5m` window. When combined with other quantiles
-(e.g. 50%, 90%), this query gives you tremendous insight into the responsiveness of your system
-(e.g. impact of caching).
-
-### percentage of slow unary queries (>250ms)
-```jsoniq
-100.0 - (
-sum(rate(grpc_server_handling_seconds_bucket{job="foo",grpc_type="unary",le="0.25"}[5m])) by (grpc_service)
- /
-sum(rate(grpc_server_handling_seconds_count{job="foo",grpc_type="unary"}[5m])) by (grpc_service)
-) * 100.0
-```
-For `job="foo"` calculate the by-`grpc_service` fraction of slow requests that took longer than `0.25`
-seconds. This query is relatively complex, since the Prometheus aggregations use `le` (less or equal)
-buckets, meaning that counting "fast" requests fractions is easier. However, simple maths helps.
-This is an example of a query you would like to alert on in your system for SLA violations,
-e.g. "less than 1% of requests are slower than 250ms".
-
-
-## Status
-
-This code has been used since August 2015 as the basis for monitoring of *production* gRPC micro services at [Improbable](https://improbable.io).
-
-## License
-
-`go-grpc-prometheus` is released under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client.go
deleted file mode 100644
index 751a4c72..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-// gRPC Prometheus monitoring interceptors for client-side gRPC.
-
-package grpc_prometheus
-
-import (
- prom "github.com/prometheus/client_golang/prometheus"
-)
-
-var (
- // DefaultClientMetrics is the default instance of ClientMetrics. It is
- // intended to be used in conjunction the default Prometheus metrics
- // registry.
- DefaultClientMetrics = NewClientMetrics()
-
- // UnaryClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Unary RPCs.
- UnaryClientInterceptor = DefaultClientMetrics.UnaryClientInterceptor()
-
- // StreamClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Streaming RPCs.
- StreamClientInterceptor = DefaultClientMetrics.StreamClientInterceptor()
-)
-
-func init() {
- prom.MustRegister(DefaultClientMetrics.clientStartedCounter)
- prom.MustRegister(DefaultClientMetrics.clientHandledCounter)
- prom.MustRegister(DefaultClientMetrics.clientStreamMsgReceived)
- prom.MustRegister(DefaultClientMetrics.clientStreamMsgSent)
-}
-
-// EnableClientHandlingTimeHistogram turns on recording of handling time of
-// RPCs. Histogram metrics can be very expensive for Prometheus to retain and
-// query. This function acts on the DefaultClientMetrics variable and the
-// default Prometheus metrics registry.
-func EnableClientHandlingTimeHistogram(opts ...HistogramOption) {
- DefaultClientMetrics.EnableClientHandlingTimeHistogram(opts...)
- prom.Register(DefaultClientMetrics.clientHandledHistogram)
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_metrics.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_metrics.go
deleted file mode 100644
index 9b476f98..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_metrics.go
+++ /dev/null
@@ -1,170 +0,0 @@
-package grpc_prometheus
-
-import (
- "io"
-
- prom "github.com/prometheus/client_golang/prometheus"
- "golang.org/x/net/context"
- "google.golang.org/grpc"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
-)
-
-// ClientMetrics represents a collection of metrics to be registered on a
-// Prometheus metrics registry for a gRPC client.
-type ClientMetrics struct {
- clientStartedCounter *prom.CounterVec
- clientHandledCounter *prom.CounterVec
- clientStreamMsgReceived *prom.CounterVec
- clientStreamMsgSent *prom.CounterVec
- clientHandledHistogramEnabled bool
- clientHandledHistogramOpts prom.HistogramOpts
- clientHandledHistogram *prom.HistogramVec
-}
-
-// NewClientMetrics returns a ClientMetrics object. Use a new instance of
-// ClientMetrics when not using the default Prometheus metrics registry, for
-// example when wanting to control which metrics are added to a registry as
-// opposed to automatically adding metrics via init functions.
-func NewClientMetrics(counterOpts ...CounterOption) *ClientMetrics {
- opts := counterOptions(counterOpts)
- return &ClientMetrics{
- clientStartedCounter: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_client_started_total",
- Help: "Total number of RPCs started on the client.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
-
- clientHandledCounter: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_client_handled_total",
- Help: "Total number of RPCs completed by the client, regardless of success or failure.",
- }), []string{"grpc_type", "grpc_service", "grpc_method", "grpc_code"}),
-
- clientStreamMsgReceived: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_client_msg_received_total",
- Help: "Total number of RPC stream messages received by the client.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
-
- clientStreamMsgSent: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_client_msg_sent_total",
- Help: "Total number of gRPC stream messages sent by the client.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
-
- clientHandledHistogramEnabled: false,
- clientHandledHistogramOpts: prom.HistogramOpts{
- Name: "grpc_client_handling_seconds",
- Help: "Histogram of response latency (seconds) of the gRPC until it is finished by the application.",
- Buckets: prom.DefBuckets,
- },
- clientHandledHistogram: nil,
- }
-}
-
-// Describe sends the super-set of all possible descriptors of metrics
-// collected by this Collector to the provided channel and returns once
-// the last descriptor has been sent.
-func (m *ClientMetrics) Describe(ch chan<- *prom.Desc) {
- m.clientStartedCounter.Describe(ch)
- m.clientHandledCounter.Describe(ch)
- m.clientStreamMsgReceived.Describe(ch)
- m.clientStreamMsgSent.Describe(ch)
- if m.clientHandledHistogramEnabled {
- m.clientHandledHistogram.Describe(ch)
- }
-}
-
-// Collect is called by the Prometheus registry when collecting
-// metrics. The implementation sends each collected metric via the
-// provided channel and returns once the last metric has been sent.
-func (m *ClientMetrics) Collect(ch chan<- prom.Metric) {
- m.clientStartedCounter.Collect(ch)
- m.clientHandledCounter.Collect(ch)
- m.clientStreamMsgReceived.Collect(ch)
- m.clientStreamMsgSent.Collect(ch)
- if m.clientHandledHistogramEnabled {
- m.clientHandledHistogram.Collect(ch)
- }
-}
-
-// EnableClientHandlingTimeHistogram turns on recording of handling time of RPCs.
-// Histogram metrics can be very expensive for Prometheus to retain and query.
-func (m *ClientMetrics) EnableClientHandlingTimeHistogram(opts ...HistogramOption) {
- for _, o := range opts {
- o(&m.clientHandledHistogramOpts)
- }
- if !m.clientHandledHistogramEnabled {
- m.clientHandledHistogram = prom.NewHistogramVec(
- m.clientHandledHistogramOpts,
- []string{"grpc_type", "grpc_service", "grpc_method"},
- )
- }
- m.clientHandledHistogramEnabled = true
-}
-
-// UnaryClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Unary RPCs.
-func (m *ClientMetrics) UnaryClientInterceptor() func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
- return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
- monitor := newClientReporter(m, Unary, method)
- monitor.SentMessage()
- err := invoker(ctx, method, req, reply, cc, opts...)
- if err != nil {
- monitor.ReceivedMessage()
- }
- st, _ := status.FromError(err)
- monitor.Handled(st.Code())
- return err
- }
-}
-
-// StreamClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Streaming RPCs.
-func (m *ClientMetrics) StreamClientInterceptor() func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
- return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
- monitor := newClientReporter(m, clientStreamType(desc), method)
- clientStream, err := streamer(ctx, desc, cc, method, opts...)
- if err != nil {
- st, _ := status.FromError(err)
- monitor.Handled(st.Code())
- return nil, err
- }
- return &monitoredClientStream{clientStream, monitor}, nil
- }
-}
-
-func clientStreamType(desc *grpc.StreamDesc) grpcType {
- if desc.ClientStreams && !desc.ServerStreams {
- return ClientStream
- } else if !desc.ClientStreams && desc.ServerStreams {
- return ServerStream
- }
- return BidiStream
-}
-
-// monitoredClientStream wraps grpc.ClientStream allowing each Sent/Recv of message to increment counters.
-type monitoredClientStream struct {
- grpc.ClientStream
- monitor *clientReporter
-}
-
-func (s *monitoredClientStream) SendMsg(m interface{}) error {
- err := s.ClientStream.SendMsg(m)
- if err == nil {
- s.monitor.SentMessage()
- }
- return err
-}
-
-func (s *monitoredClientStream) RecvMsg(m interface{}) error {
- err := s.ClientStream.RecvMsg(m)
- if err == nil {
- s.monitor.ReceivedMessage()
- } else if err == io.EOF {
- s.monitor.Handled(codes.OK)
- } else {
- st, _ := status.FromError(err)
- s.monitor.Handled(st.Code())
- }
- return err
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_reporter.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_reporter.go
deleted file mode 100644
index cbf15322..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/client_reporter.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-package grpc_prometheus
-
-import (
- "time"
-
- "google.golang.org/grpc/codes"
-)
-
-type clientReporter struct {
- metrics *ClientMetrics
- rpcType grpcType
- serviceName string
- methodName string
- startTime time.Time
-}
-
-func newClientReporter(m *ClientMetrics, rpcType grpcType, fullMethod string) *clientReporter {
- r := &clientReporter{
- metrics: m,
- rpcType: rpcType,
- }
- if r.metrics.clientHandledHistogramEnabled {
- r.startTime = time.Now()
- }
- r.serviceName, r.methodName = splitMethodName(fullMethod)
- r.metrics.clientStartedCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
- return r
-}
-
-func (r *clientReporter) ReceivedMessage() {
- r.metrics.clientStreamMsgReceived.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
-}
-
-func (r *clientReporter) SentMessage() {
- r.metrics.clientStreamMsgSent.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
-}
-
-func (r *clientReporter) Handled(code codes.Code) {
- r.metrics.clientHandledCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName, code.String()).Inc()
- if r.metrics.clientHandledHistogramEnabled {
- r.metrics.clientHandledHistogram.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Observe(time.Since(r.startTime).Seconds())
- }
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/makefile b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/makefile
deleted file mode 100644
index 74c08422..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-SHELL="/bin/bash"
-
-GOFILES_NOVENDOR = $(shell go list ./... | grep -v /vendor/)
-
-all: vet fmt test
-
-fmt:
- go fmt $(GOFILES_NOVENDOR)
-
-vet:
- go vet $(GOFILES_NOVENDOR)
-
-test: vet
- ./scripts/test_all.sh
-
-.PHONY: all vet test
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/metric_options.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/metric_options.go
deleted file mode 100644
index 9d51aec9..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/metric_options.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package grpc_prometheus
-
-import (
- prom "github.com/prometheus/client_golang/prometheus"
-)
-
-// A CounterOption lets you add options to Counter metrics using With* funcs.
-type CounterOption func(*prom.CounterOpts)
-
-type counterOptions []CounterOption
-
-func (co counterOptions) apply(o prom.CounterOpts) prom.CounterOpts {
- for _, f := range co {
- f(&o)
- }
- return o
-}
-
-// WithConstLabels allows you to add ConstLabels to Counter metrics.
-func WithConstLabels(labels prom.Labels) CounterOption {
- return func(o *prom.CounterOpts) {
- o.ConstLabels = labels
- }
-}
-
-// A HistogramOption lets you add options to Histogram metrics using With*
-// funcs.
-type HistogramOption func(*prom.HistogramOpts)
-
-// WithHistogramBuckets allows you to specify custom bucket ranges for histograms if EnableHandlingTimeHistogram is on.
-func WithHistogramBuckets(buckets []float64) HistogramOption {
- return func(o *prom.HistogramOpts) { o.Buckets = buckets }
-}
-
-// WithHistogramConstLabels allows you to add custom ConstLabels to
-// histograms metrics.
-func WithHistogramConstLabels(labels prom.Labels) HistogramOption {
- return func(o *prom.HistogramOpts) {
- o.ConstLabels = labels
- }
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server.go
deleted file mode 100644
index 322f9904..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-// gRPC Prometheus monitoring interceptors for server-side gRPC.
-
-package grpc_prometheus
-
-import (
- prom "github.com/prometheus/client_golang/prometheus"
- "google.golang.org/grpc"
-)
-
-var (
- // DefaultServerMetrics is the default instance of ServerMetrics. It is
- // intended to be used in conjunction the default Prometheus metrics
- // registry.
- DefaultServerMetrics = NewServerMetrics()
-
- // UnaryServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Unary RPCs.
- UnaryServerInterceptor = DefaultServerMetrics.UnaryServerInterceptor()
-
- // StreamServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Streaming RPCs.
- StreamServerInterceptor = DefaultServerMetrics.StreamServerInterceptor()
-)
-
-func init() {
- prom.MustRegister(DefaultServerMetrics.serverStartedCounter)
- prom.MustRegister(DefaultServerMetrics.serverHandledCounter)
- prom.MustRegister(DefaultServerMetrics.serverStreamMsgReceived)
- prom.MustRegister(DefaultServerMetrics.serverStreamMsgSent)
-}
-
-// Register takes a gRPC server and pre-initializes all counters to 0. This
-// allows for easier monitoring in Prometheus (no missing metrics), and should
-// be called *after* all services have been registered with the server. This
-// function acts on the DefaultServerMetrics variable.
-func Register(server *grpc.Server) {
- DefaultServerMetrics.InitializeMetrics(server)
-}
-
-// EnableHandlingTimeHistogram turns on recording of handling time
-// of RPCs. Histogram metrics can be very expensive for Prometheus
-// to retain and query. This function acts on the DefaultServerMetrics
-// variable and the default Prometheus metrics registry.
-func EnableHandlingTimeHistogram(opts ...HistogramOption) {
- DefaultServerMetrics.EnableHandlingTimeHistogram(opts...)
- prom.Register(DefaultServerMetrics.serverHandledHistogram)
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go
deleted file mode 100644
index 5b1467e7..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_metrics.go
+++ /dev/null
@@ -1,185 +0,0 @@
-package grpc_prometheus
-
-import (
- prom "github.com/prometheus/client_golang/prometheus"
- "golang.org/x/net/context"
- "google.golang.org/grpc"
- "google.golang.org/grpc/status"
-)
-
-// ServerMetrics represents a collection of metrics to be registered on a
-// Prometheus metrics registry for a gRPC server.
-type ServerMetrics struct {
- serverStartedCounter *prom.CounterVec
- serverHandledCounter *prom.CounterVec
- serverStreamMsgReceived *prom.CounterVec
- serverStreamMsgSent *prom.CounterVec
- serverHandledHistogramEnabled bool
- serverHandledHistogramOpts prom.HistogramOpts
- serverHandledHistogram *prom.HistogramVec
-}
-
-// NewServerMetrics returns a ServerMetrics object. Use a new instance of
-// ServerMetrics when not using the default Prometheus metrics registry, for
-// example when wanting to control which metrics are added to a registry as
-// opposed to automatically adding metrics via init functions.
-func NewServerMetrics(counterOpts ...CounterOption) *ServerMetrics {
- opts := counterOptions(counterOpts)
- return &ServerMetrics{
- serverStartedCounter: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_server_started_total",
- Help: "Total number of RPCs started on the server.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
- serverHandledCounter: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_server_handled_total",
- Help: "Total number of RPCs completed on the server, regardless of success or failure.",
- }), []string{"grpc_type", "grpc_service", "grpc_method", "grpc_code"}),
- serverStreamMsgReceived: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_server_msg_received_total",
- Help: "Total number of RPC stream messages received on the server.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
- serverStreamMsgSent: prom.NewCounterVec(
- opts.apply(prom.CounterOpts{
- Name: "grpc_server_msg_sent_total",
- Help: "Total number of gRPC stream messages sent by the server.",
- }), []string{"grpc_type", "grpc_service", "grpc_method"}),
- serverHandledHistogramEnabled: false,
- serverHandledHistogramOpts: prom.HistogramOpts{
- Name: "grpc_server_handling_seconds",
- Help: "Histogram of response latency (seconds) of gRPC that had been application-level handled by the server.",
- Buckets: prom.DefBuckets,
- },
- serverHandledHistogram: nil,
- }
-}
-
-// EnableHandlingTimeHistogram enables histograms being registered when
-// registering the ServerMetrics on a Prometheus registry. Histograms can be
-// expensive on Prometheus servers. It takes options to configure histogram
-// options such as the defined buckets.
-func (m *ServerMetrics) EnableHandlingTimeHistogram(opts ...HistogramOption) {
- for _, o := range opts {
- o(&m.serverHandledHistogramOpts)
- }
- if !m.serverHandledHistogramEnabled {
- m.serverHandledHistogram = prom.NewHistogramVec(
- m.serverHandledHistogramOpts,
- []string{"grpc_type", "grpc_service", "grpc_method"},
- )
- }
- m.serverHandledHistogramEnabled = true
-}
-
-// Describe sends the super-set of all possible descriptors of metrics
-// collected by this Collector to the provided channel and returns once
-// the last descriptor has been sent.
-func (m *ServerMetrics) Describe(ch chan<- *prom.Desc) {
- m.serverStartedCounter.Describe(ch)
- m.serverHandledCounter.Describe(ch)
- m.serverStreamMsgReceived.Describe(ch)
- m.serverStreamMsgSent.Describe(ch)
- if m.serverHandledHistogramEnabled {
- m.serverHandledHistogram.Describe(ch)
- }
-}
-
-// Collect is called by the Prometheus registry when collecting
-// metrics. The implementation sends each collected metric via the
-// provided channel and returns once the last metric has been sent.
-func (m *ServerMetrics) Collect(ch chan<- prom.Metric) {
- m.serverStartedCounter.Collect(ch)
- m.serverHandledCounter.Collect(ch)
- m.serverStreamMsgReceived.Collect(ch)
- m.serverStreamMsgSent.Collect(ch)
- if m.serverHandledHistogramEnabled {
- m.serverHandledHistogram.Collect(ch)
- }
-}
-
-// UnaryServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Unary RPCs.
-func (m *ServerMetrics) UnaryServerInterceptor() func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
- return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
- monitor := newServerReporter(m, Unary, info.FullMethod)
- monitor.ReceivedMessage()
- resp, err := handler(ctx, req)
- st, _ := status.FromError(err)
- monitor.Handled(st.Code())
- if err == nil {
- monitor.SentMessage()
- }
- return resp, err
- }
-}
-
-// StreamServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Streaming RPCs.
-func (m *ServerMetrics) StreamServerInterceptor() func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
- return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
- monitor := newServerReporter(m, streamRPCType(info), info.FullMethod)
- err := handler(srv, &monitoredServerStream{ss, monitor})
- st, _ := status.FromError(err)
- monitor.Handled(st.Code())
- return err
- }
-}
-
-// InitializeMetrics initializes all metrics, with their appropriate null
-// value, for all gRPC methods registered on a gRPC server. This is useful, to
-// ensure that all metrics exist when collecting and querying.
-func (m *ServerMetrics) InitializeMetrics(server *grpc.Server) {
- serviceInfo := server.GetServiceInfo()
- for serviceName, info := range serviceInfo {
- for _, mInfo := range info.Methods {
- preRegisterMethod(m, serviceName, &mInfo)
- }
- }
-}
-
-func streamRPCType(info *grpc.StreamServerInfo) grpcType {
- if info.IsClientStream && !info.IsServerStream {
- return ClientStream
- } else if !info.IsClientStream && info.IsServerStream {
- return ServerStream
- }
- return BidiStream
-}
-
-// monitoredStream wraps grpc.ServerStream allowing each Sent/Recv of message to increment counters.
-type monitoredServerStream struct {
- grpc.ServerStream
- monitor *serverReporter
-}
-
-func (s *monitoredServerStream) SendMsg(m interface{}) error {
- err := s.ServerStream.SendMsg(m)
- if err == nil {
- s.monitor.SentMessage()
- }
- return err
-}
-
-func (s *monitoredServerStream) RecvMsg(m interface{}) error {
- err := s.ServerStream.RecvMsg(m)
- if err == nil {
- s.monitor.ReceivedMessage()
- }
- return err
-}
-
-// preRegisterMethod is invoked on Register of a Server, allowing all gRPC services labels to be pre-populated.
-func preRegisterMethod(metrics *ServerMetrics, serviceName string, mInfo *grpc.MethodInfo) {
- methodName := mInfo.Name
- methodType := string(typeFromMethodInfo(mInfo))
- // These are just references (no increments), as just referencing will create the labels but not set values.
- metrics.serverStartedCounter.GetMetricWithLabelValues(methodType, serviceName, methodName)
- metrics.serverStreamMsgReceived.GetMetricWithLabelValues(methodType, serviceName, methodName)
- metrics.serverStreamMsgSent.GetMetricWithLabelValues(methodType, serviceName, methodName)
- if metrics.serverHandledHistogramEnabled {
- metrics.serverHandledHistogram.GetMetricWithLabelValues(methodType, serviceName, methodName)
- }
- for _, code := range allCodes {
- metrics.serverHandledCounter.GetMetricWithLabelValues(methodType, serviceName, methodName, code.String())
- }
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_reporter.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_reporter.go
deleted file mode 100644
index aa9db540..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/server_reporter.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-package grpc_prometheus
-
-import (
- "time"
-
- "google.golang.org/grpc/codes"
-)
-
-type serverReporter struct {
- metrics *ServerMetrics
- rpcType grpcType
- serviceName string
- methodName string
- startTime time.Time
-}
-
-func newServerReporter(m *ServerMetrics, rpcType grpcType, fullMethod string) *serverReporter {
- r := &serverReporter{
- metrics: m,
- rpcType: rpcType,
- }
- if r.metrics.serverHandledHistogramEnabled {
- r.startTime = time.Now()
- }
- r.serviceName, r.methodName = splitMethodName(fullMethod)
- r.metrics.serverStartedCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
- return r
-}
-
-func (r *serverReporter) ReceivedMessage() {
- r.metrics.serverStreamMsgReceived.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
-}
-
-func (r *serverReporter) SentMessage() {
- r.metrics.serverStreamMsgSent.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Inc()
-}
-
-func (r *serverReporter) Handled(code codes.Code) {
- r.metrics.serverHandledCounter.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName, code.String()).Inc()
- if r.metrics.serverHandledHistogramEnabled {
- r.metrics.serverHandledHistogram.WithLabelValues(string(r.rpcType), r.serviceName, r.methodName).Observe(time.Since(r.startTime).Seconds())
- }
-}
diff --git a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go b/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go
deleted file mode 100644
index 7987de35..00000000
--- a/vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2016 Michal Witkowski. All Rights Reserved.
-// See LICENSE for licensing terms.
-
-package grpc_prometheus
-
-import (
- "strings"
-
- "google.golang.org/grpc"
- "google.golang.org/grpc/codes"
-)
-
-type grpcType string
-
-const (
- Unary grpcType = "unary"
- ClientStream grpcType = "client_stream"
- ServerStream grpcType = "server_stream"
- BidiStream grpcType = "bidi_stream"
-)
-
-var (
- allCodes = []codes.Code{
- codes.OK, codes.Canceled, codes.Unknown, codes.InvalidArgument, codes.DeadlineExceeded, codes.NotFound,
- codes.AlreadyExists, codes.PermissionDenied, codes.Unauthenticated, codes.ResourceExhausted,
- codes.FailedPrecondition, codes.Aborted, codes.OutOfRange, codes.Unimplemented, codes.Internal,
- codes.Unavailable, codes.DataLoss,
- }
-)
-
-func splitMethodName(fullMethodName string) (string, string) {
- fullMethodName = strings.TrimPrefix(fullMethodName, "/") // remove leading slash
- if i := strings.Index(fullMethodName, "/"); i >= 0 {
- return fullMethodName[:i], fullMethodName[i+1:]
- }
- return "unknown", "unknown"
-}
-
-func typeFromMethodInfo(mInfo *grpc.MethodInfo) grpcType {
- if !mInfo.IsClientStream && !mInfo.IsServerStream {
- return Unary
- }
- if mInfo.IsClientStream && !mInfo.IsServerStream {
- return ClientStream
- }
- if !mInfo.IsClientStream && mInfo.IsServerStream {
- return ServerStream
- }
- return BidiStream
-}
diff --git a/vendor/github.com/hashicorp/golang-lru/.gitignore b/vendor/github.com/hashicorp/golang-lru/.gitignore
deleted file mode 100644
index 83656241..00000000
--- a/vendor/github.com/hashicorp/golang-lru/.gitignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-*.test
diff --git a/vendor/github.com/hashicorp/golang-lru/2q.go b/vendor/github.com/hashicorp/golang-lru/2q.go
deleted file mode 100644
index e474cd07..00000000
--- a/vendor/github.com/hashicorp/golang-lru/2q.go
+++ /dev/null
@@ -1,223 +0,0 @@
-package lru
-
-import (
- "fmt"
- "sync"
-
- "github.com/hashicorp/golang-lru/simplelru"
-)
-
-const (
- // Default2QRecentRatio is the ratio of the 2Q cache dedicated
- // to recently added entries that have only been accessed once.
- Default2QRecentRatio = 0.25
-
- // Default2QGhostEntries is the default ratio of ghost
- // entries kept to track entries recently evicted
- Default2QGhostEntries = 0.50
-)
-
-// TwoQueueCache is a thread-safe fixed size 2Q cache.
-// 2Q is an enhancement over the standard LRU cache
-// in that it tracks both frequently and recently used
-// entries separately. This avoids a burst in access to new
-// entries from evicting frequently used entries. It adds some
-// additional tracking overhead to the standard LRU cache, and is
-// computationally about 2x the cost, and adds some metadata over
-// head. The ARCCache is similar, but does not require setting any
-// parameters.
-type TwoQueueCache struct {
- size int
- recentSize int
-
- recent simplelru.LRUCache
- frequent simplelru.LRUCache
- recentEvict simplelru.LRUCache
- lock sync.RWMutex
-}
-
-// New2Q creates a new TwoQueueCache using the default
-// values for the parameters.
-func New2Q(size int) (*TwoQueueCache, error) {
- return New2QParams(size, Default2QRecentRatio, Default2QGhostEntries)
-}
-
-// New2QParams creates a new TwoQueueCache using the provided
-// parameter values.
-func New2QParams(size int, recentRatio float64, ghostRatio float64) (*TwoQueueCache, error) {
- if size <= 0 {
- return nil, fmt.Errorf("invalid size")
- }
- if recentRatio < 0.0 || recentRatio > 1.0 {
- return nil, fmt.Errorf("invalid recent ratio")
- }
- if ghostRatio < 0.0 || ghostRatio > 1.0 {
- return nil, fmt.Errorf("invalid ghost ratio")
- }
-
- // Determine the sub-sizes
- recentSize := int(float64(size) * recentRatio)
- evictSize := int(float64(size) * ghostRatio)
-
- // Allocate the LRUs
- recent, err := simplelru.NewLRU(size, nil)
- if err != nil {
- return nil, err
- }
- frequent, err := simplelru.NewLRU(size, nil)
- if err != nil {
- return nil, err
- }
- recentEvict, err := simplelru.NewLRU(evictSize, nil)
- if err != nil {
- return nil, err
- }
-
- // Initialize the cache
- c := &TwoQueueCache{
- size: size,
- recentSize: recentSize,
- recent: recent,
- frequent: frequent,
- recentEvict: recentEvict,
- }
- return c, nil
-}
-
-// Get looks up a key's value from the cache.
-func (c *TwoQueueCache) Get(key interface{}) (value interface{}, ok bool) {
- c.lock.Lock()
- defer c.lock.Unlock()
-
- // Check if this is a frequent value
- if val, ok := c.frequent.Get(key); ok {
- return val, ok
- }
-
- // If the value is contained in recent, then we
- // promote it to frequent
- if val, ok := c.recent.Peek(key); ok {
- c.recent.Remove(key)
- c.frequent.Add(key, val)
- return val, ok
- }
-
- // No hit
- return nil, false
-}
-
-// Add adds a value to the cache.
-func (c *TwoQueueCache) Add(key, value interface{}) {
- c.lock.Lock()
- defer c.lock.Unlock()
-
- // Check if the value is frequently used already,
- // and just update the value
- if c.frequent.Contains(key) {
- c.frequent.Add(key, value)
- return
- }
-
- // Check if the value is recently used, and promote
- // the value into the frequent list
- if c.recent.Contains(key) {
- c.recent.Remove(key)
- c.frequent.Add(key, value)
- return
- }
-
- // If the value was recently evicted, add it to the
- // frequently used list
- if c.recentEvict.Contains(key) {
- c.ensureSpace(true)
- c.recentEvict.Remove(key)
- c.frequent.Add(key, value)
- return
- }
-
- // Add to the recently seen list
- c.ensureSpace(false)
- c.recent.Add(key, value)
- return
-}
-
-// ensureSpace is used to ensure we have space in the cache
-func (c *TwoQueueCache) ensureSpace(recentEvict bool) {
- // If we have space, nothing to do
- recentLen := c.recent.Len()
- freqLen := c.frequent.Len()
- if recentLen+freqLen < c.size {
- return
- }
-
- // If the recent buffer is larger than
- // the target, evict from there
- if recentLen > 0 && (recentLen > c.recentSize || (recentLen == c.recentSize && !recentEvict)) {
- k, _, _ := c.recent.RemoveOldest()
- c.recentEvict.Add(k, nil)
- return
- }
-
- // Remove from the frequent list otherwise
- c.frequent.RemoveOldest()
-}
-
-// Len returns the number of items in the cache.
-func (c *TwoQueueCache) Len() int {
- c.lock.RLock()
- defer c.lock.RUnlock()
- return c.recent.Len() + c.frequent.Len()
-}
-
-// Keys returns a slice of the keys in the cache.
-// The frequently used keys are first in the returned slice.
-func (c *TwoQueueCache) Keys() []interface{} {
- c.lock.RLock()
- defer c.lock.RUnlock()
- k1 := c.frequent.Keys()
- k2 := c.recent.Keys()
- return append(k1, k2...)
-}
-
-// Remove removes the provided key from the cache.
-func (c *TwoQueueCache) Remove(key interface{}) {
- c.lock.Lock()
- defer c.lock.Unlock()
- if c.frequent.Remove(key) {
- return
- }
- if c.recent.Remove(key) {
- return
- }
- if c.recentEvict.Remove(key) {
- return
- }
-}
-
-// Purge is used to completely clear the cache.
-func (c *TwoQueueCache) Purge() {
- c.lock.Lock()
- defer c.lock.Unlock()
- c.recent.Purge()
- c.frequent.Purge()
- c.recentEvict.Purge()
-}
-
-// Contains is used to check if the cache contains a key
-// without updating recency or frequency.
-func (c *TwoQueueCache) Contains(key interface{}) bool {
- c.lock.RLock()
- defer c.lock.RUnlock()
- return c.frequent.Contains(key) || c.recent.Contains(key)
-}
-
-// Peek is used to inspect the cache value of a key
-// without updating recency or frequency.
-func (c *TwoQueueCache) Peek(key interface{}) (value interface{}, ok bool) {
- c.lock.RLock()
- defer c.lock.RUnlock()
- if val, ok := c.frequent.Peek(key); ok {
- return val, ok
- }
- return c.recent.Peek(key)
-}
diff --git a/vendor/github.com/hashicorp/golang-lru/LICENSE b/vendor/github.com/hashicorp/golang-lru/LICENSE
deleted file mode 100644
index be2cc4df..00000000
--- a/vendor/github.com/hashicorp/golang-lru/LICENSE
+++ /dev/null
@@ -1,362 +0,0 @@
-Mozilla Public License, version 2.0
-
-1. Definitions
-
-1.1. "Contributor"
-
- means each individual or legal entity that creates, contributes to the
- creation of, or owns Covered Software.
-
-1.2. "Contributor Version"
-
- means the combination of the Contributions of others (if any) used by a
- Contributor and that particular Contributor's Contribution.
-
-1.3. "Contribution"
-
- means Covered Software of a particular Contributor.
-
-1.4. "Covered Software"
-
- means Source Code Form to which the initial Contributor has attached the
- notice in Exhibit A, the Executable Form of such Source Code Form, and
- Modifications of such Source Code Form, in each case including portions
- thereof.
-
-1.5. "Incompatible With Secondary Licenses"
- means
-
- a. that the initial Contributor has attached the notice described in
- Exhibit B to the Covered Software; or
-
- b. that the Covered Software was made available under the terms of
- version 1.1 or earlier of the License, but not also under the terms of
- a Secondary License.
-
-1.6. "Executable Form"
-
- means any form of the work other than Source Code Form.
-
-1.7. "Larger Work"
-
- means a work that combines Covered Software with other material, in a
- separate file or files, that is not Covered Software.
-
-1.8. "License"
-
- means this document.
-
-1.9. "Licensable"
-
- means having the right to grant, to the maximum extent possible, whether
- at the time of the initial grant or subsequently, any and all of the
- rights conveyed by this License.
-
-1.10. "Modifications"
-
- means any of the following:
-
- a. any file in Source Code Form that results from an addition to,
- deletion from, or modification of the contents of Covered Software; or
-
- b. any new file in Source Code Form that contains any Covered Software.
-
-1.11. "Patent Claims" of a Contributor
-
- means any patent claim(s), including without limitation, method,
- process, and apparatus claims, in any patent Licensable by such
- Contributor that would be infringed, but for the grant of the License,
- by the making, using, selling, offering for sale, having made, import,
- or transfer of either its Contributions or its Contributor Version.
-
-1.12. "Secondary License"
-
- means either the GNU General Public License, Version 2.0, the GNU Lesser
- General Public License, Version 2.1, the GNU Affero General Public
- License, Version 3.0, or any later versions of those licenses.
-
-1.13. "Source Code Form"
-
- means the form of the work preferred for making modifications.
-
-1.14. "You" (or "Your")
-
- means an individual or a legal entity exercising rights under this
- License. For legal entities, "You" includes any entity that controls, is
- controlled by, or is under common control with You. For purposes of this
- definition, "control" means (a) the power, direct or indirect, to cause
- the direction or management of such entity, whether by contract or
- otherwise, or (b) ownership of more than fifty percent (50%) of the
- outstanding shares or beneficial ownership of such entity.
-
-
-2. License Grants and Conditions
-
-2.1. Grants
-
- Each Contributor hereby grants You a world-wide, royalty-free,
- non-exclusive license:
-
- a. under intellectual property rights (other than patent or trademark)
- Licensable by such Contributor to use, reproduce, make available,
- modify, display, perform, distribute, and otherwise exploit its
- Contributions, either on an unmodified basis, with Modifications, or
- as part of a Larger Work; and
-
- b. under Patent Claims of such Contributor to make, use, sell, offer for
- sale, have made, import, and otherwise transfer either its
- Contributions or its Contributor Version.
-
-2.2. Effective Date
-
- The licenses granted in Section 2.1 with respect to any Contribution
- become effective for each Contribution on the date the Contributor first
- distributes such Contribution.
-
-2.3. Limitations on Grant Scope
-
- The licenses granted in this Section 2 are the only rights granted under
- this License. No additional rights or licenses will be implied from the
- distribution or licensing of Covered Software under this License.
- Notwithstanding Section 2.1(b) above, no patent license is granted by a
- Contributor:
-
- a. for any code that a Contributor has removed from Covered Software; or
-
- b. for infringements caused by: (i) Your and any other third party's
- modifications of Covered Software, or (ii) the combination of its
- Contributions with other software (except as part of its Contributor
- Version); or
-
- c. under Patent Claims infringed by Covered Software in the absence of
- its Contributions.
-
- This License does not grant any rights in the trademarks, service marks,
- or logos of any Contributor (except as may be necessary to comply with
- the notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
- No Contributor makes additional grants as a result of Your choice to
- distribute the Covered Software under a subsequent version of this
- License (see Section 10.2) or under the terms of a Secondary License (if
- permitted under the terms of Section 3.3).
-
-2.5. Representation
-
- Each Contributor represents that the Contributor believes its
- Contributions are its original creation(s) or it has sufficient rights to
- grant the rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
- This License is not intended to limit any rights You have under
- applicable copyright doctrines of fair use, fair dealing, or other
- equivalents.
-
-2.7. Conditions
-
- Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
- Section 2.1.
-
-
-3. Responsibilities
-
-3.1. Distribution of Source Form
-
- All distribution of Covered Software in Source Code Form, including any
- Modifications that You create or to which You contribute, must be under
- the terms of this License. You must inform recipients that the Source
- Code Form of the Covered Software is governed by the terms of this
- License, and how they can obtain a copy of this License. You may not
- attempt to alter or restrict the recipients' rights in the Source Code
- Form.
-
-3.2. Distribution of Executable Form
-
- If You distribute Covered Software in Executable Form then:
-
- a. such Covered Software must also be made available in Source Code Form,
- as described in Section 3.1, and You must inform recipients of the
- Executable Form how they can obtain a copy of such Source Code Form by
- reasonable means in a timely manner, at a charge no more than the cost
- of distribution to the recipient; and
-
- b. You may distribute such Executable Form under the terms of this
- License, or sublicense it under different terms, provided that the
- license for the Executable Form does not attempt to limit or alter the
- recipients' rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
- You may create and distribute a Larger Work under terms of Your choice,
- provided that You also comply with the requirements of this License for
- the Covered Software. If the Larger Work is a combination of Covered
- Software with a work governed by one or more Secondary Licenses, and the
- Covered Software is not Incompatible With Secondary Licenses, this
- License permits You to additionally distribute such Covered Software
- under the terms of such Secondary License(s), so that the recipient of
- the Larger Work may, at their option, further distribute the Covered
- Software under the terms of either this License or such Secondary
- License(s).
-
-3.4. Notices
-
- You may not remove or alter the substance of any license notices
- (including copyright notices, patent notices, disclaimers of warranty, or
- limitations of liability) contained within the Source Code Form of the
- Covered Software, except that You may alter any license notices to the
- extent required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
- You may choose to offer, and to charge a fee for, warranty, support,
- indemnity or liability obligations to one or more recipients of Covered
- Software. However, You may do so only on Your own behalf, and not on
- behalf of any Contributor. You must make it absolutely clear that any
- such warranty, support, indemnity, or liability obligation is offered by
- You alone, and You hereby agree to indemnify every Contributor for any
- liability incurred by such Contributor as a result of warranty, support,
- indemnity or liability terms You offer. You may include additional
- disclaimers of warranty and limitations of liability specific to any
- jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
-
- If it is impossible for You to comply with any of the terms of this License
- with respect to some or all of the Covered Software due to statute,
- judicial order, or regulation then You must: (a) comply with the terms of
- this License to the maximum extent possible; and (b) describe the
- limitations and the code they affect. Such description must be placed in a
- text file included with all distributions of the Covered Software under
- this License. Except to the extent prohibited by statute or regulation,
- such description must be sufficiently detailed for a recipient of ordinary
- skill to be able to understand it.
-
-5. Termination
-
-5.1. The rights granted under this License will terminate automatically if You
- fail to comply with any of its terms. However, if You become compliant,
- then the rights granted under this License from a particular Contributor
- are reinstated (a) provisionally, unless and until such Contributor
- explicitly and finally terminates Your grants, and (b) on an ongoing
- basis, if such Contributor fails to notify You of the non-compliance by
- some reasonable means prior to 60 days after You have come back into
- compliance. Moreover, Your grants from a particular Contributor are
- reinstated on an ongoing basis if such Contributor notifies You of the
- non-compliance by some reasonable means, this is the first time You have
- received notice of non-compliance with this License from such
- Contributor, and You become compliant prior to 30 days after Your receipt
- of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
- infringement claim (excluding declaratory judgment actions,
- counter-claims, and cross-claims) alleging that a Contributor Version
- directly or indirectly infringes any patent, then the rights granted to
- You by any and all Contributors for the Covered Software under Section
- 2.1 of this License shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
- license agreements (excluding distributors and resellers) which have been
- validly granted by You or Your distributors under this License prior to
- termination shall survive termination.
-
-6. Disclaimer of Warranty
-
- Covered Software is provided under this License on an "as is" basis,
- without warranty of any kind, either expressed, implied, or statutory,
- including, without limitation, warranties that the Covered Software is free
- of defects, merchantable, fit for a particular purpose or non-infringing.
- The entire risk as to the quality and performance of the Covered Software
- is with You. Should any Covered Software prove defective in any respect,
- You (not any Contributor) assume the cost of any necessary servicing,
- repair, or correction. This disclaimer of warranty constitutes an essential
- part of this License. No use of any Covered Software is authorized under
- this License except under this disclaimer.
-
-7. Limitation of Liability
-
- Under no circumstances and under no legal theory, whether tort (including
- negligence), contract, or otherwise, shall any Contributor, or anyone who
- distributes Covered Software as permitted above, be liable to You for any
- direct, indirect, special, incidental, or consequential damages of any
- character including, without limitation, damages for lost profits, loss of
- goodwill, work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses, even if such party shall have been
- informed of the possibility of such damages. This limitation of liability
- shall not apply to liability for death or personal injury resulting from
- such party's negligence to the extent applicable law prohibits such
- limitation. Some jurisdictions do not allow the exclusion or limitation of
- incidental or consequential damages, so this exclusion and limitation may
- not apply to You.
-
-8. Litigation
-
- Any litigation relating to this License may be brought only in the courts
- of a jurisdiction where the defendant maintains its principal place of
- business and such litigation shall be governed by laws of that
- jurisdiction, without reference to its conflict-of-law provisions. Nothing
- in this Section shall prevent a party's ability to bring cross-claims or
- counter-claims.
-
-9. Miscellaneous
-
- This License represents the complete agreement concerning the subject
- matter hereof. If any provision of this License is held to be
- unenforceable, such provision shall be reformed only to the extent
- necessary to make it enforceable. Any law or regulation which provides that
- the language of a contract shall be construed against the drafter shall not
- be used to construe this License against a Contributor.
-
-
-10. Versions of the License
-
-10.1. New Versions
-
- Mozilla Foundation is the license steward. Except as provided in Section
- 10.3, no one other than the license steward has the right to modify or
- publish new versions of this License. Each version will be given a
- distinguishing version number.
-
-10.2. Effect of New Versions
-
- You may distribute the Covered Software under the terms of the version
- of the License under which You originally received the Covered Software,
- or under the terms of any subsequent version published by the license
- steward.
-
-10.3. Modified Versions
-
- If you create software not governed by this License, and you want to
- create a new license for such software, you may create and use a
- modified version of this License if you rename the license and remove
- any references to the name of the license steward (except to note that
- such modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary
- Licenses If You choose to distribute Source Code Form that is
- Incompatible With Secondary Licenses under the terms of this version of
- the License, the notice described in Exhibit B of this License must be
- attached.
-
-Exhibit A - Source Code Form License Notice
-
- This Source Code Form is subject to the
- terms of the Mozilla Public License, v.
- 2.0. If a copy of the MPL was not
- distributed with this file, You can
- obtain one at
- http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular file,
-then You may include the notice in a location (such as a LICENSE file in a
-relevant directory) where a recipient would be likely to look for such a
-notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - "Incompatible With Secondary Licenses" Notice
-
- This Source Code Form is "Incompatible
- With Secondary Licenses", as defined by
- the Mozilla Public License, v. 2.0.
diff --git a/vendor/github.com/hashicorp/golang-lru/README.md b/vendor/github.com/hashicorp/golang-lru/README.md
deleted file mode 100644
index 33e58cfa..00000000
--- a/vendor/github.com/hashicorp/golang-lru/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-golang-lru
-==========
-
-This provides the `lru` package which implements a fixed-size
-thread safe LRU cache. It is based on the cache in Groupcache.
-
-Documentation
-=============
-
-Full docs are available on [Godoc](http://godoc.org/github.com/hashicorp/golang-lru)
-
-Example
-=======
-
-Using the LRU is very simple:
-
-```go
-l, _ := New(128)
-for i := 0; i < 256; i++ {
- l.Add(i, nil)
-}
-if l.Len() != 128 {
- panic(fmt.Sprintf("bad len: %v", l.Len()))
-}
-```
diff --git a/vendor/github.com/hashicorp/golang-lru/arc.go b/vendor/github.com/hashicorp/golang-lru/arc.go
deleted file mode 100644
index 555225a2..00000000
--- a/vendor/github.com/hashicorp/golang-lru/arc.go
+++ /dev/null
@@ -1,257 +0,0 @@
-package lru
-
-import (
- "sync"
-
- "github.com/hashicorp/golang-lru/simplelru"
-)
-
-// ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC).
-// ARC is an enhancement over the standard LRU cache in that tracks both
-// frequency and recency of use. This avoids a burst in access to new
-// entries from evicting the frequently used older entries. It adds some
-// additional tracking overhead to a standard LRU cache, computationally
-// it is roughly 2x the cost, and the extra memory overhead is linear
-// with the size of the cache. ARC has been patented by IBM, but is
-// similar to the TwoQueueCache (2Q) which requires setting parameters.
-type ARCCache struct {
- size int // Size is the total capacity of the cache
- p int // P is the dynamic preference towards T1 or T2
-
- t1 simplelru.LRUCache // T1 is the LRU for recently accessed items
- b1 simplelru.LRUCache // B1 is the LRU for evictions from t1
-
- t2 simplelru.LRUCache // T2 is the LRU for frequently accessed items
- b2 simplelru.LRUCache // B2 is the LRU for evictions from t2
-
- lock sync.RWMutex
-}
-
-// NewARC creates an ARC of the given size
-func NewARC(size int) (*ARCCache, error) {
- // Create the sub LRUs
- b1, err := simplelru.NewLRU(size, nil)
- if err != nil {
- return nil, err
- }
- b2, err := simplelru.NewLRU(size, nil)
- if err != nil {
- return nil, err
- }
- t1, err := simplelru.NewLRU(size, nil)
- if err != nil {
- return nil, err
- }
- t2, err := simplelru.NewLRU(size, nil)
- if err != nil {
- return nil, err
- }
-
- // Initialize the ARC
- c := &ARCCache{
- size: size,
- p: 0,
- t1: t1,
- b1: b1,
- t2: t2,
- b2: b2,
- }
- return c, nil
-}
-
-// Get looks up a key's value from the cache.
-func (c *ARCCache) Get(key interface{}) (value interface{}, ok bool) {
- c.lock.Lock()
- defer c.lock.Unlock()
-
- // If the value is contained in T1 (recent), then
- // promote it to T2 (frequent)
- if val, ok := c.t1.Peek(key); ok {
- c.t1.Remove(key)
- c.t2.Add(key, val)
- return val, ok
- }
-
- // Check if the value is contained in T2 (frequent)
- if val, ok := c.t2.Get(key); ok {
- return val, ok
- }
-
- // No hit
- return nil, false
-}
-
-// Add adds a value to the cache.
-func (c *ARCCache) Add(key, value interface{}) {
- c.lock.Lock()
- defer c.lock.Unlock()
-
- // Check if the value is contained in T1 (recent), and potentially
- // promote it to frequent T2
- if c.t1.Contains(key) {
- c.t1.Remove(key)
- c.t2.Add(key, value)
- return
- }
-
- // Check if the value is already in T2 (frequent) and update it
- if c.t2.Contains(key) {
- c.t2.Add(key, value)
- return
- }
-
- // Check if this value was recently evicted as part of the
- // recently used list
- if c.b1.Contains(key) {
- // T1 set is too small, increase P appropriately
- delta := 1
- b1Len := c.b1.Len()
- b2Len := c.b2.Len()
- if b2Len > b1Len {
- delta = b2Len / b1Len
- }
- if c.p+delta >= c.size {
- c.p = c.size
- } else {
- c.p += delta
- }
-
- // Potentially need to make room in the cache
- if c.t1.Len()+c.t2.Len() >= c.size {
- c.replace(false)
- }
-
- // Remove from B1
- c.b1.Remove(key)
-
- // Add the key to the frequently used list
- c.t2.Add(key, value)
- return
- }
-
- // Check if this value was recently evicted as part of the
- // frequently used list
- if c.b2.Contains(key) {
- // T2 set is too small, decrease P appropriately
- delta := 1
- b1Len := c.b1.Len()
- b2Len := c.b2.Len()
- if b1Len > b2Len {
- delta = b1Len / b2Len
- }
- if delta >= c.p {
- c.p = 0
- } else {
- c.p -= delta
- }
-
- // Potentially need to make room in the cache
- if c.t1.Len()+c.t2.Len() >= c.size {
- c.replace(true)
- }
-
- // Remove from B2
- c.b2.Remove(key)
-
- // Add the key to the frequently used list
- c.t2.Add(key, value)
- return
- }
-
- // Potentially need to make room in the cache
- if c.t1.Len()+c.t2.Len() >= c.size {
- c.replace(false)
- }
-
- // Keep the size of the ghost buffers trim
- if c.b1.Len() > c.size-c.p {
- c.b1.RemoveOldest()
- }
- if c.b2.Len() > c.p {
- c.b2.RemoveOldest()
- }
-
- // Add to the recently seen list
- c.t1.Add(key, value)
- return
-}
-
-// replace is used to adaptively evict from either T1 or T2
-// based on the current learned value of P
-func (c *ARCCache) replace(b2ContainsKey bool) {
- t1Len := c.t1.Len()
- if t1Len > 0 && (t1Len > c.p || (t1Len == c.p && b2ContainsKey)) {
- k, _, ok := c.t1.RemoveOldest()
- if ok {
- c.b1.Add(k, nil)
- }
- } else {
- k, _, ok := c.t2.RemoveOldest()
- if ok {
- c.b2.Add(k, nil)
- }
- }
-}
-
-// Len returns the number of cached entries
-func (c *ARCCache) Len() int {
- c.lock.RLock()
- defer c.lock.RUnlock()
- return c.t1.Len() + c.t2.Len()
-}
-
-// Keys returns all the cached keys
-func (c *ARCCache) Keys() []interface{} {
- c.lock.RLock()
- defer c.lock.RUnlock()
- k1 := c.t1.Keys()
- k2 := c.t2.Keys()
- return append(k1, k2...)
-}
-
-// Remove is used to purge a key from the cache
-func (c *ARCCache) Remove(key interface{}) {
- c.lock.Lock()
- defer c.lock.Unlock()
- if c.t1.Remove(key) {
- return
- }
- if c.t2.Remove(key) {
- return
- }
- if c.b1.Remove(key) {
- return
- }
- if c.b2.Remove(key) {
- return
- }
-}
-
-// Purge is used to clear the cache
-func (c *ARCCache) Purge() {
- c.lock.Lock()
- defer c.lock.Unlock()
- c.t1.Purge()
- c.t2.Purge()
- c.b1.Purge()
- c.b2.Purge()
-}
-
-// Contains is used to check if the cache contains a key
-// without updating recency or frequency.
-func (c *ARCCache) Contains(key interface{}) bool {
- c.lock.RLock()
- defer c.lock.RUnlock()
- return c.t1.Contains(key) || c.t2.Contains(key)
-}
-
-// Peek is used to inspect the cache value of a key
-// without updating recency or frequency.
-func (c *ARCCache) Peek(key interface{}) (value interface{}, ok bool) {
- c.lock.RLock()
- defer c.lock.RUnlock()
- if val, ok := c.t1.Peek(key); ok {
- return val, ok
- }
- return c.t2.Peek(key)
-}
diff --git a/vendor/github.com/hashicorp/golang-lru/doc.go b/vendor/github.com/hashicorp/golang-lru/doc.go
deleted file mode 100644
index 2547df97..00000000
--- a/vendor/github.com/hashicorp/golang-lru/doc.go
+++ /dev/null
@@ -1,21 +0,0 @@
-// Package lru provides three different LRU caches of varying sophistication.
-//
-// Cache is a simple LRU cache. It is based on the
-// LRU implementation in groupcache:
-// https://github.com/golang/groupcache/tree/master/lru
-//
-// TwoQueueCache tracks frequently used and recently used entries separately.
-// This avoids a burst of accesses from taking out frequently used entries,
-// at the cost of about 2x computational overhead and some extra bookkeeping.
-//
-// ARCCache is an adaptive replacement cache. It tracks recent evictions as
-// well as recent usage in both the frequent and recent caches. Its
-// computational overhead is comparable to TwoQueueCache, but the memory
-// overhead is linear with the size of the cache.
-//
-// ARC has been patented by IBM, so do not use it if that is problematic for
-// your program.
-//
-// All caches in this package take locks while operating, and are therefore
-// thread-safe for consumers.
-package lru
diff --git a/vendor/github.com/hashicorp/golang-lru/go.mod b/vendor/github.com/hashicorp/golang-lru/go.mod
deleted file mode 100644
index 824cb97e..00000000
--- a/vendor/github.com/hashicorp/golang-lru/go.mod
+++ /dev/null
@@ -1 +0,0 @@
-module github.com/hashicorp/golang-lru
diff --git a/vendor/github.com/hashicorp/golang-lru/lru.go b/vendor/github.com/hashicorp/golang-lru/lru.go
deleted file mode 100644
index 1cbe04b7..00000000
--- a/vendor/github.com/hashicorp/golang-lru/lru.go
+++ /dev/null
@@ -1,116 +0,0 @@
-package lru
-
-import (
- "sync"
-
- "github.com/hashicorp/golang-lru/simplelru"
-)
-
-// Cache is a thread-safe fixed size LRU cache.
-type Cache struct {
- lru simplelru.LRUCache
- lock sync.RWMutex
-}
-
-// New creates an LRU of the given size.
-func New(size int) (*Cache, error) {
- return NewWithEvict(size, nil)
-}
-
-// NewWithEvict constructs a fixed size cache with the given eviction
-// callback.
-func NewWithEvict(size int, onEvicted func(key interface{}, value interface{})) (*Cache, error) {
- lru, err := simplelru.NewLRU(size, simplelru.EvictCallback(onEvicted))
- if err != nil {
- return nil, err
- }
- c := &Cache{
- lru: lru,
- }
- return c, nil
-}
-
-// Purge is used to completely clear the cache.
-func (c *Cache) Purge() {
- c.lock.Lock()
- c.lru.Purge()
- c.lock.Unlock()
-}
-
-// Add adds a value to the cache. Returns true if an eviction occurred.
-func (c *Cache) Add(key, value interface{}) (evicted bool) {
- c.lock.Lock()
- evicted = c.lru.Add(key, value)
- c.lock.Unlock()
- return evicted
-}
-
-// Get looks up a key's value from the cache.
-func (c *Cache) Get(key interface{}) (value interface{}, ok bool) {
- c.lock.Lock()
- value, ok = c.lru.Get(key)
- c.lock.Unlock()
- return value, ok
-}
-
-// Contains checks if a key is in the cache, without updating the
-// recent-ness or deleting it for being stale.
-func (c *Cache) Contains(key interface{}) bool {
- c.lock.RLock()
- containKey := c.lru.Contains(key)
- c.lock.RUnlock()
- return containKey
-}
-
-// Peek returns the key value (or undefined if not found) without updating
-// the "recently used"-ness of the key.
-func (c *Cache) Peek(key interface{}) (value interface{}, ok bool) {
- c.lock.RLock()
- value, ok = c.lru.Peek(key)
- c.lock.RUnlock()
- return value, ok
-}
-
-// ContainsOrAdd checks if a key is in the cache without updating the
-// recent-ness or deleting it for being stale, and if not, adds the value.
-// Returns whether found and whether an eviction occurred.
-func (c *Cache) ContainsOrAdd(key, value interface{}) (ok, evicted bool) {
- c.lock.Lock()
- defer c.lock.Unlock()
-
- if c.lru.Contains(key) {
- return true, false
- }
- evicted = c.lru.Add(key, value)
- return false, evicted
-}
-
-// Remove removes the provided key from the cache.
-func (c *Cache) Remove(key interface{}) {
- c.lock.Lock()
- c.lru.Remove(key)
- c.lock.Unlock()
-}
-
-// RemoveOldest removes the oldest item from the cache.
-func (c *Cache) RemoveOldest() {
- c.lock.Lock()
- c.lru.RemoveOldest()
- c.lock.Unlock()
-}
-
-// Keys returns a slice of the keys in the cache, from oldest to newest.
-func (c *Cache) Keys() []interface{} {
- c.lock.RLock()
- keys := c.lru.Keys()
- c.lock.RUnlock()
- return keys
-}
-
-// Len returns the number of items in the cache.
-func (c *Cache) Len() int {
- c.lock.RLock()
- length := c.lru.Len()
- c.lock.RUnlock()
- return length
-}
diff --git a/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go b/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go
deleted file mode 100644
index 5673773b..00000000
--- a/vendor/github.com/hashicorp/golang-lru/simplelru/lru.go
+++ /dev/null
@@ -1,161 +0,0 @@
-package simplelru
-
-import (
- "container/list"
- "errors"
-)
-
-// EvictCallback is used to get a callback when a cache entry is evicted
-type EvictCallback func(key interface{}, value interface{})
-
-// LRU implements a non-thread safe fixed size LRU cache
-type LRU struct {
- size int
- evictList *list.List
- items map[interface{}]*list.Element
- onEvict EvictCallback
-}
-
-// entry is used to hold a value in the evictList
-type entry struct {
- key interface{}
- value interface{}
-}
-
-// NewLRU constructs an LRU of the given size
-func NewLRU(size int, onEvict EvictCallback) (*LRU, error) {
- if size <= 0 {
- return nil, errors.New("Must provide a positive size")
- }
- c := &LRU{
- size: size,
- evictList: list.New(),
- items: make(map[interface{}]*list.Element),
- onEvict: onEvict,
- }
- return c, nil
-}
-
-// Purge is used to completely clear the cache.
-func (c *LRU) Purge() {
- for k, v := range c.items {
- if c.onEvict != nil {
- c.onEvict(k, v.Value.(*entry).value)
- }
- delete(c.items, k)
- }
- c.evictList.Init()
-}
-
-// Add adds a value to the cache. Returns true if an eviction occurred.
-func (c *LRU) Add(key, value interface{}) (evicted bool) {
- // Check for existing item
- if ent, ok := c.items[key]; ok {
- c.evictList.MoveToFront(ent)
- ent.Value.(*entry).value = value
- return false
- }
-
- // Add new item
- ent := &entry{key, value}
- entry := c.evictList.PushFront(ent)
- c.items[key] = entry
-
- evict := c.evictList.Len() > c.size
- // Verify size not exceeded
- if evict {
- c.removeOldest()
- }
- return evict
-}
-
-// Get looks up a key's value from the cache.
-func (c *LRU) Get(key interface{}) (value interface{}, ok bool) {
- if ent, ok := c.items[key]; ok {
- c.evictList.MoveToFront(ent)
- return ent.Value.(*entry).value, true
- }
- return
-}
-
-// Contains checks if a key is in the cache, without updating the recent-ness
-// or deleting it for being stale.
-func (c *LRU) Contains(key interface{}) (ok bool) {
- _, ok = c.items[key]
- return ok
-}
-
-// Peek returns the key value (or undefined if not found) without updating
-// the "recently used"-ness of the key.
-func (c *LRU) Peek(key interface{}) (value interface{}, ok bool) {
- var ent *list.Element
- if ent, ok = c.items[key]; ok {
- return ent.Value.(*entry).value, true
- }
- return nil, ok
-}
-
-// Remove removes the provided key from the cache, returning if the
-// key was contained.
-func (c *LRU) Remove(key interface{}) (present bool) {
- if ent, ok := c.items[key]; ok {
- c.removeElement(ent)
- return true
- }
- return false
-}
-
-// RemoveOldest removes the oldest item from the cache.
-func (c *LRU) RemoveOldest() (key interface{}, value interface{}, ok bool) {
- ent := c.evictList.Back()
- if ent != nil {
- c.removeElement(ent)
- kv := ent.Value.(*entry)
- return kv.key, kv.value, true
- }
- return nil, nil, false
-}
-
-// GetOldest returns the oldest entry
-func (c *LRU) GetOldest() (key interface{}, value interface{}, ok bool) {
- ent := c.evictList.Back()
- if ent != nil {
- kv := ent.Value.(*entry)
- return kv.key, kv.value, true
- }
- return nil, nil, false
-}
-
-// Keys returns a slice of the keys in the cache, from oldest to newest.
-func (c *LRU) Keys() []interface{} {
- keys := make([]interface{}, len(c.items))
- i := 0
- for ent := c.evictList.Back(); ent != nil; ent = ent.Prev() {
- keys[i] = ent.Value.(*entry).key
- i++
- }
- return keys
-}
-
-// Len returns the number of items in the cache.
-func (c *LRU) Len() int {
- return c.evictList.Len()
-}
-
-// removeOldest removes the oldest item from the cache.
-func (c *LRU) removeOldest() {
- ent := c.evictList.Back()
- if ent != nil {
- c.removeElement(ent)
- }
-}
-
-// removeElement is used to remove a given list element from the cache
-func (c *LRU) removeElement(e *list.Element) {
- c.evictList.Remove(e)
- kv := e.Value.(*entry)
- delete(c.items, kv.key)
- if c.onEvict != nil {
- c.onEvict(kv.key, kv.value)
- }
-}
diff --git a/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go b/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
deleted file mode 100644
index 74c70774..00000000
--- a/vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package simplelru
-
-// LRUCache is the interface for simple LRU cache.
-type LRUCache interface {
- // Adds a value to the cache, returns true if an eviction occurred and
- // updates the "recently used"-ness of the key.
- Add(key, value interface{}) bool
-
- // Returns key's value from the cache and
- // updates the "recently used"-ness of the key. #value, isFound
- Get(key interface{}) (value interface{}, ok bool)
-
- // Check if a key exsists in cache without updating the recent-ness.
- Contains(key interface{}) (ok bool)
-
- // Returns key's value without updating the "recently used"-ness of the key.
- Peek(key interface{}) (value interface{}, ok bool)
-
- // Removes a key from the cache.
- Remove(key interface{}) bool
-
- // Removes the oldest entry from cache.
- RemoveOldest() (interface{}, interface{}, bool)
-
- // Returns the oldest entry from the cache. #key, value, isFound
- GetOldest() (interface{}, interface{}, bool)
-
- // Returns a slice of the keys in the cache, from oldest to newest.
- Keys() []interface{}
-
- // Returns the number of items in the cache.
- Len() int
-
- // Clear all cache entries
- Purge()
-}
diff --git a/vendor/github.com/hpcloud/tail/.gitignore b/vendor/github.com/hpcloud/tail/.gitignore
deleted file mode 100644
index 6d9953c3..00000000
--- a/vendor/github.com/hpcloud/tail/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.test
-.go
-
diff --git a/vendor/github.com/hpcloud/tail/.travis.yml b/vendor/github.com/hpcloud/tail/.travis.yml
deleted file mode 100644
index 9cf8bb7f..00000000
--- a/vendor/github.com/hpcloud/tail/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-language: go
-
-script:
- - go test -race -v ./...
-
-go:
- - 1.4
- - 1.5
- - 1.6
- - tip
-
-matrix:
- allow_failures:
- - go: tip
-
-install:
- - go get gopkg.in/fsnotify.v1
- - go get gopkg.in/tomb.v1
diff --git a/vendor/github.com/hpcloud/tail/CHANGES.md b/vendor/github.com/hpcloud/tail/CHANGES.md
deleted file mode 100644
index 422790c0..00000000
--- a/vendor/github.com/hpcloud/tail/CHANGES.md
+++ /dev/null
@@ -1,63 +0,0 @@
-# API v1 (gopkg.in/hpcloud/tail.v1)
-
-## April, 2016
-
-* Migrated to godep, as depman is not longer supported
-* Introduced golang vendoring feature
-* Fixed issue [#57](https://github.com/hpcloud/tail/issues/57) related to reopen deleted file
-
-## July, 2015
-
-* Fix inotify watcher leak; remove `Cleanup` (#51)
-
-# API v0 (gopkg.in/hpcloud/tail.v0)
-
-## June, 2015
-
-* Don't return partial lines (PR #40)
-* Use stable version of fsnotify (#46)
-
-## July, 2014
-
-* Fix tail for Windows (PR #36)
-
-## May, 2014
-
-* Improved rate limiting using leaky bucket (PR #29)
-* Fix odd line splitting (PR #30)
-
-## Apr, 2014
-
-* LimitRate now discards read buffer (PR #28)
-* allow reading of longer lines if MaxLineSize is unset (PR #24)
-* updated deps.json to latest fsnotify (441bbc86b1)
-
-## Feb, 2014
-
-* added `Config.Logger` to suppress library logging
-
-## Nov, 2013
-
-* add Cleanup to remove leaky inotify watches (PR #20)
-
-## Aug, 2013
-
-* redesigned Location field (PR #12)
-* add tail.Tell (PR #14)
-
-## July, 2013
-
-* Rate limiting (PR #10)
-
-## May, 2013
-
-* Detect file deletions/renames in polling file watcher (PR #1)
-* Detect file truncation
-* Fix potential race condition when reopening the file (issue 5)
-* Fix potential blocking of `tail.Stop` (issue 4)
-* Fix uncleaned up ChangeEvents goroutines after calling tail.Stop
-* Support Follow=false
-
-## Feb, 2013
-
-* Initial open source release
diff --git a/vendor/github.com/hpcloud/tail/Dockerfile b/vendor/github.com/hpcloud/tail/Dockerfile
deleted file mode 100644
index cd297b94..00000000
--- a/vendor/github.com/hpcloud/tail/Dockerfile
+++ /dev/null
@@ -1,19 +0,0 @@
-FROM golang
-
-RUN mkdir -p $GOPATH/src/github.com/hpcloud/tail/
-ADD . $GOPATH/src/github.com/hpcloud/tail/
-
-# expecting to fetch dependencies successfully.
-RUN go get -v github.com/hpcloud/tail
-
-# expecting to run the test successfully.
-RUN go test -v github.com/hpcloud/tail
-
-# expecting to install successfully
-RUN go install -v github.com/hpcloud/tail
-RUN go install -v github.com/hpcloud/tail/cmd/gotail
-
-RUN $GOPATH/bin/gotail -h || true
-
-ENV PATH $GOPATH/bin:$PATH
-CMD ["gotail"]
diff --git a/vendor/github.com/hpcloud/tail/LICENSE.txt b/vendor/github.com/hpcloud/tail/LICENSE.txt
deleted file mode 100644
index 818d802a..00000000
--- a/vendor/github.com/hpcloud/tail/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-# The MIT License (MIT)
-
-# © Copyright 2015 Hewlett Packard Enterprise Development LP
-Copyright (c) 2014 ActiveState
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/vendor/github.com/hpcloud/tail/Makefile b/vendor/github.com/hpcloud/tail/Makefile
deleted file mode 100644
index 6591b24f..00000000
--- a/vendor/github.com/hpcloud/tail/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-default: test
-
-test: *.go
- go test -v -race ./...
-
-fmt:
- gofmt -w .
-
-# Run the test in an isolated environment.
-fulltest:
- docker build -t hpcloud/tail .
diff --git a/vendor/github.com/hpcloud/tail/README.md b/vendor/github.com/hpcloud/tail/README.md
deleted file mode 100644
index fb7fbc26..00000000
--- a/vendor/github.com/hpcloud/tail/README.md
+++ /dev/null
@@ -1,28 +0,0 @@
-[](https://travis-ci.org/hpcloud/tail)
-[](https://ci.appveyor.com/project/HelionCloudFoundry/tail)
-
-# Go package for tail-ing files
-
-A Go package striving to emulate the features of the BSD `tail` program.
-
-```Go
-t, err := tail.TailFile("/var/log/nginx.log", tail.Config{Follow: true})
-for line := range t.Lines {
- fmt.Println(line.Text)
-}
-```
-
-See [API documentation](http://godoc.org/github.com/hpcloud/tail).
-
-## Log rotation
-
-Tail comes with full support for truncation/move detection as it is
-designed to work with log rotation tools.
-
-## Installing
-
- go get github.com/hpcloud/tail/...
-
-## Windows support
-
-This package [needs assistance](https://github.com/hpcloud/tail/labels/Windows) for full Windows support.
diff --git a/vendor/github.com/hpcloud/tail/appveyor.yml b/vendor/github.com/hpcloud/tail/appveyor.yml
deleted file mode 100644
index d370055b..00000000
--- a/vendor/github.com/hpcloud/tail/appveyor.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-version: 0.{build}
-skip_tags: true
-cache: C:\Users\appveyor\AppData\Local\NuGet\Cache
-build_script:
-- SET GOPATH=c:\workspace
-- go test -v -race ./...
-test: off
-clone_folder: c:\workspace\src\github.com\hpcloud\tail
-branches:
- only:
- - master
diff --git a/vendor/github.com/hpcloud/tail/ratelimiter/Licence b/vendor/github.com/hpcloud/tail/ratelimiter/Licence
deleted file mode 100644
index 434aab19..00000000
--- a/vendor/github.com/hpcloud/tail/ratelimiter/Licence
+++ /dev/null
@@ -1,7 +0,0 @@
-Copyright (C) 2013 99designs
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/hpcloud/tail/ratelimiter/leakybucket.go b/vendor/github.com/hpcloud/tail/ratelimiter/leakybucket.go
deleted file mode 100644
index 358b69e7..00000000
--- a/vendor/github.com/hpcloud/tail/ratelimiter/leakybucket.go
+++ /dev/null
@@ -1,97 +0,0 @@
-// Package ratelimiter implements the Leaky Bucket ratelimiting algorithm with memcached and in-memory backends.
-package ratelimiter
-
-import (
- "time"
-)
-
-type LeakyBucket struct {
- Size uint16
- Fill float64
- LeakInterval time.Duration // time.Duration for 1 unit of size to leak
- Lastupdate time.Time
- Now func() time.Time
-}
-
-func NewLeakyBucket(size uint16, leakInterval time.Duration) *LeakyBucket {
- bucket := LeakyBucket{
- Size: size,
- Fill: 0,
- LeakInterval: leakInterval,
- Now: time.Now,
- Lastupdate: time.Now(),
- }
-
- return &bucket
-}
-
-func (b *LeakyBucket) updateFill() {
- now := b.Now()
- if b.Fill > 0 {
- elapsed := now.Sub(b.Lastupdate)
-
- b.Fill -= float64(elapsed) / float64(b.LeakInterval)
- if b.Fill < 0 {
- b.Fill = 0
- }
- }
- b.Lastupdate = now
-}
-
-func (b *LeakyBucket) Pour(amount uint16) bool {
- b.updateFill()
-
- var newfill float64 = b.Fill + float64(amount)
-
- if newfill > float64(b.Size) {
- return false
- }
-
- b.Fill = newfill
-
- return true
-}
-
-// The time at which this bucket will be completely drained
-func (b *LeakyBucket) DrainedAt() time.Time {
- return b.Lastupdate.Add(time.Duration(b.Fill * float64(b.LeakInterval)))
-}
-
-// The duration until this bucket is completely drained
-func (b *LeakyBucket) TimeToDrain() time.Duration {
- return b.DrainedAt().Sub(b.Now())
-}
-
-func (b *LeakyBucket) TimeSinceLastUpdate() time.Duration {
- return b.Now().Sub(b.Lastupdate)
-}
-
-type LeakyBucketSer struct {
- Size uint16
- Fill float64
- LeakInterval time.Duration // time.Duration for 1 unit of size to leak
- Lastupdate time.Time
-}
-
-func (b *LeakyBucket) Serialise() *LeakyBucketSer {
- bucket := LeakyBucketSer{
- Size: b.Size,
- Fill: b.Fill,
- LeakInterval: b.LeakInterval,
- Lastupdate: b.Lastupdate,
- }
-
- return &bucket
-}
-
-func (b *LeakyBucketSer) DeSerialise() *LeakyBucket {
- bucket := LeakyBucket{
- Size: b.Size,
- Fill: b.Fill,
- LeakInterval: b.LeakInterval,
- Lastupdate: b.Lastupdate,
- Now: time.Now,
- }
-
- return &bucket
-}
diff --git a/vendor/github.com/hpcloud/tail/ratelimiter/memory.go b/vendor/github.com/hpcloud/tail/ratelimiter/memory.go
deleted file mode 100644
index 8f6a5784..00000000
--- a/vendor/github.com/hpcloud/tail/ratelimiter/memory.go
+++ /dev/null
@@ -1,58 +0,0 @@
-package ratelimiter
-
-import (
- "errors"
- "time"
-)
-
-const GC_SIZE int = 100
-
-type Memory struct {
- store map[string]LeakyBucket
- lastGCCollected time.Time
-}
-
-func NewMemory() *Memory {
- m := new(Memory)
- m.store = make(map[string]LeakyBucket)
- m.lastGCCollected = time.Now()
- return m
-}
-
-func (m *Memory) GetBucketFor(key string) (*LeakyBucket, error) {
-
- bucket, ok := m.store[key]
- if !ok {
- return nil, errors.New("miss")
- }
-
- return &bucket, nil
-}
-
-func (m *Memory) SetBucketFor(key string, bucket LeakyBucket) error {
-
- if len(m.store) > GC_SIZE {
- m.GarbageCollect()
- }
-
- m.store[key] = bucket
-
- return nil
-}
-
-func (m *Memory) GarbageCollect() {
- now := time.Now()
-
- // rate limit GC to once per minute
- if now.Add(60*time.Second).Unix() > m.lastGCCollected.Unix() {
-
- for key, bucket := range m.store {
- // if the bucket is drained, then GC
- if bucket.DrainedAt().Unix() > now.Unix() {
- delete(m.store, key)
- }
- }
-
- m.lastGCCollected = now
- }
-}
diff --git a/vendor/github.com/hpcloud/tail/ratelimiter/storage.go b/vendor/github.com/hpcloud/tail/ratelimiter/storage.go
deleted file mode 100644
index 89b2fe88..00000000
--- a/vendor/github.com/hpcloud/tail/ratelimiter/storage.go
+++ /dev/null
@@ -1,6 +0,0 @@
-package ratelimiter
-
-type Storage interface {
- GetBucketFor(string) (*LeakyBucket, error)
- SetBucketFor(string, LeakyBucket) error
-}
diff --git a/vendor/github.com/hpcloud/tail/tail.go b/vendor/github.com/hpcloud/tail/tail.go
deleted file mode 100644
index 2d252d60..00000000
--- a/vendor/github.com/hpcloud/tail/tail.go
+++ /dev/null
@@ -1,438 +0,0 @@
-// Copyright (c) 2015 HPE Software Inc. All rights reserved.
-// Copyright (c) 2013 ActiveState Software Inc. All rights reserved.
-
-package tail
-
-import (
- "bufio"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "log"
- "os"
- "strings"
- "sync"
- "time"
-
- "github.com/hpcloud/tail/ratelimiter"
- "github.com/hpcloud/tail/util"
- "github.com/hpcloud/tail/watch"
- "gopkg.in/tomb.v1"
-)
-
-var (
- ErrStop = fmt.Errorf("tail should now stop")
-)
-
-type Line struct {
- Text string
- Time time.Time
- Err error // Error from tail
-}
-
-// NewLine returns a Line with present time.
-func NewLine(text string) *Line {
- return &Line{text, time.Now(), nil}
-}
-
-// SeekInfo represents arguments to `os.Seek`
-type SeekInfo struct {
- Offset int64
- Whence int // os.SEEK_*
-}
-
-type logger interface {
- Fatal(v ...interface{})
- Fatalf(format string, v ...interface{})
- Fatalln(v ...interface{})
- Panic(v ...interface{})
- Panicf(format string, v ...interface{})
- Panicln(v ...interface{})
- Print(v ...interface{})
- Printf(format string, v ...interface{})
- Println(v ...interface{})
-}
-
-// Config is used to specify how a file must be tailed.
-type Config struct {
- // File-specifc
- Location *SeekInfo // Seek to this location before tailing
- ReOpen bool // Reopen recreated files (tail -F)
- MustExist bool // Fail early if the file does not exist
- Poll bool // Poll for file changes instead of using inotify
- Pipe bool // Is a named pipe (mkfifo)
- RateLimiter *ratelimiter.LeakyBucket
-
- // Generic IO
- Follow bool // Continue looking for new lines (tail -f)
- MaxLineSize int // If non-zero, split longer lines into multiple lines
-
- // Logger, when nil, is set to tail.DefaultLogger
- // To disable logging: set field to tail.DiscardingLogger
- Logger logger
-}
-
-type Tail struct {
- Filename string
- Lines chan *Line
- Config
-
- file *os.File
- reader *bufio.Reader
-
- watcher watch.FileWatcher
- changes *watch.FileChanges
-
- tomb.Tomb // provides: Done, Kill, Dying
-
- lk sync.Mutex
-}
-
-var (
- // DefaultLogger is used when Config.Logger == nil
- DefaultLogger = log.New(os.Stderr, "", log.LstdFlags)
- // DiscardingLogger can be used to disable logging output
- DiscardingLogger = log.New(ioutil.Discard, "", 0)
-)
-
-// TailFile begins tailing the file. Output stream is made available
-// via the `Tail.Lines` channel. To handle errors during tailing,
-// invoke the `Wait` or `Err` method after finishing reading from the
-// `Lines` channel.
-func TailFile(filename string, config Config) (*Tail, error) {
- if config.ReOpen && !config.Follow {
- util.Fatal("cannot set ReOpen without Follow.")
- }
-
- t := &Tail{
- Filename: filename,
- Lines: make(chan *Line),
- Config: config,
- }
-
- // when Logger was not specified in config, use default logger
- if t.Logger == nil {
- t.Logger = log.New(os.Stderr, "", log.LstdFlags)
- }
-
- if t.Poll {
- t.watcher = watch.NewPollingFileWatcher(filename)
- } else {
- t.watcher = watch.NewInotifyFileWatcher(filename)
- }
-
- if t.MustExist {
- var err error
- t.file, err = OpenFile(t.Filename)
- if err != nil {
- return nil, err
- }
- }
-
- go t.tailFileSync()
-
- return t, nil
-}
-
-// Return the file's current position, like stdio's ftell().
-// But this value is not very accurate.
-// it may readed one line in the chan(tail.Lines),
-// so it may lost one line.
-func (tail *Tail) Tell() (offset int64, err error) {
- if tail.file == nil {
- return
- }
- offset, err = tail.file.Seek(0, os.SEEK_CUR)
- if err != nil {
- return
- }
-
- tail.lk.Lock()
- defer tail.lk.Unlock()
- if tail.reader == nil {
- return
- }
-
- offset -= int64(tail.reader.Buffered())
- return
-}
-
-// Stop stops the tailing activity.
-func (tail *Tail) Stop() error {
- tail.Kill(nil)
- return tail.Wait()
-}
-
-// StopAtEOF stops tailing as soon as the end of the file is reached.
-func (tail *Tail) StopAtEOF() error {
- tail.Kill(errStopAtEOF)
- return tail.Wait()
-}
-
-var errStopAtEOF = errors.New("tail: stop at eof")
-
-func (tail *Tail) close() {
- close(tail.Lines)
- tail.closeFile()
-}
-
-func (tail *Tail) closeFile() {
- if tail.file != nil {
- tail.file.Close()
- tail.file = nil
- }
-}
-
-func (tail *Tail) reopen() error {
- tail.closeFile()
- for {
- var err error
- tail.file, err = OpenFile(tail.Filename)
- if err != nil {
- if os.IsNotExist(err) {
- tail.Logger.Printf("Waiting for %s to appear...", tail.Filename)
- if err := tail.watcher.BlockUntilExists(&tail.Tomb); err != nil {
- if err == tomb.ErrDying {
- return err
- }
- return fmt.Errorf("Failed to detect creation of %s: %s", tail.Filename, err)
- }
- continue
- }
- return fmt.Errorf("Unable to open file %s: %s", tail.Filename, err)
- }
- break
- }
- return nil
-}
-
-func (tail *Tail) readLine() (string, error) {
- tail.lk.Lock()
- line, err := tail.reader.ReadString('\n')
- tail.lk.Unlock()
- if err != nil {
- // Note ReadString "returns the data read before the error" in
- // case of an error, including EOF, so we return it as is. The
- // caller is expected to process it if err is EOF.
- return line, err
- }
-
- line = strings.TrimRight(line, "\n")
-
- return line, err
-}
-
-func (tail *Tail) tailFileSync() {
- defer tail.Done()
- defer tail.close()
-
- if !tail.MustExist {
- // deferred first open.
- err := tail.reopen()
- if err != nil {
- if err != tomb.ErrDying {
- tail.Kill(err)
- }
- return
- }
- }
-
- // Seek to requested location on first open of the file.
- if tail.Location != nil {
- _, err := tail.file.Seek(tail.Location.Offset, tail.Location.Whence)
- tail.Logger.Printf("Seeked %s - %+v\n", tail.Filename, tail.Location)
- if err != nil {
- tail.Killf("Seek error on %s: %s", tail.Filename, err)
- return
- }
- }
-
- tail.openReader()
-
- var offset int64 = 0
- var err error
-
- // Read line by line.
- for {
- // do not seek in named pipes
- if !tail.Pipe {
- // grab the position in case we need to back up in the event of a half-line
- offset, err = tail.Tell()
- if err != nil {
- tail.Kill(err)
- return
- }
- }
-
- line, err := tail.readLine()
-
- // Process `line` even if err is EOF.
- if err == nil {
- cooloff := !tail.sendLine(line)
- if cooloff {
- // Wait a second before seeking till the end of
- // file when rate limit is reached.
- msg := fmt.Sprintf(
- "Too much log activity; waiting a second " +
- "before resuming tailing")
- tail.Lines <- &Line{msg, time.Now(), fmt.Errorf(msg)}
- select {
- case <-time.After(time.Second):
- case <-tail.Dying():
- return
- }
- if err := tail.seekEnd(); err != nil {
- tail.Kill(err)
- return
- }
- }
- } else if err == io.EOF {
- if !tail.Follow {
- if line != "" {
- tail.sendLine(line)
- }
- return
- }
-
- if tail.Follow && line != "" {
- // this has the potential to never return the last line if
- // it's not followed by a newline; seems a fair trade here
- err := tail.seekTo(SeekInfo{Offset: offset, Whence: 0})
- if err != nil {
- tail.Kill(err)
- return
- }
- }
-
- // When EOF is reached, wait for more data to become
- // available. Wait strategy is based on the `tail.watcher`
- // implementation (inotify or polling).
- err := tail.waitForChanges()
- if err != nil {
- if err != ErrStop {
- tail.Kill(err)
- }
- return
- }
- } else {
- // non-EOF error
- tail.Killf("Error reading %s: %s", tail.Filename, err)
- return
- }
-
- select {
- case <-tail.Dying():
- if tail.Err() == errStopAtEOF {
- continue
- }
- return
- default:
- }
- }
-}
-
-// waitForChanges waits until the file has been appended, deleted,
-// moved or truncated. When moved or deleted - the file will be
-// reopened if ReOpen is true. Truncated files are always reopened.
-func (tail *Tail) waitForChanges() error {
- if tail.changes == nil {
- pos, err := tail.file.Seek(0, os.SEEK_CUR)
- if err != nil {
- return err
- }
- tail.changes, err = tail.watcher.ChangeEvents(&tail.Tomb, pos)
- if err != nil {
- return err
- }
- }
-
- select {
- case <-tail.changes.Modified:
- return nil
- case <-tail.changes.Deleted:
- tail.changes = nil
- if tail.ReOpen {
- // XXX: we must not log from a library.
- tail.Logger.Printf("Re-opening moved/deleted file %s ...", tail.Filename)
- if err := tail.reopen(); err != nil {
- return err
- }
- tail.Logger.Printf("Successfully reopened %s", tail.Filename)
- tail.openReader()
- return nil
- } else {
- tail.Logger.Printf("Stopping tail as file no longer exists: %s", tail.Filename)
- return ErrStop
- }
- case <-tail.changes.Truncated:
- // Always reopen truncated files (Follow is true)
- tail.Logger.Printf("Re-opening truncated file %s ...", tail.Filename)
- if err := tail.reopen(); err != nil {
- return err
- }
- tail.Logger.Printf("Successfully reopened truncated %s", tail.Filename)
- tail.openReader()
- return nil
- case <-tail.Dying():
- return ErrStop
- }
- panic("unreachable")
-}
-
-func (tail *Tail) openReader() {
- if tail.MaxLineSize > 0 {
- // add 2 to account for newline characters
- tail.reader = bufio.NewReaderSize(tail.file, tail.MaxLineSize+2)
- } else {
- tail.reader = bufio.NewReader(tail.file)
- }
-}
-
-func (tail *Tail) seekEnd() error {
- return tail.seekTo(SeekInfo{Offset: 0, Whence: os.SEEK_END})
-}
-
-func (tail *Tail) seekTo(pos SeekInfo) error {
- _, err := tail.file.Seek(pos.Offset, pos.Whence)
- if err != nil {
- return fmt.Errorf("Seek error on %s: %s", tail.Filename, err)
- }
- // Reset the read buffer whenever the file is re-seek'ed
- tail.reader.Reset(tail.file)
- return nil
-}
-
-// sendLine sends the line(s) to Lines channel, splitting longer lines
-// if necessary. Return false if rate limit is reached.
-func (tail *Tail) sendLine(line string) bool {
- now := time.Now()
- lines := []string{line}
-
- // Split longer lines
- if tail.MaxLineSize > 0 && len(line) > tail.MaxLineSize {
- lines = util.PartitionString(line, tail.MaxLineSize)
- }
-
- for _, line := range lines {
- tail.Lines <- &Line{line, now, nil}
- }
-
- if tail.Config.RateLimiter != nil {
- ok := tail.Config.RateLimiter.Pour(uint16(len(lines)))
- if !ok {
- tail.Logger.Printf("Leaky bucket full (%v); entering 1s cooloff period.\n",
- tail.Filename)
- return false
- }
- }
-
- return true
-}
-
-// Cleanup removes inotify watches added by the tail package. This function is
-// meant to be invoked from a process's exit handler. Linux kernel may not
-// automatically remove inotify watches after the process exits.
-func (tail *Tail) Cleanup() {
- watch.Cleanup(tail.Filename)
-}
diff --git a/vendor/github.com/hpcloud/tail/tail_posix.go b/vendor/github.com/hpcloud/tail/tail_posix.go
deleted file mode 100644
index bc4dc335..00000000
--- a/vendor/github.com/hpcloud/tail/tail_posix.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// +build linux darwin freebsd netbsd openbsd
-
-package tail
-
-import (
- "os"
-)
-
-func OpenFile(name string) (file *os.File, err error) {
- return os.Open(name)
-}
diff --git a/vendor/github.com/hpcloud/tail/tail_windows.go b/vendor/github.com/hpcloud/tail/tail_windows.go
deleted file mode 100644
index ef2cfca1..00000000
--- a/vendor/github.com/hpcloud/tail/tail_windows.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// +build windows
-
-package tail
-
-import (
- "github.com/hpcloud/tail/winfile"
- "os"
-)
-
-func OpenFile(name string) (file *os.File, err error) {
- return winfile.OpenFile(name, os.O_RDONLY, 0)
-}
diff --git a/vendor/github.com/hpcloud/tail/util/util.go b/vendor/github.com/hpcloud/tail/util/util.go
deleted file mode 100644
index 54151fe3..00000000
--- a/vendor/github.com/hpcloud/tail/util/util.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2015 HPE Software Inc. All rights reserved.
-// Copyright (c) 2013 ActiveState Software Inc. All rights reserved.
-
-package util
-
-import (
- "fmt"
- "log"
- "os"
- "runtime/debug"
-)
-
-type Logger struct {
- *log.Logger
-}
-
-var LOGGER = &Logger{log.New(os.Stderr, "", log.LstdFlags)}
-
-// fatal is like panic except it displays only the current goroutine's stack.
-func Fatal(format string, v ...interface{}) {
- // https://github.com/hpcloud/log/blob/master/log.go#L45
- LOGGER.Output(2, fmt.Sprintf("FATAL -- "+format, v...)+"\n"+string(debug.Stack()))
- os.Exit(1)
-}
-
-// partitionString partitions the string into chunks of given size,
-// with the last chunk of variable size.
-func PartitionString(s string, chunkSize int) []string {
- if chunkSize <= 0 {
- panic("invalid chunkSize")
- }
- length := len(s)
- chunks := 1 + length/chunkSize
- start := 0
- end := chunkSize
- parts := make([]string, 0, chunks)
- for {
- if end > length {
- end = length
- }
- parts = append(parts, s[start:end])
- if end == length {
- break
- }
- start, end = end, end+chunkSize
- }
- return parts
-}
diff --git a/vendor/github.com/hpcloud/tail/watch/filechanges.go b/vendor/github.com/hpcloud/tail/watch/filechanges.go
deleted file mode 100644
index 3ce5dcec..00000000
--- a/vendor/github.com/hpcloud/tail/watch/filechanges.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package watch
-
-type FileChanges struct {
- Modified chan bool // Channel to get notified of modifications
- Truncated chan bool // Channel to get notified of truncations
- Deleted chan bool // Channel to get notified of deletions/renames
-}
-
-func NewFileChanges() *FileChanges {
- return &FileChanges{
- make(chan bool), make(chan bool), make(chan bool)}
-}
-
-func (fc *FileChanges) NotifyModified() {
- sendOnlyIfEmpty(fc.Modified)
-}
-
-func (fc *FileChanges) NotifyTruncated() {
- sendOnlyIfEmpty(fc.Truncated)
-}
-
-func (fc *FileChanges) NotifyDeleted() {
- sendOnlyIfEmpty(fc.Deleted)
-}
-
-// sendOnlyIfEmpty sends on a bool channel only if the channel has no
-// backlog to be read by other goroutines. This concurrency pattern
-// can be used to notify other goroutines if and only if they are
-// looking for it (i.e., subsequent notifications can be compressed
-// into one).
-func sendOnlyIfEmpty(ch chan bool) {
- select {
- case ch <- true:
- default:
- }
-}
diff --git a/vendor/github.com/hpcloud/tail/watch/inotify.go b/vendor/github.com/hpcloud/tail/watch/inotify.go
deleted file mode 100644
index 4478f1e1..00000000
--- a/vendor/github.com/hpcloud/tail/watch/inotify.go
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright (c) 2015 HPE Software Inc. All rights reserved.
-// Copyright (c) 2013 ActiveState Software Inc. All rights reserved.
-
-package watch
-
-import (
- "fmt"
- "os"
- "path/filepath"
-
- "github.com/hpcloud/tail/util"
-
- "gopkg.in/fsnotify.v1"
- "gopkg.in/tomb.v1"
-)
-
-// InotifyFileWatcher uses inotify to monitor file changes.
-type InotifyFileWatcher struct {
- Filename string
- Size int64
-}
-
-func NewInotifyFileWatcher(filename string) *InotifyFileWatcher {
- fw := &InotifyFileWatcher{filepath.Clean(filename), 0}
- return fw
-}
-
-func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error {
- err := WatchCreate(fw.Filename)
- if err != nil {
- return err
- }
- defer RemoveWatchCreate(fw.Filename)
-
- // Do a real check now as the file might have been created before
- // calling `WatchFlags` above.
- if _, err = os.Stat(fw.Filename); !os.IsNotExist(err) {
- // file exists, or stat returned an error.
- return err
- }
-
- events := Events(fw.Filename)
-
- for {
- select {
- case evt, ok := <-events:
- if !ok {
- return fmt.Errorf("inotify watcher has been closed")
- }
- evtName, err := filepath.Abs(evt.Name)
- if err != nil {
- return err
- }
- fwFilename, err := filepath.Abs(fw.Filename)
- if err != nil {
- return err
- }
- if evtName == fwFilename {
- return nil
- }
- case <-t.Dying():
- return tomb.ErrDying
- }
- }
- panic("unreachable")
-}
-
-func (fw *InotifyFileWatcher) ChangeEvents(t *tomb.Tomb, pos int64) (*FileChanges, error) {
- err := Watch(fw.Filename)
- if err != nil {
- return nil, err
- }
-
- changes := NewFileChanges()
- fw.Size = pos
-
- go func() {
- defer RemoveWatch(fw.Filename)
-
- events := Events(fw.Filename)
-
- for {
- prevSize := fw.Size
-
- var evt fsnotify.Event
- var ok bool
-
- select {
- case evt, ok = <-events:
- if !ok {
- return
- }
- case <-t.Dying():
- return
- }
-
- switch {
- case evt.Op&fsnotify.Remove == fsnotify.Remove:
- fallthrough
-
- case evt.Op&fsnotify.Rename == fsnotify.Rename:
- changes.NotifyDeleted()
- return
-
- case evt.Op&fsnotify.Write == fsnotify.Write:
- fi, err := os.Stat(fw.Filename)
- if err != nil {
- if os.IsNotExist(err) {
- changes.NotifyDeleted()
- return
- }
- // XXX: report this error back to the user
- util.Fatal("Failed to stat file %v: %v", fw.Filename, err)
- }
- fw.Size = fi.Size()
-
- if prevSize > 0 && prevSize > fw.Size {
- changes.NotifyTruncated()
- } else {
- changes.NotifyModified()
- }
- prevSize = fw.Size
- }
- }
- }()
-
- return changes, nil
-}
diff --git a/vendor/github.com/hpcloud/tail/watch/inotify_tracker.go b/vendor/github.com/hpcloud/tail/watch/inotify_tracker.go
deleted file mode 100644
index 03be4275..00000000
--- a/vendor/github.com/hpcloud/tail/watch/inotify_tracker.go
+++ /dev/null
@@ -1,260 +0,0 @@
-// Copyright (c) 2015 HPE Software Inc. All rights reserved.
-// Copyright (c) 2013 ActiveState Software Inc. All rights reserved.
-
-package watch
-
-import (
- "log"
- "os"
- "path/filepath"
- "sync"
- "syscall"
-
- "github.com/hpcloud/tail/util"
-
- "gopkg.in/fsnotify.v1"
-)
-
-type InotifyTracker struct {
- mux sync.Mutex
- watcher *fsnotify.Watcher
- chans map[string]chan fsnotify.Event
- done map[string]chan bool
- watchNums map[string]int
- watch chan *watchInfo
- remove chan *watchInfo
- error chan error
-}
-
-type watchInfo struct {
- op fsnotify.Op
- fname string
-}
-
-func (this *watchInfo) isCreate() bool {
- return this.op == fsnotify.Create
-}
-
-var (
- // globally shared InotifyTracker; ensures only one fsnotify.Watcher is used
- shared *InotifyTracker
-
- // these are used to ensure the shared InotifyTracker is run exactly once
- once = sync.Once{}
- goRun = func() {
- shared = &InotifyTracker{
- mux: sync.Mutex{},
- chans: make(map[string]chan fsnotify.Event),
- done: make(map[string]chan bool),
- watchNums: make(map[string]int),
- watch: make(chan *watchInfo),
- remove: make(chan *watchInfo),
- error: make(chan error),
- }
- go shared.run()
- }
-
- logger = log.New(os.Stderr, "", log.LstdFlags)
-)
-
-// Watch signals the run goroutine to begin watching the input filename
-func Watch(fname string) error {
- return watch(&watchInfo{
- fname: fname,
- })
-}
-
-// Watch create signals the run goroutine to begin watching the input filename
-// if call the WatchCreate function, don't call the Cleanup, call the RemoveWatchCreate
-func WatchCreate(fname string) error {
- return watch(&watchInfo{
- op: fsnotify.Create,
- fname: fname,
- })
-}
-
-func watch(winfo *watchInfo) error {
- // start running the shared InotifyTracker if not already running
- once.Do(goRun)
-
- winfo.fname = filepath.Clean(winfo.fname)
- shared.watch <- winfo
- return <-shared.error
-}
-
-// RemoveWatch signals the run goroutine to remove the watch for the input filename
-func RemoveWatch(fname string) {
- remove(&watchInfo{
- fname: fname,
- })
-}
-
-// RemoveWatch create signals the run goroutine to remove the watch for the input filename
-func RemoveWatchCreate(fname string) {
- remove(&watchInfo{
- op: fsnotify.Create,
- fname: fname,
- })
-}
-
-func remove(winfo *watchInfo) {
- // start running the shared InotifyTracker if not already running
- once.Do(goRun)
-
- winfo.fname = filepath.Clean(winfo.fname)
- shared.mux.Lock()
- done := shared.done[winfo.fname]
- if done != nil {
- delete(shared.done, winfo.fname)
- close(done)
- }
-
- fname := winfo.fname
- if winfo.isCreate() {
- // Watch for new files to be created in the parent directory.
- fname = filepath.Dir(fname)
- }
- shared.watchNums[fname]--
- watchNum := shared.watchNums[fname]
- if watchNum == 0 {
- delete(shared.watchNums, fname)
- }
- shared.mux.Unlock()
-
- // If we were the last ones to watch this file, unsubscribe from inotify.
- // This needs to happen after releasing the lock because fsnotify waits
- // synchronously for the kernel to acknowledge the removal of the watch
- // for this file, which causes us to deadlock if we still held the lock.
- if watchNum == 0 {
- shared.watcher.Remove(fname)
- }
- shared.remove <- winfo
-}
-
-// Events returns a channel to which FileEvents corresponding to the input filename
-// will be sent. This channel will be closed when removeWatch is called on this
-// filename.
-func Events(fname string) <-chan fsnotify.Event {
- shared.mux.Lock()
- defer shared.mux.Unlock()
-
- return shared.chans[fname]
-}
-
-// Cleanup removes the watch for the input filename if necessary.
-func Cleanup(fname string) {
- RemoveWatch(fname)
-}
-
-// watchFlags calls fsnotify.WatchFlags for the input filename and flags, creating
-// a new Watcher if the previous Watcher was closed.
-func (shared *InotifyTracker) addWatch(winfo *watchInfo) error {
- shared.mux.Lock()
- defer shared.mux.Unlock()
-
- if shared.chans[winfo.fname] == nil {
- shared.chans[winfo.fname] = make(chan fsnotify.Event)
- shared.done[winfo.fname] = make(chan bool)
- }
-
- fname := winfo.fname
- if winfo.isCreate() {
- // Watch for new files to be created in the parent directory.
- fname = filepath.Dir(fname)
- }
-
- // already in inotify watch
- if shared.watchNums[fname] > 0 {
- shared.watchNums[fname]++
- if winfo.isCreate() {
- shared.watchNums[winfo.fname]++
- }
- return nil
- }
-
- err := shared.watcher.Add(fname)
- if err == nil {
- shared.watchNums[fname]++
- if winfo.isCreate() {
- shared.watchNums[winfo.fname]++
- }
- }
- return err
-}
-
-// removeWatch calls fsnotify.RemoveWatch for the input filename and closes the
-// corresponding events channel.
-func (shared *InotifyTracker) removeWatch(winfo *watchInfo) {
- shared.mux.Lock()
- defer shared.mux.Unlock()
-
- ch := shared.chans[winfo.fname]
- if ch == nil {
- return
- }
-
- delete(shared.chans, winfo.fname)
- close(ch)
-
- if !winfo.isCreate() {
- return
- }
-
- shared.watchNums[winfo.fname]--
- if shared.watchNums[winfo.fname] == 0 {
- delete(shared.watchNums, winfo.fname)
- }
-}
-
-// sendEvent sends the input event to the appropriate Tail.
-func (shared *InotifyTracker) sendEvent(event fsnotify.Event) {
- name := filepath.Clean(event.Name)
-
- shared.mux.Lock()
- ch := shared.chans[name]
- done := shared.done[name]
- shared.mux.Unlock()
-
- if ch != nil && done != nil {
- select {
- case ch <- event:
- case <-done:
- }
- }
-}
-
-// run starts the goroutine in which the shared struct reads events from its
-// Watcher's Event channel and sends the events to the appropriate Tail.
-func (shared *InotifyTracker) run() {
- watcher, err := fsnotify.NewWatcher()
- if err != nil {
- util.Fatal("failed to create Watcher")
- }
- shared.watcher = watcher
-
- for {
- select {
- case winfo := <-shared.watch:
- shared.error <- shared.addWatch(winfo)
-
- case winfo := <-shared.remove:
- shared.removeWatch(winfo)
-
- case event, open := <-shared.watcher.Events:
- if !open {
- return
- }
- shared.sendEvent(event)
-
- case err, open := <-shared.watcher.Errors:
- if !open {
- return
- } else if err != nil {
- sysErr, ok := err.(*os.SyscallError)
- if !ok || sysErr.Err != syscall.EINTR {
- logger.Printf("Error in Watcher Error channel: %s", err)
- }
- }
- }
- }
-}
diff --git a/vendor/github.com/hpcloud/tail/watch/polling.go b/vendor/github.com/hpcloud/tail/watch/polling.go
deleted file mode 100644
index 49491f21..00000000
--- a/vendor/github.com/hpcloud/tail/watch/polling.go
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright (c) 2015 HPE Software Inc. All rights reserved.
-// Copyright (c) 2013 ActiveState Software Inc. All rights reserved.
-
-package watch
-
-import (
- "os"
- "runtime"
- "time"
-
- "github.com/hpcloud/tail/util"
- "gopkg.in/tomb.v1"
-)
-
-// PollingFileWatcher polls the file for changes.
-type PollingFileWatcher struct {
- Filename string
- Size int64
-}
-
-func NewPollingFileWatcher(filename string) *PollingFileWatcher {
- fw := &PollingFileWatcher{filename, 0}
- return fw
-}
-
-var POLL_DURATION time.Duration
-
-func (fw *PollingFileWatcher) BlockUntilExists(t *tomb.Tomb) error {
- for {
- if _, err := os.Stat(fw.Filename); err == nil {
- return nil
- } else if !os.IsNotExist(err) {
- return err
- }
- select {
- case <-time.After(POLL_DURATION):
- continue
- case <-t.Dying():
- return tomb.ErrDying
- }
- }
- panic("unreachable")
-}
-
-func (fw *PollingFileWatcher) ChangeEvents(t *tomb.Tomb, pos int64) (*FileChanges, error) {
- origFi, err := os.Stat(fw.Filename)
- if err != nil {
- return nil, err
- }
-
- changes := NewFileChanges()
- var prevModTime time.Time
-
- // XXX: use tomb.Tomb to cleanly manage these goroutines. replace
- // the fatal (below) with tomb's Kill.
-
- fw.Size = pos
-
- go func() {
- prevSize := fw.Size
- for {
- select {
- case <-t.Dying():
- return
- default:
- }
-
- time.Sleep(POLL_DURATION)
- fi, err := os.Stat(fw.Filename)
- if err != nil {
- // Windows cannot delete a file if a handle is still open (tail keeps one open)
- // so it gives access denied to anything trying to read it until all handles are released.
- if os.IsNotExist(err) || (runtime.GOOS == "windows" && os.IsPermission(err)) {
- // File does not exist (has been deleted).
- changes.NotifyDeleted()
- return
- }
-
- // XXX: report this error back to the user
- util.Fatal("Failed to stat file %v: %v", fw.Filename, err)
- }
-
- // File got moved/renamed?
- if !os.SameFile(origFi, fi) {
- changes.NotifyDeleted()
- return
- }
-
- // File got truncated?
- fw.Size = fi.Size()
- if prevSize > 0 && prevSize > fw.Size {
- changes.NotifyTruncated()
- prevSize = fw.Size
- continue
- }
- // File got bigger?
- if prevSize > 0 && prevSize < fw.Size {
- changes.NotifyModified()
- prevSize = fw.Size
- continue
- }
- prevSize = fw.Size
-
- // File was appended to (changed)?
- modTime := fi.ModTime()
- if modTime != prevModTime {
- prevModTime = modTime
- changes.NotifyModified()
- }
- }
- }()
-
- return changes, nil
-}
-
-func init() {
- POLL_DURATION = 250 * time.Millisecond
-}
diff --git a/vendor/github.com/hpcloud/tail/watch/watch.go b/vendor/github.com/hpcloud/tail/watch/watch.go
deleted file mode 100644
index 2e1783ef..00000000
--- a/vendor/github.com/hpcloud/tail/watch/watch.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2015 HPE Software Inc. All rights reserved.
-// Copyright (c) 2013 ActiveState Software Inc. All rights reserved.
-
-package watch
-
-import "gopkg.in/tomb.v1"
-
-// FileWatcher monitors file-level events.
-type FileWatcher interface {
- // BlockUntilExists blocks until the file comes into existence.
- BlockUntilExists(*tomb.Tomb) error
-
- // ChangeEvents reports on changes to a file, be it modification,
- // deletion, renames or truncations. Returned FileChanges group of
- // channels will be closed, thus become unusable, after a deletion
- // or truncation event.
- // In order to properly report truncations, ChangeEvents requires
- // the caller to pass their current offset in the file.
- ChangeEvents(*tomb.Tomb, int64) (*FileChanges, error)
-}
diff --git a/vendor/github.com/hpcloud/tail/winfile/winfile.go b/vendor/github.com/hpcloud/tail/winfile/winfile.go
deleted file mode 100644
index aa7e7bc5..00000000
--- a/vendor/github.com/hpcloud/tail/winfile/winfile.go
+++ /dev/null
@@ -1,92 +0,0 @@
-// +build windows
-
-package winfile
-
-import (
- "os"
- "syscall"
- "unsafe"
-)
-
-// issue also described here
-//https://codereview.appspot.com/8203043/
-
-// https://github.com/jnwhiteh/golang/blob/master/src/pkg/syscall/syscall_windows.go#L218
-func Open(path string, mode int, perm uint32) (fd syscall.Handle, err error) {
- if len(path) == 0 {
- return syscall.InvalidHandle, syscall.ERROR_FILE_NOT_FOUND
- }
- pathp, err := syscall.UTF16PtrFromString(path)
- if err != nil {
- return syscall.InvalidHandle, err
- }
- var access uint32
- switch mode & (syscall.O_RDONLY | syscall.O_WRONLY | syscall.O_RDWR) {
- case syscall.O_RDONLY:
- access = syscall.GENERIC_READ
- case syscall.O_WRONLY:
- access = syscall.GENERIC_WRITE
- case syscall.O_RDWR:
- access = syscall.GENERIC_READ | syscall.GENERIC_WRITE
- }
- if mode&syscall.O_CREAT != 0 {
- access |= syscall.GENERIC_WRITE
- }
- if mode&syscall.O_APPEND != 0 {
- access &^= syscall.GENERIC_WRITE
- access |= syscall.FILE_APPEND_DATA
- }
- sharemode := uint32(syscall.FILE_SHARE_READ | syscall.FILE_SHARE_WRITE | syscall.FILE_SHARE_DELETE)
- var sa *syscall.SecurityAttributes
- if mode&syscall.O_CLOEXEC == 0 {
- sa = makeInheritSa()
- }
- var createmode uint32
- switch {
- case mode&(syscall.O_CREAT|syscall.O_EXCL) == (syscall.O_CREAT | syscall.O_EXCL):
- createmode = syscall.CREATE_NEW
- case mode&(syscall.O_CREAT|syscall.O_TRUNC) == (syscall.O_CREAT | syscall.O_TRUNC):
- createmode = syscall.CREATE_ALWAYS
- case mode&syscall.O_CREAT == syscall.O_CREAT:
- createmode = syscall.OPEN_ALWAYS
- case mode&syscall.O_TRUNC == syscall.O_TRUNC:
- createmode = syscall.TRUNCATE_EXISTING
- default:
- createmode = syscall.OPEN_EXISTING
- }
- h, e := syscall.CreateFile(pathp, access, sharemode, sa, createmode, syscall.FILE_ATTRIBUTE_NORMAL, 0)
- return h, e
-}
-
-// https://github.com/jnwhiteh/golang/blob/master/src/pkg/syscall/syscall_windows.go#L211
-func makeInheritSa() *syscall.SecurityAttributes {
- var sa syscall.SecurityAttributes
- sa.Length = uint32(unsafe.Sizeof(sa))
- sa.InheritHandle = 1
- return &sa
-}
-
-// https://github.com/jnwhiteh/golang/blob/master/src/pkg/os/file_windows.go#L133
-func OpenFile(name string, flag int, perm os.FileMode) (file *os.File, err error) {
- r, e := Open(name, flag|syscall.O_CLOEXEC, syscallMode(perm))
- if e != nil {
- return nil, e
- }
- return os.NewFile(uintptr(r), name), nil
-}
-
-// https://github.com/jnwhiteh/golang/blob/master/src/pkg/os/file_posix.go#L61
-func syscallMode(i os.FileMode) (o uint32) {
- o |= uint32(i.Perm())
- if i&os.ModeSetuid != 0 {
- o |= syscall.S_ISUID
- }
- if i&os.ModeSetgid != 0 {
- o |= syscall.S_ISGID
- }
- if i&os.ModeSticky != 0 {
- o |= syscall.S_ISVTX
- }
- // No mapping for Go's ModeTemporary (plan9 only).
- return
-}
diff --git a/vendor/github.com/imdario/mergo/.gitignore b/vendor/github.com/imdario/mergo/.gitignore
deleted file mode 100644
index 529c3412..00000000
--- a/vendor/github.com/imdario/mergo/.gitignore
+++ /dev/null
@@ -1,33 +0,0 @@
-#### joe made this: http://goel.io/joe
-
-#### go ####
-# Binaries for programs and plugins
-*.exe
-*.dll
-*.so
-*.dylib
-
-# Test binary, build with `go test -c`
-*.test
-
-# Output of the go coverage tool, specifically when used with LiteIDE
-*.out
-
-# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
-.glide/
-
-#### vim ####
-# Swap
-[._]*.s[a-v][a-z]
-[._]*.sw[a-p]
-[._]s[a-v][a-z]
-[._]sw[a-p]
-
-# Session
-Session.vim
-
-# Temporary
-.netrwhist
-*~
-# Auto-generated tag files
-tags
diff --git a/vendor/github.com/imdario/mergo/.travis.yml b/vendor/github.com/imdario/mergo/.travis.yml
deleted file mode 100644
index dad29725..00000000
--- a/vendor/github.com/imdario/mergo/.travis.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-language: go
-install:
- - go get -t
- - go get golang.org/x/tools/cmd/cover
- - go get github.com/mattn/goveralls
-script:
- - go test -race -v ./...
-after_script:
- - $HOME/gopath/bin/goveralls -service=travis-ci -repotoken $COVERALLS_TOKEN
diff --git a/vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md b/vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md
deleted file mode 100644
index 469b4490..00000000
--- a/vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# Contributor Covenant Code of Conduct
-
-## Our Pledge
-
-In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
-
-## Our Standards
-
-Examples of behavior that contributes to creating a positive environment include:
-
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
-
-* The use of sexualized language or imagery and unwelcome sexual attention or advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a professional setting
-
-## Our Responsibilities
-
-Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
-
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
-
-## Scope
-
-This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
-
-## Enforcement
-
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at i@dario.im. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
-
-Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
-
-## Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
-
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
diff --git a/vendor/github.com/imdario/mergo/LICENSE b/vendor/github.com/imdario/mergo/LICENSE
deleted file mode 100644
index 68668029..00000000
--- a/vendor/github.com/imdario/mergo/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2013 Dario Castañé. All rights reserved.
-Copyright (c) 2012 The Go Authors. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/imdario/mergo/README.md b/vendor/github.com/imdario/mergo/README.md
deleted file mode 100644
index 02fc81e0..00000000
--- a/vendor/github.com/imdario/mergo/README.md
+++ /dev/null
@@ -1,238 +0,0 @@
-# Mergo
-
-A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements.
-
-Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the Province of Ancona in the Italian region of Marche.
-
-## Status
-
-It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc](https://github.com/imdario/mergo#mergo-in-the-wild).
-
-[![GoDoc][3]][4]
-[![GoCard][5]][6]
-[![Build Status][1]][2]
-[![Coverage Status][7]][8]
-[![Sourcegraph][9]][10]
-[](https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_shield)
-
-[1]: https://travis-ci.org/imdario/mergo.png
-[2]: https://travis-ci.org/imdario/mergo
-[3]: https://godoc.org/github.com/imdario/mergo?status.svg
-[4]: https://godoc.org/github.com/imdario/mergo
-[5]: https://goreportcard.com/badge/imdario/mergo
-[6]: https://goreportcard.com/report/github.com/imdario/mergo
-[7]: https://coveralls.io/repos/github/imdario/mergo/badge.svg?branch=master
-[8]: https://coveralls.io/github/imdario/mergo?branch=master
-[9]: https://sourcegraph.com/github.com/imdario/mergo/-/badge.svg
-[10]: https://sourcegraph.com/github.com/imdario/mergo?badge
-
-### Latest release
-
-[Release v0.3.7](https://github.com/imdario/mergo/releases/tag/v0.3.7).
-
-### Important note
-
-Please keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2) Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). An optional/variadic argument has been added, so it won't break existing code.
-
-If you were using Mergo **before** April 6th 2015, please check your project works as intended after updating your local copy with ```go get -u github.com/imdario/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause (I hope it won't!) in existing projects after the change (release 0.2.0).
-
-### Donations
-
-If Mergo is useful to you, consider buying me a coffee, a beer or making a monthly donation so I can keep building great free software. :heart_eyes:
-
-
-[](https://beerpay.io/imdario/mergo)
-[](https://beerpay.io/imdario/mergo)
-
-
-### Mergo in the wild
-
-- [moby/moby](https://github.com/moby/moby)
-- [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes)
-- [vmware/dispatch](https://github.com/vmware/dispatch)
-- [Shopify/themekit](https://github.com/Shopify/themekit)
-- [imdario/zas](https://github.com/imdario/zas)
-- [matcornic/hermes](https://github.com/matcornic/hermes)
-- [OpenBazaar/openbazaar-go](https://github.com/OpenBazaar/openbazaar-go)
-- [kataras/iris](https://github.com/kataras/iris)
-- [michaelsauter/crane](https://github.com/michaelsauter/crane)
-- [go-task/task](https://github.com/go-task/task)
-- [sensu/uchiwa](https://github.com/sensu/uchiwa)
-- [ory/hydra](https://github.com/ory/hydra)
-- [sisatech/vcli](https://github.com/sisatech/vcli)
-- [dairycart/dairycart](https://github.com/dairycart/dairycart)
-- [projectcalico/felix](https://github.com/projectcalico/felix)
-- [resin-os/balena](https://github.com/resin-os/balena)
-- [go-kivik/kivik](https://github.com/go-kivik/kivik)
-- [Telefonica/govice](https://github.com/Telefonica/govice)
-- [supergiant/supergiant](supergiant/supergiant)
-- [SergeyTsalkov/brooce](https://github.com/SergeyTsalkov/brooce)
-- [soniah/dnsmadeeasy](https://github.com/soniah/dnsmadeeasy)
-- [ohsu-comp-bio/funnel](https://github.com/ohsu-comp-bio/funnel)
-- [EagerIO/Stout](https://github.com/EagerIO/Stout)
-- [lynndylanhurley/defsynth-api](https://github.com/lynndylanhurley/defsynth-api)
-- [russross/canvasassignments](https://github.com/russross/canvasassignments)
-- [rdegges/cryptly-api](https://github.com/rdegges/cryptly-api)
-- [casualjim/exeggutor](https://github.com/casualjim/exeggutor)
-- [divshot/gitling](https://github.com/divshot/gitling)
-- [RWJMurphy/gorl](https://github.com/RWJMurphy/gorl)
-- [andrerocker/deploy42](https://github.com/andrerocker/deploy42)
-- [elwinar/rambler](https://github.com/elwinar/rambler)
-- [tmaiaroto/gopartman](https://github.com/tmaiaroto/gopartman)
-- [jfbus/impressionist](https://github.com/jfbus/impressionist)
-- [Jmeyering/zealot](https://github.com/Jmeyering/zealot)
-- [godep-migrator/rigger-host](https://github.com/godep-migrator/rigger-host)
-- [Dronevery/MultiwaySwitch-Go](https://github.com/Dronevery/MultiwaySwitch-Go)
-- [thoas/picfit](https://github.com/thoas/picfit)
-- [mantasmatelis/whooplist-server](https://github.com/mantasmatelis/whooplist-server)
-- [jnuthong/item_search](https://github.com/jnuthong/item_search)
-- [bukalapak/snowboard](https://github.com/bukalapak/snowboard)
-
-## Installation
-
- go get github.com/imdario/mergo
-
- // use in your .go code
- import (
- "github.com/imdario/mergo"
- )
-
-## Usage
-
-You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as [they are not considered zero values](https://golang.org/ref/spec#The_zero_value) either. Also maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection).
-
-```go
-if err := mergo.Merge(&dst, src); err != nil {
- // ...
-}
-```
-
-Also, you can merge overwriting values using the transformer `WithOverride`.
-
-```go
-if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil {
- // ...
-}
-```
-
-Additionally, you can map a `map[string]interface{}` to a struct (and otherwise, from struct to map), following the same restrictions as in `Merge()`. Keys are capitalized to find each corresponding exported field.
-
-```go
-if err := mergo.Map(&dst, srcMap); err != nil {
- // ...
-}
-```
-
-Warning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as `map[string]interface{}`. They will be just assigned as values.
-
-More information and examples in [godoc documentation](http://godoc.org/github.com/imdario/mergo).
-
-### Nice example
-
-```go
-package main
-
-import (
- "fmt"
- "github.com/imdario/mergo"
-)
-
-type Foo struct {
- A string
- B int64
-}
-
-func main() {
- src := Foo{
- A: "one",
- B: 2,
- }
- dest := Foo{
- A: "two",
- }
- mergo.Merge(&dest, src)
- fmt.Println(dest)
- // Will print
- // {two 2}
-}
-```
-
-Note: if test are failing due missing package, please execute:
-
- go get gopkg.in/yaml.v2
-
-### Transformers
-
-Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, `time.Time` is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero `time.Time`?
-
-```go
-package main
-
-import (
- "fmt"
- "github.com/imdario/mergo"
- "reflect"
- "time"
-)
-
-type timeTransfomer struct {
-}
-
-func (t timeTransfomer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error {
- if typ == reflect.TypeOf(time.Time{}) {
- return func(dst, src reflect.Value) error {
- if dst.CanSet() {
- isZero := dst.MethodByName("IsZero")
- result := isZero.Call([]reflect.Value{})
- if result[0].Bool() {
- dst.Set(src)
- }
- }
- return nil
- }
- }
- return nil
-}
-
-type Snapshot struct {
- Time time.Time
- // ...
-}
-
-func main() {
- src := Snapshot{time.Now()}
- dest := Snapshot{}
- mergo.Merge(&dest, src, mergo.WithTransformers(timeTransfomer{}))
- fmt.Println(dest)
- // Will print
- // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 }
-}
-```
-
-
-## Contact me
-
-If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): [@im_dario](https://twitter.com/im_dario)
-
-## About
-
-Written by [Dario Castañé](http://dario.im).
-
-## Top Contributors
-
-[](https://sourcerer.io/fame/imdario/imdario/mergo/links/0)
-[](https://sourcerer.io/fame/imdario/imdario/mergo/links/1)
-[](https://sourcerer.io/fame/imdario/imdario/mergo/links/2)
-[](https://sourcerer.io/fame/imdario/imdario/mergo/links/3)
-[](https://sourcerer.io/fame/imdario/imdario/mergo/links/4)
-[](https://sourcerer.io/fame/imdario/imdario/mergo/links/5)
-[](https://sourcerer.io/fame/imdario/imdario/mergo/links/6)
-[](https://sourcerer.io/fame/imdario/imdario/mergo/links/7)
-
-
-## License
-
-[BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause) license, as [Go language](http://golang.org/LICENSE).
-
-
-[](https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_large)
diff --git a/vendor/github.com/imdario/mergo/doc.go b/vendor/github.com/imdario/mergo/doc.go
deleted file mode 100644
index 6e9aa7ba..00000000
--- a/vendor/github.com/imdario/mergo/doc.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2013 Dario Castañé. All rights reserved.
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-Package mergo merges same-type structs and maps by setting default values in zero-value fields.
-
-Mergo won't merge unexported (private) fields but will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection).
-
-Usage
-
-From my own work-in-progress project:
-
- type networkConfig struct {
- Protocol string
- Address string
- ServerType string `json: "server_type"`
- Port uint16
- }
-
- type FssnConfig struct {
- Network networkConfig
- }
-
- var fssnDefault = FssnConfig {
- networkConfig {
- "tcp",
- "127.0.0.1",
- "http",
- 31560,
- },
- }
-
- // Inside a function [...]
-
- if err := mergo.Merge(&config, fssnDefault); err != nil {
- log.Fatal(err)
- }
-
- // More code [...]
-
-*/
-package mergo
diff --git a/vendor/github.com/imdario/mergo/map.go b/vendor/github.com/imdario/mergo/map.go
deleted file mode 100644
index 3f5afa83..00000000
--- a/vendor/github.com/imdario/mergo/map.go
+++ /dev/null
@@ -1,175 +0,0 @@
-// Copyright 2014 Dario Castañé. All rights reserved.
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Based on src/pkg/reflect/deepequal.go from official
-// golang's stdlib.
-
-package mergo
-
-import (
- "fmt"
- "reflect"
- "unicode"
- "unicode/utf8"
-)
-
-func changeInitialCase(s string, mapper func(rune) rune) string {
- if s == "" {
- return s
- }
- r, n := utf8.DecodeRuneInString(s)
- return string(mapper(r)) + s[n:]
-}
-
-func isExported(field reflect.StructField) bool {
- r, _ := utf8.DecodeRuneInString(field.Name)
- return r >= 'A' && r <= 'Z'
-}
-
-// Traverses recursively both values, assigning src's fields values to dst.
-// The map argument tracks comparisons that have already been seen, which allows
-// short circuiting on recursive types.
-func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) {
- overwrite := config.Overwrite
- if dst.CanAddr() {
- addr := dst.UnsafeAddr()
- h := 17 * addr
- seen := visited[h]
- typ := dst.Type()
- for p := seen; p != nil; p = p.next {
- if p.ptr == addr && p.typ == typ {
- return nil
- }
- }
- // Remember, remember...
- visited[h] = &visit{addr, typ, seen}
- }
- zeroValue := reflect.Value{}
- switch dst.Kind() {
- case reflect.Map:
- dstMap := dst.Interface().(map[string]interface{})
- for i, n := 0, src.NumField(); i < n; i++ {
- srcType := src.Type()
- field := srcType.Field(i)
- if !isExported(field) {
- continue
- }
- fieldName := field.Name
- fieldName = changeInitialCase(fieldName, unicode.ToLower)
- if v, ok := dstMap[fieldName]; !ok || (isEmptyValue(reflect.ValueOf(v)) || overwrite) {
- dstMap[fieldName] = src.Field(i).Interface()
- }
- }
- case reflect.Ptr:
- if dst.IsNil() {
- v := reflect.New(dst.Type().Elem())
- dst.Set(v)
- }
- dst = dst.Elem()
- fallthrough
- case reflect.Struct:
- srcMap := src.Interface().(map[string]interface{})
- for key := range srcMap {
- config.overwriteWithEmptyValue = true
- srcValue := srcMap[key]
- fieldName := changeInitialCase(key, unicode.ToUpper)
- dstElement := dst.FieldByName(fieldName)
- if dstElement == zeroValue {
- // We discard it because the field doesn't exist.
- continue
- }
- srcElement := reflect.ValueOf(srcValue)
- dstKind := dstElement.Kind()
- srcKind := srcElement.Kind()
- if srcKind == reflect.Ptr && dstKind != reflect.Ptr {
- srcElement = srcElement.Elem()
- srcKind = reflect.TypeOf(srcElement.Interface()).Kind()
- } else if dstKind == reflect.Ptr {
- // Can this work? I guess it can't.
- if srcKind != reflect.Ptr && srcElement.CanAddr() {
- srcPtr := srcElement.Addr()
- srcElement = reflect.ValueOf(srcPtr)
- srcKind = reflect.Ptr
- }
- }
-
- if !srcElement.IsValid() {
- continue
- }
- if srcKind == dstKind {
- if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil {
- return
- }
- } else if dstKind == reflect.Interface && dstElement.Kind() == reflect.Interface {
- if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil {
- return
- }
- } else if srcKind == reflect.Map {
- if err = deepMap(dstElement, srcElement, visited, depth+1, config); err != nil {
- return
- }
- } else {
- return fmt.Errorf("type mismatch on %s field: found %v, expected %v", fieldName, srcKind, dstKind)
- }
- }
- }
- return
-}
-
-// Map sets fields' values in dst from src.
-// src can be a map with string keys or a struct. dst must be the opposite:
-// if src is a map, dst must be a valid pointer to struct. If src is a struct,
-// dst must be map[string]interface{}.
-// It won't merge unexported (private) fields and will do recursively
-// any exported field.
-// If dst is a map, keys will be src fields' names in lower camel case.
-// Missing key in src that doesn't match a field in dst will be skipped. This
-// doesn't apply if dst is a map.
-// This is separated method from Merge because it is cleaner and it keeps sane
-// semantics: merging equal types, mapping different (restricted) types.
-func Map(dst, src interface{}, opts ...func(*Config)) error {
- return _map(dst, src, opts...)
-}
-
-// MapWithOverwrite will do the same as Map except that non-empty dst attributes will be overridden by
-// non-empty src attribute values.
-// Deprecated: Use Map(…) with WithOverride
-func MapWithOverwrite(dst, src interface{}, opts ...func(*Config)) error {
- return _map(dst, src, append(opts, WithOverride)...)
-}
-
-func _map(dst, src interface{}, opts ...func(*Config)) error {
- var (
- vDst, vSrc reflect.Value
- err error
- )
- config := &Config{}
-
- for _, opt := range opts {
- opt(config)
- }
-
- if vDst, vSrc, err = resolveValues(dst, src); err != nil {
- return err
- }
- // To be friction-less, we redirect equal-type arguments
- // to deepMerge. Only because arguments can be anything.
- if vSrc.Kind() == vDst.Kind() {
- return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config)
- }
- switch vSrc.Kind() {
- case reflect.Struct:
- if vDst.Kind() != reflect.Map {
- return ErrExpectedMapAsDestination
- }
- case reflect.Map:
- if vDst.Kind() != reflect.Struct {
- return ErrExpectedStructAsDestination
- }
- default:
- return ErrNotSupported
- }
- return deepMap(vDst, vSrc, make(map[uintptr]*visit), 0, config)
-}
diff --git a/vendor/github.com/imdario/mergo/merge.go b/vendor/github.com/imdario/mergo/merge.go
deleted file mode 100644
index 3fb6c64d..00000000
--- a/vendor/github.com/imdario/mergo/merge.go
+++ /dev/null
@@ -1,283 +0,0 @@
-// Copyright 2013 Dario Castañé. All rights reserved.
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Based on src/pkg/reflect/deepequal.go from official
-// golang's stdlib.
-
-package mergo
-
-import (
- "fmt"
- "reflect"
-)
-
-func hasExportedField(dst reflect.Value) (exported bool) {
- for i, n := 0, dst.NumField(); i < n; i++ {
- field := dst.Type().Field(i)
- if field.Anonymous && dst.Field(i).Kind() == reflect.Struct {
- exported = exported || hasExportedField(dst.Field(i))
- } else {
- exported = exported || len(field.PkgPath) == 0
- }
- }
- return
-}
-
-type Config struct {
- Overwrite bool
- AppendSlice bool
- TypeCheck bool
- Transformers Transformers
- overwriteWithEmptyValue bool
- overwriteSliceWithEmptyValue bool
-}
-
-type Transformers interface {
- Transformer(reflect.Type) func(dst, src reflect.Value) error
-}
-
-// Traverses recursively both values, assigning src's fields values to dst.
-// The map argument tracks comparisons that have already been seen, which allows
-// short circuiting on recursive types.
-func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) {
- overwrite := config.Overwrite
- typeCheck := config.TypeCheck
- overwriteWithEmptySrc := config.overwriteWithEmptyValue
- overwriteSliceWithEmptySrc := config.overwriteSliceWithEmptyValue
- config.overwriteWithEmptyValue = false
-
- if !src.IsValid() {
- return
- }
- if dst.CanAddr() {
- addr := dst.UnsafeAddr()
- h := 17 * addr
- seen := visited[h]
- typ := dst.Type()
- for p := seen; p != nil; p = p.next {
- if p.ptr == addr && p.typ == typ {
- return nil
- }
- }
- // Remember, remember...
- visited[h] = &visit{addr, typ, seen}
- }
-
- if config.Transformers != nil && !isEmptyValue(dst) {
- if fn := config.Transformers.Transformer(dst.Type()); fn != nil {
- err = fn(dst, src)
- return
- }
- }
-
- switch dst.Kind() {
- case reflect.Struct:
- if hasExportedField(dst) {
- for i, n := 0, dst.NumField(); i < n; i++ {
- if err = deepMerge(dst.Field(i), src.Field(i), visited, depth+1, config); err != nil {
- return
- }
- }
- } else {
- if dst.CanSet() && (!isEmptyValue(src) || overwriteWithEmptySrc) && (overwrite || isEmptyValue(dst)) {
- dst.Set(src)
- }
- }
- case reflect.Map:
- if dst.IsNil() && !src.IsNil() {
- dst.Set(reflect.MakeMap(dst.Type()))
- }
- for _, key := range src.MapKeys() {
- srcElement := src.MapIndex(key)
- if !srcElement.IsValid() {
- continue
- }
- dstElement := dst.MapIndex(key)
- switch srcElement.Kind() {
- case reflect.Chan, reflect.Func, reflect.Map, reflect.Interface, reflect.Slice:
- if srcElement.IsNil() {
- continue
- }
- fallthrough
- default:
- if !srcElement.CanInterface() {
- continue
- }
- switch reflect.TypeOf(srcElement.Interface()).Kind() {
- case reflect.Struct:
- fallthrough
- case reflect.Ptr:
- fallthrough
- case reflect.Map:
- srcMapElm := srcElement
- dstMapElm := dstElement
- if srcMapElm.CanInterface() {
- srcMapElm = reflect.ValueOf(srcMapElm.Interface())
- if dstMapElm.IsValid() {
- dstMapElm = reflect.ValueOf(dstMapElm.Interface())
- }
- }
- if err = deepMerge(dstMapElm, srcMapElm, visited, depth+1, config); err != nil {
- return
- }
- case reflect.Slice:
- srcSlice := reflect.ValueOf(srcElement.Interface())
-
- var dstSlice reflect.Value
- if !dstElement.IsValid() || dstElement.IsNil() {
- dstSlice = reflect.MakeSlice(srcSlice.Type(), 0, srcSlice.Len())
- } else {
- dstSlice = reflect.ValueOf(dstElement.Interface())
- }
-
- if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
- if typeCheck && srcSlice.Type() != dstSlice.Type() {
- return fmt.Errorf("cannot override two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type())
- }
- dstSlice = srcSlice
- } else if config.AppendSlice {
- if srcSlice.Type() != dstSlice.Type() {
- return fmt.Errorf("cannot append two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type())
- }
- dstSlice = reflect.AppendSlice(dstSlice, srcSlice)
- }
- dst.SetMapIndex(key, dstSlice)
- }
- }
- if dstElement.IsValid() && !isEmptyValue(dstElement) && (reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Map || reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Slice) {
- continue
- }
-
- if srcElement.IsValid() && ((srcElement.Kind() != reflect.Ptr && overwrite) || !dstElement.IsValid() || isEmptyValue(dstElement)) {
- if dst.IsNil() {
- dst.Set(reflect.MakeMap(dst.Type()))
- }
- dst.SetMapIndex(key, srcElement)
- }
- }
- case reflect.Slice:
- if !dst.CanSet() {
- break
- }
- if (!isEmptyValue(src) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
- dst.Set(src)
- } else if config.AppendSlice {
- if src.Type() != dst.Type() {
- return fmt.Errorf("cannot append two slice with different type (%s, %s)", src.Type(), dst.Type())
- }
- dst.Set(reflect.AppendSlice(dst, src))
- }
- case reflect.Ptr:
- fallthrough
- case reflect.Interface:
- if src.IsNil() {
- break
- }
-
- if dst.Kind() != reflect.Ptr && src.Type().AssignableTo(dst.Type()) {
- if dst.IsNil() || overwrite {
- if dst.CanSet() && (overwrite || isEmptyValue(dst)) {
- dst.Set(src)
- }
- }
- break
- }
-
- if src.Kind() != reflect.Interface {
- if dst.IsNil() || (src.Kind() != reflect.Ptr && overwrite) {
- if dst.CanSet() && (overwrite || isEmptyValue(dst)) {
- dst.Set(src)
- }
- } else if src.Kind() == reflect.Ptr {
- if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil {
- return
- }
- } else if dst.Elem().Type() == src.Type() {
- if err = deepMerge(dst.Elem(), src, visited, depth+1, config); err != nil {
- return
- }
- } else {
- return ErrDifferentArgumentsTypes
- }
- break
- }
- if dst.IsNil() || overwrite {
- if dst.CanSet() && (overwrite || isEmptyValue(dst)) {
- dst.Set(src)
- }
- } else if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil {
- return
- }
- default:
- if dst.CanSet() && (!isEmptyValue(src) || overwriteWithEmptySrc) && (overwrite || isEmptyValue(dst)) {
- dst.Set(src)
- }
- }
-
- return
-}
-
-// Merge will fill any empty for value type attributes on the dst struct using corresponding
-// src attributes if they themselves are not empty. dst and src must be valid same-type structs
-// and dst must be a pointer to struct.
-// It won't merge unexported (private) fields and will do recursively any exported field.
-func Merge(dst, src interface{}, opts ...func(*Config)) error {
- return merge(dst, src, opts...)
-}
-
-// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overridden by
-// non-empty src attribute values.
-// Deprecated: use Merge(…) with WithOverride
-func MergeWithOverwrite(dst, src interface{}, opts ...func(*Config)) error {
- return merge(dst, src, append(opts, WithOverride)...)
-}
-
-// WithTransformers adds transformers to merge, allowing to customize the merging of some types.
-func WithTransformers(transformers Transformers) func(*Config) {
- return func(config *Config) {
- config.Transformers = transformers
- }
-}
-
-// WithOverride will make merge override non-empty dst attributes with non-empty src attributes values.
-func WithOverride(config *Config) {
- config.Overwrite = true
-}
-
-// WithOverride will make merge override empty dst slice with empty src slice.
-func WithOverrideEmptySlice(config *Config) {
- config.overwriteSliceWithEmptyValue = true
-}
-
-// WithAppendSlice will make merge append slices instead of overwriting it.
-func WithAppendSlice(config *Config) {
- config.AppendSlice = true
-}
-
-// WithTypeCheck will make merge check types while overwriting it (must be used with WithOverride).
-func WithTypeCheck(config *Config) {
- config.TypeCheck = true
-}
-
-func merge(dst, src interface{}, opts ...func(*Config)) error {
- var (
- vDst, vSrc reflect.Value
- err error
- )
-
- config := &Config{}
-
- for _, opt := range opts {
- opt(config)
- }
-
- if vDst, vSrc, err = resolveValues(dst, src); err != nil {
- return err
- }
- if vDst.Type() != vSrc.Type() {
- return ErrDifferentArgumentsTypes
- }
- return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config)
-}
diff --git a/vendor/github.com/imdario/mergo/mergo.go b/vendor/github.com/imdario/mergo/mergo.go
deleted file mode 100644
index a82fea2f..00000000
--- a/vendor/github.com/imdario/mergo/mergo.go
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2013 Dario Castañé. All rights reserved.
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Based on src/pkg/reflect/deepequal.go from official
-// golang's stdlib.
-
-package mergo
-
-import (
- "errors"
- "reflect"
-)
-
-// Errors reported by Mergo when it finds invalid arguments.
-var (
- ErrNilArguments = errors.New("src and dst must not be nil")
- ErrDifferentArgumentsTypes = errors.New("src and dst must be of same type")
- ErrNotSupported = errors.New("only structs and maps are supported")
- ErrExpectedMapAsDestination = errors.New("dst was expected to be a map")
- ErrExpectedStructAsDestination = errors.New("dst was expected to be a struct")
-)
-
-// During deepMerge, must keep track of checks that are
-// in progress. The comparison algorithm assumes that all
-// checks in progress are true when it reencounters them.
-// Visited are stored in a map indexed by 17 * a1 + a2;
-type visit struct {
- ptr uintptr
- typ reflect.Type
- next *visit
-}
-
-// From src/pkg/encoding/json/encode.go.
-func isEmptyValue(v reflect.Value) bool {
- switch v.Kind() {
- case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
- return v.Len() == 0
- case reflect.Bool:
- return !v.Bool()
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return v.Int() == 0
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- return v.Uint() == 0
- case reflect.Float32, reflect.Float64:
- return v.Float() == 0
- case reflect.Interface, reflect.Ptr:
- if v.IsNil() {
- return true
- }
- return isEmptyValue(v.Elem())
- case reflect.Func:
- return v.IsNil()
- case reflect.Invalid:
- return true
- }
- return false
-}
-
-func resolveValues(dst, src interface{}) (vDst, vSrc reflect.Value, err error) {
- if dst == nil || src == nil {
- err = ErrNilArguments
- return
- }
- vDst = reflect.ValueOf(dst).Elem()
- if vDst.Kind() != reflect.Struct && vDst.Kind() != reflect.Map {
- err = ErrNotSupported
- return
- }
- vSrc = reflect.ValueOf(src)
- // We check if vSrc is a pointer to dereference it.
- if vSrc.Kind() == reflect.Ptr {
- vSrc = vSrc.Elem()
- }
- return
-}
-
-// Traverses recursively both values, assigning src's fields values to dst.
-// The map argument tracks comparisons that have already been seen, which allows
-// short circuiting on recursive types.
-func deeper(dst, src reflect.Value, visited map[uintptr]*visit, depth int) (err error) {
- if dst.CanAddr() {
- addr := dst.UnsafeAddr()
- h := 17 * addr
- seen := visited[h]
- typ := dst.Type()
- for p := seen; p != nil; p = p.next {
- if p.ptr == addr && p.typ == typ {
- return nil
- }
- }
- // Remember, remember...
- visited[h] = &visit{addr, typ, seen}
- }
- return // TODO refactor
-}
diff --git a/vendor/github.com/inconshreveable/mousetrap/LICENSE b/vendor/github.com/inconshreveable/mousetrap/LICENSE
deleted file mode 100644
index 5f0d1fb6..00000000
--- a/vendor/github.com/inconshreveable/mousetrap/LICENSE
+++ /dev/null
@@ -1,13 +0,0 @@
-Copyright 2014 Alan Shreve
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/vendor/github.com/inconshreveable/mousetrap/README.md b/vendor/github.com/inconshreveable/mousetrap/README.md
deleted file mode 100644
index 7a950d17..00000000
--- a/vendor/github.com/inconshreveable/mousetrap/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# mousetrap
-
-mousetrap is a tiny library that answers a single question.
-
-On a Windows machine, was the process invoked by someone double clicking on
-the executable file while browsing in explorer?
-
-### Motivation
-
-Windows developers unfamiliar with command line tools will often "double-click"
-the executable for a tool. Because most CLI tools print the help and then exit
-when invoked without arguments, this is often very frustrating for those users.
-
-mousetrap provides a way to detect these invocations so that you can provide
-more helpful behavior and instructions on how to run the CLI tool. To see what
-this looks like, both from an organizational and a technical perspective, see
-https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/
-
-### The interface
-
-The library exposes a single interface:
-
- func StartedByExplorer() (bool)
diff --git a/vendor/github.com/inconshreveable/mousetrap/trap_others.go b/vendor/github.com/inconshreveable/mousetrap/trap_others.go
deleted file mode 100644
index 9d2d8a4b..00000000
--- a/vendor/github.com/inconshreveable/mousetrap/trap_others.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// +build !windows
-
-package mousetrap
-
-// StartedByExplorer returns true if the program was invoked by the user
-// double-clicking on the executable from explorer.exe
-//
-// It is conservative and returns false if any of the internal calls fail.
-// It does not guarantee that the program was run from a terminal. It only can tell you
-// whether it was launched from explorer.exe
-//
-// On non-Windows platforms, it always returns false.
-func StartedByExplorer() bool {
- return false
-}
diff --git a/vendor/github.com/inconshreveable/mousetrap/trap_windows.go b/vendor/github.com/inconshreveable/mousetrap/trap_windows.go
deleted file mode 100644
index 336142a5..00000000
--- a/vendor/github.com/inconshreveable/mousetrap/trap_windows.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// +build windows
-// +build !go1.4
-
-package mousetrap
-
-import (
- "fmt"
- "os"
- "syscall"
- "unsafe"
-)
-
-const (
- // defined by the Win32 API
- th32cs_snapprocess uintptr = 0x2
-)
-
-var (
- kernel = syscall.MustLoadDLL("kernel32.dll")
- CreateToolhelp32Snapshot = kernel.MustFindProc("CreateToolhelp32Snapshot")
- Process32First = kernel.MustFindProc("Process32FirstW")
- Process32Next = kernel.MustFindProc("Process32NextW")
-)
-
-// ProcessEntry32 structure defined by the Win32 API
-type processEntry32 struct {
- dwSize uint32
- cntUsage uint32
- th32ProcessID uint32
- th32DefaultHeapID int
- th32ModuleID uint32
- cntThreads uint32
- th32ParentProcessID uint32
- pcPriClassBase int32
- dwFlags uint32
- szExeFile [syscall.MAX_PATH]uint16
-}
-
-func getProcessEntry(pid int) (pe *processEntry32, err error) {
- snapshot, _, e1 := CreateToolhelp32Snapshot.Call(th32cs_snapprocess, uintptr(0))
- if snapshot == uintptr(syscall.InvalidHandle) {
- err = fmt.Errorf("CreateToolhelp32Snapshot: %v", e1)
- return
- }
- defer syscall.CloseHandle(syscall.Handle(snapshot))
-
- var processEntry processEntry32
- processEntry.dwSize = uint32(unsafe.Sizeof(processEntry))
- ok, _, e1 := Process32First.Call(snapshot, uintptr(unsafe.Pointer(&processEntry)))
- if ok == 0 {
- err = fmt.Errorf("Process32First: %v", e1)
- return
- }
-
- for {
- if processEntry.th32ProcessID == uint32(pid) {
- pe = &processEntry
- return
- }
-
- ok, _, e1 = Process32Next.Call(snapshot, uintptr(unsafe.Pointer(&processEntry)))
- if ok == 0 {
- err = fmt.Errorf("Process32Next: %v", e1)
- return
- }
- }
-}
-
-func getppid() (pid int, err error) {
- pe, err := getProcessEntry(os.Getpid())
- if err != nil {
- return
- }
-
- pid = int(pe.th32ParentProcessID)
- return
-}
-
-// StartedByExplorer returns true if the program was invoked by the user double-clicking
-// on the executable from explorer.exe
-//
-// It is conservative and returns false if any of the internal calls fail.
-// It does not guarantee that the program was run from a terminal. It only can tell you
-// whether it was launched from explorer.exe
-func StartedByExplorer() bool {
- ppid, err := getppid()
- if err != nil {
- return false
- }
-
- pe, err := getProcessEntry(ppid)
- if err != nil {
- return false
- }
-
- name := syscall.UTF16ToString(pe.szExeFile[:])
- return name == "explorer.exe"
-}
diff --git a/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go b/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
deleted file mode 100644
index 9a28e57c..00000000
--- a/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// +build windows
-// +build go1.4
-
-package mousetrap
-
-import (
- "os"
- "syscall"
- "unsafe"
-)
-
-func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) {
- snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0)
- if err != nil {
- return nil, err
- }
- defer syscall.CloseHandle(snapshot)
- var procEntry syscall.ProcessEntry32
- procEntry.Size = uint32(unsafe.Sizeof(procEntry))
- if err = syscall.Process32First(snapshot, &procEntry); err != nil {
- return nil, err
- }
- for {
- if procEntry.ProcessID == uint32(pid) {
- return &procEntry, nil
- }
- err = syscall.Process32Next(snapshot, &procEntry)
- if err != nil {
- return nil, err
- }
- }
-}
-
-// StartedByExplorer returns true if the program was invoked by the user double-clicking
-// on the executable from explorer.exe
-//
-// It is conservative and returns false if any of the internal calls fail.
-// It does not guarantee that the program was run from a terminal. It only can tell you
-// whether it was launched from explorer.exe
-func StartedByExplorer() bool {
- pe, err := getProcessEntry(os.Getppid())
- if err != nil {
- return false
- }
- return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:])
-}
diff --git a/vendor/github.com/json-iterator/go/.codecov.yml b/vendor/github.com/json-iterator/go/.codecov.yml
deleted file mode 100644
index 955dc0be..00000000
--- a/vendor/github.com/json-iterator/go/.codecov.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-ignore:
- - "output_tests/.*"
-
diff --git a/vendor/github.com/json-iterator/go/.gitignore b/vendor/github.com/json-iterator/go/.gitignore
deleted file mode 100644
index 15556530..00000000
--- a/vendor/github.com/json-iterator/go/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/vendor
-/bug_test.go
-/coverage.txt
-/.idea
diff --git a/vendor/github.com/json-iterator/go/.travis.yml b/vendor/github.com/json-iterator/go/.travis.yml
deleted file mode 100644
index 449e67cd..00000000
--- a/vendor/github.com/json-iterator/go/.travis.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-language: go
-
-go:
- - 1.8.x
- - 1.x
-
-before_install:
- - go get -t -v ./...
-
-script:
- - ./test.sh
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/json-iterator/go/Gopkg.lock b/vendor/github.com/json-iterator/go/Gopkg.lock
deleted file mode 100644
index c8a9fbb3..00000000
--- a/vendor/github.com/json-iterator/go/Gopkg.lock
+++ /dev/null
@@ -1,21 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
- name = "github.com/modern-go/concurrent"
- packages = ["."]
- revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a"
- version = "1.0.0"
-
-[[projects]]
- name = "github.com/modern-go/reflect2"
- packages = ["."]
- revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd"
- version = "1.0.1"
-
-[solve-meta]
- analyzer-name = "dep"
- analyzer-version = 1
- inputs-digest = "ea54a775e5a354cb015502d2e7aa4b74230fc77e894f34a838b268c25ec8eeb8"
- solver-name = "gps-cdcl"
- solver-version = 1
diff --git a/vendor/github.com/json-iterator/go/Gopkg.toml b/vendor/github.com/json-iterator/go/Gopkg.toml
deleted file mode 100644
index 313a0f88..00000000
--- a/vendor/github.com/json-iterator/go/Gopkg.toml
+++ /dev/null
@@ -1,26 +0,0 @@
-# Gopkg.toml example
-#
-# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
-# for detailed Gopkg.toml documentation.
-#
-# required = ["github.com/user/thing/cmd/thing"]
-# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
-#
-# [[constraint]]
-# name = "github.com/user/project"
-# version = "1.0.0"
-#
-# [[constraint]]
-# name = "github.com/user/project2"
-# branch = "dev"
-# source = "github.com/myfork/project2"
-#
-# [[override]]
-# name = "github.com/x/y"
-# version = "2.4.0"
-
-ignored = ["github.com/davecgh/go-spew*","github.com/google/gofuzz*","github.com/stretchr/testify*"]
-
-[[constraint]]
- name = "github.com/modern-go/reflect2"
- version = "1.0.1"
diff --git a/vendor/github.com/json-iterator/go/LICENSE b/vendor/github.com/json-iterator/go/LICENSE
deleted file mode 100644
index 2cf4f5ab..00000000
--- a/vendor/github.com/json-iterator/go/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2016 json-iterator
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/vendor/github.com/json-iterator/go/README.md b/vendor/github.com/json-iterator/go/README.md
deleted file mode 100644
index 52b111d5..00000000
--- a/vendor/github.com/json-iterator/go/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-[](https://sourcegraph.com/github.com/json-iterator/go?badge)
-[](https://pkg.go.dev/github.com/json-iterator/go)
-[](https://travis-ci.org/json-iterator/go)
-[](https://codecov.io/gh/json-iterator/go)
-[](https://goreportcard.com/report/github.com/json-iterator/go)
-[](https://raw.githubusercontent.com/json-iterator/go/master/LICENSE)
-[](https://gitter.im/json-iterator/Lobby)
-
-A high-performance 100% compatible drop-in replacement of "encoding/json"
-
-You can also use thrift like JSON using [thrift-iterator](https://github.com/thrift-iterator/go)
-
-# Benchmark
-
-
-
-Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go
-
-Raw Result (easyjson requires static code generation)
-
-| | ns/op | allocation bytes | allocation times |
-| --------------- | ----------- | ---------------- | ---------------- |
-| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op |
-| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op |
-| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op |
-| std encode | 2213 ns/op | 712 B/op | 5 allocs/op |
-| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op |
-| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op |
-
-Always benchmark with your own workload.
-The result depends heavily on the data input.
-
-# Usage
-
-100% compatibility with standard lib
-
-Replace
-
-```go
-import "encoding/json"
-json.Marshal(&data)
-```
-
-with
-
-```go
-import jsoniter "github.com/json-iterator/go"
-
-var json = jsoniter.ConfigCompatibleWithStandardLibrary
-json.Marshal(&data)
-```
-
-Replace
-
-```go
-import "encoding/json"
-json.Unmarshal(input, &data)
-```
-
-with
-
-```go
-import jsoniter "github.com/json-iterator/go"
-
-var json = jsoniter.ConfigCompatibleWithStandardLibrary
-json.Unmarshal(input, &data)
-```
-
-[More documentation](http://jsoniter.com/migrate-from-go-std.html)
-
-# How to get
-
-```
-go get github.com/json-iterator/go
-```
-
-# Contribution Welcomed !
-
-Contributors
-
-- [thockin](https://github.com/thockin)
-- [mattn](https://github.com/mattn)
-- [cch123](https://github.com/cch123)
-- [Oleg Shaldybin](https://github.com/olegshaldybin)
-- [Jason Toffaletti](https://github.com/toffaletti)
-
-Report issue or pull request, or email taowen@gmail.com, or [](https://gitter.im/json-iterator/Lobby)
diff --git a/vendor/github.com/json-iterator/go/adapter.go b/vendor/github.com/json-iterator/go/adapter.go
deleted file mode 100644
index 92d2cc4a..00000000
--- a/vendor/github.com/json-iterator/go/adapter.go
+++ /dev/null
@@ -1,150 +0,0 @@
-package jsoniter
-
-import (
- "bytes"
- "io"
-)
-
-// RawMessage to make replace json with jsoniter
-type RawMessage []byte
-
-// Unmarshal adapts to json/encoding Unmarshal API
-//
-// Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v.
-// Refer to https://godoc.org/encoding/json#Unmarshal for more information
-func Unmarshal(data []byte, v interface{}) error {
- return ConfigDefault.Unmarshal(data, v)
-}
-
-// UnmarshalFromString is a convenient method to read from string instead of []byte
-func UnmarshalFromString(str string, v interface{}) error {
- return ConfigDefault.UnmarshalFromString(str, v)
-}
-
-// Get quick method to get value from deeply nested JSON structure
-func Get(data []byte, path ...interface{}) Any {
- return ConfigDefault.Get(data, path...)
-}
-
-// Marshal adapts to json/encoding Marshal API
-//
-// Marshal returns the JSON encoding of v, adapts to json/encoding Marshal API
-// Refer to https://godoc.org/encoding/json#Marshal for more information
-func Marshal(v interface{}) ([]byte, error) {
- return ConfigDefault.Marshal(v)
-}
-
-// MarshalIndent same as json.MarshalIndent. Prefix is not supported.
-func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
- return ConfigDefault.MarshalIndent(v, prefix, indent)
-}
-
-// MarshalToString convenient method to write as string instead of []byte
-func MarshalToString(v interface{}) (string, error) {
- return ConfigDefault.MarshalToString(v)
-}
-
-// NewDecoder adapts to json/stream NewDecoder API.
-//
-// NewDecoder returns a new decoder that reads from r.
-//
-// Instead of a json/encoding Decoder, an Decoder is returned
-// Refer to https://godoc.org/encoding/json#NewDecoder for more information
-func NewDecoder(reader io.Reader) *Decoder {
- return ConfigDefault.NewDecoder(reader)
-}
-
-// Decoder reads and decodes JSON values from an input stream.
-// Decoder provides identical APIs with json/stream Decoder (Token() and UseNumber() are in progress)
-type Decoder struct {
- iter *Iterator
-}
-
-// Decode decode JSON into interface{}
-func (adapter *Decoder) Decode(obj interface{}) error {
- if adapter.iter.head == adapter.iter.tail && adapter.iter.reader != nil {
- if !adapter.iter.loadMore() {
- return io.EOF
- }
- }
- adapter.iter.ReadVal(obj)
- err := adapter.iter.Error
- if err == io.EOF {
- return nil
- }
- return adapter.iter.Error
-}
-
-// More is there more?
-func (adapter *Decoder) More() bool {
- iter := adapter.iter
- if iter.Error != nil {
- return false
- }
- c := iter.nextToken()
- if c == 0 {
- return false
- }
- iter.unreadByte()
- return c != ']' && c != '}'
-}
-
-// Buffered remaining buffer
-func (adapter *Decoder) Buffered() io.Reader {
- remaining := adapter.iter.buf[adapter.iter.head:adapter.iter.tail]
- return bytes.NewReader(remaining)
-}
-
-// UseNumber causes the Decoder to unmarshal a number into an interface{} as a
-// Number instead of as a float64.
-func (adapter *Decoder) UseNumber() {
- cfg := adapter.iter.cfg.configBeforeFrozen
- cfg.UseNumber = true
- adapter.iter.cfg = cfg.frozeWithCacheReuse(adapter.iter.cfg.extraExtensions)
-}
-
-// DisallowUnknownFields causes the Decoder to return an error when the destination
-// is a struct and the input contains object keys which do not match any
-// non-ignored, exported fields in the destination.
-func (adapter *Decoder) DisallowUnknownFields() {
- cfg := adapter.iter.cfg.configBeforeFrozen
- cfg.DisallowUnknownFields = true
- adapter.iter.cfg = cfg.frozeWithCacheReuse(adapter.iter.cfg.extraExtensions)
-}
-
-// NewEncoder same as json.NewEncoder
-func NewEncoder(writer io.Writer) *Encoder {
- return ConfigDefault.NewEncoder(writer)
-}
-
-// Encoder same as json.Encoder
-type Encoder struct {
- stream *Stream
-}
-
-// Encode encode interface{} as JSON to io.Writer
-func (adapter *Encoder) Encode(val interface{}) error {
- adapter.stream.WriteVal(val)
- adapter.stream.WriteRaw("\n")
- adapter.stream.Flush()
- return adapter.stream.Error
-}
-
-// SetIndent set the indention. Prefix is not supported
-func (adapter *Encoder) SetIndent(prefix, indent string) {
- config := adapter.stream.cfg.configBeforeFrozen
- config.IndentionStep = len(indent)
- adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions)
-}
-
-// SetEscapeHTML escape html by default, set to false to disable
-func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) {
- config := adapter.stream.cfg.configBeforeFrozen
- config.EscapeHTML = escapeHTML
- adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions)
-}
-
-// Valid reports whether data is a valid JSON encoding.
-func Valid(data []byte) bool {
- return ConfigDefault.Valid(data)
-}
diff --git a/vendor/github.com/json-iterator/go/any.go b/vendor/github.com/json-iterator/go/any.go
deleted file mode 100644
index f6b8aeab..00000000
--- a/vendor/github.com/json-iterator/go/any.go
+++ /dev/null
@@ -1,325 +0,0 @@
-package jsoniter
-
-import (
- "errors"
- "fmt"
- "github.com/modern-go/reflect2"
- "io"
- "reflect"
- "strconv"
- "unsafe"
-)
-
-// Any generic object representation.
-// The lazy json implementation holds []byte and parse lazily.
-type Any interface {
- LastError() error
- ValueType() ValueType
- MustBeValid() Any
- ToBool() bool
- ToInt() int
- ToInt32() int32
- ToInt64() int64
- ToUint() uint
- ToUint32() uint32
- ToUint64() uint64
- ToFloat32() float32
- ToFloat64() float64
- ToString() string
- ToVal(val interface{})
- Get(path ...interface{}) Any
- Size() int
- Keys() []string
- GetInterface() interface{}
- WriteTo(stream *Stream)
-}
-
-type baseAny struct{}
-
-func (any *baseAny) Get(path ...interface{}) Any {
- return &invalidAny{baseAny{}, fmt.Errorf("GetIndex %v from simple value", path)}
-}
-
-func (any *baseAny) Size() int {
- return 0
-}
-
-func (any *baseAny) Keys() []string {
- return []string{}
-}
-
-func (any *baseAny) ToVal(obj interface{}) {
- panic("not implemented")
-}
-
-// WrapInt32 turn int32 into Any interface
-func WrapInt32(val int32) Any {
- return &int32Any{baseAny{}, val}
-}
-
-// WrapInt64 turn int64 into Any interface
-func WrapInt64(val int64) Any {
- return &int64Any{baseAny{}, val}
-}
-
-// WrapUint32 turn uint32 into Any interface
-func WrapUint32(val uint32) Any {
- return &uint32Any{baseAny{}, val}
-}
-
-// WrapUint64 turn uint64 into Any interface
-func WrapUint64(val uint64) Any {
- return &uint64Any{baseAny{}, val}
-}
-
-// WrapFloat64 turn float64 into Any interface
-func WrapFloat64(val float64) Any {
- return &floatAny{baseAny{}, val}
-}
-
-// WrapString turn string into Any interface
-func WrapString(val string) Any {
- return &stringAny{baseAny{}, val}
-}
-
-// Wrap turn a go object into Any interface
-func Wrap(val interface{}) Any {
- if val == nil {
- return &nilAny{}
- }
- asAny, isAny := val.(Any)
- if isAny {
- return asAny
- }
- typ := reflect2.TypeOf(val)
- switch typ.Kind() {
- case reflect.Slice:
- return wrapArray(val)
- case reflect.Struct:
- return wrapStruct(val)
- case reflect.Map:
- return wrapMap(val)
- case reflect.String:
- return WrapString(val.(string))
- case reflect.Int:
- if strconv.IntSize == 32 {
- return WrapInt32(int32(val.(int)))
- }
- return WrapInt64(int64(val.(int)))
- case reflect.Int8:
- return WrapInt32(int32(val.(int8)))
- case reflect.Int16:
- return WrapInt32(int32(val.(int16)))
- case reflect.Int32:
- return WrapInt32(val.(int32))
- case reflect.Int64:
- return WrapInt64(val.(int64))
- case reflect.Uint:
- if strconv.IntSize == 32 {
- return WrapUint32(uint32(val.(uint)))
- }
- return WrapUint64(uint64(val.(uint)))
- case reflect.Uintptr:
- if ptrSize == 32 {
- return WrapUint32(uint32(val.(uintptr)))
- }
- return WrapUint64(uint64(val.(uintptr)))
- case reflect.Uint8:
- return WrapUint32(uint32(val.(uint8)))
- case reflect.Uint16:
- return WrapUint32(uint32(val.(uint16)))
- case reflect.Uint32:
- return WrapUint32(uint32(val.(uint32)))
- case reflect.Uint64:
- return WrapUint64(val.(uint64))
- case reflect.Float32:
- return WrapFloat64(float64(val.(float32)))
- case reflect.Float64:
- return WrapFloat64(val.(float64))
- case reflect.Bool:
- if val.(bool) == true {
- return &trueAny{}
- }
- return &falseAny{}
- }
- return &invalidAny{baseAny{}, fmt.Errorf("unsupported type: %v", typ)}
-}
-
-// ReadAny read next JSON element as an Any object. It is a better json.RawMessage.
-func (iter *Iterator) ReadAny() Any {
- return iter.readAny()
-}
-
-func (iter *Iterator) readAny() Any {
- c := iter.nextToken()
- switch c {
- case '"':
- iter.unreadByte()
- return &stringAny{baseAny{}, iter.ReadString()}
- case 'n':
- iter.skipThreeBytes('u', 'l', 'l') // null
- return &nilAny{}
- case 't':
- iter.skipThreeBytes('r', 'u', 'e') // true
- return &trueAny{}
- case 'f':
- iter.skipFourBytes('a', 'l', 's', 'e') // false
- return &falseAny{}
- case '{':
- return iter.readObjectAny()
- case '[':
- return iter.readArrayAny()
- case '-':
- return iter.readNumberAny(false)
- case 0:
- return &invalidAny{baseAny{}, errors.New("input is empty")}
- default:
- return iter.readNumberAny(true)
- }
-}
-
-func (iter *Iterator) readNumberAny(positive bool) Any {
- iter.startCapture(iter.head - 1)
- iter.skipNumber()
- lazyBuf := iter.stopCapture()
- return &numberLazyAny{baseAny{}, iter.cfg, lazyBuf, nil}
-}
-
-func (iter *Iterator) readObjectAny() Any {
- iter.startCapture(iter.head - 1)
- iter.skipObject()
- lazyBuf := iter.stopCapture()
- return &objectLazyAny{baseAny{}, iter.cfg, lazyBuf, nil}
-}
-
-func (iter *Iterator) readArrayAny() Any {
- iter.startCapture(iter.head - 1)
- iter.skipArray()
- lazyBuf := iter.stopCapture()
- return &arrayLazyAny{baseAny{}, iter.cfg, lazyBuf, nil}
-}
-
-func locateObjectField(iter *Iterator, target string) []byte {
- var found []byte
- iter.ReadObjectCB(func(iter *Iterator, field string) bool {
- if field == target {
- found = iter.SkipAndReturnBytes()
- return false
- }
- iter.Skip()
- return true
- })
- return found
-}
-
-func locateArrayElement(iter *Iterator, target int) []byte {
- var found []byte
- n := 0
- iter.ReadArrayCB(func(iter *Iterator) bool {
- if n == target {
- found = iter.SkipAndReturnBytes()
- return false
- }
- iter.Skip()
- n++
- return true
- })
- return found
-}
-
-func locatePath(iter *Iterator, path []interface{}) Any {
- for i, pathKeyObj := range path {
- switch pathKey := pathKeyObj.(type) {
- case string:
- valueBytes := locateObjectField(iter, pathKey)
- if valueBytes == nil {
- return newInvalidAny(path[i:])
- }
- iter.ResetBytes(valueBytes)
- case int:
- valueBytes := locateArrayElement(iter, pathKey)
- if valueBytes == nil {
- return newInvalidAny(path[i:])
- }
- iter.ResetBytes(valueBytes)
- case int32:
- if '*' == pathKey {
- return iter.readAny().Get(path[i:]...)
- }
- return newInvalidAny(path[i:])
- default:
- return newInvalidAny(path[i:])
- }
- }
- if iter.Error != nil && iter.Error != io.EOF {
- return &invalidAny{baseAny{}, iter.Error}
- }
- return iter.readAny()
-}
-
-var anyType = reflect2.TypeOfPtr((*Any)(nil)).Elem()
-
-func createDecoderOfAny(ctx *ctx, typ reflect2.Type) ValDecoder {
- if typ == anyType {
- return &directAnyCodec{}
- }
- if typ.Implements(anyType) {
- return &anyCodec{
- valType: typ,
- }
- }
- return nil
-}
-
-func createEncoderOfAny(ctx *ctx, typ reflect2.Type) ValEncoder {
- if typ == anyType {
- return &directAnyCodec{}
- }
- if typ.Implements(anyType) {
- return &anyCodec{
- valType: typ,
- }
- }
- return nil
-}
-
-type anyCodec struct {
- valType reflect2.Type
-}
-
-func (codec *anyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- panic("not implemented")
-}
-
-func (codec *anyCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- obj := codec.valType.UnsafeIndirect(ptr)
- any := obj.(Any)
- any.WriteTo(stream)
-}
-
-func (codec *anyCodec) IsEmpty(ptr unsafe.Pointer) bool {
- obj := codec.valType.UnsafeIndirect(ptr)
- any := obj.(Any)
- return any.Size() == 0
-}
-
-type directAnyCodec struct {
-}
-
-func (codec *directAnyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- *(*Any)(ptr) = iter.readAny()
-}
-
-func (codec *directAnyCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- any := *(*Any)(ptr)
- if any == nil {
- stream.WriteNil()
- return
- }
- any.WriteTo(stream)
-}
-
-func (codec *directAnyCodec) IsEmpty(ptr unsafe.Pointer) bool {
- any := *(*Any)(ptr)
- return any.Size() == 0
-}
diff --git a/vendor/github.com/json-iterator/go/any_array.go b/vendor/github.com/json-iterator/go/any_array.go
deleted file mode 100644
index 0449e9aa..00000000
--- a/vendor/github.com/json-iterator/go/any_array.go
+++ /dev/null
@@ -1,278 +0,0 @@
-package jsoniter
-
-import (
- "reflect"
- "unsafe"
-)
-
-type arrayLazyAny struct {
- baseAny
- cfg *frozenConfig
- buf []byte
- err error
-}
-
-func (any *arrayLazyAny) ValueType() ValueType {
- return ArrayValue
-}
-
-func (any *arrayLazyAny) MustBeValid() Any {
- return any
-}
-
-func (any *arrayLazyAny) LastError() error {
- return any.err
-}
-
-func (any *arrayLazyAny) ToBool() bool {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- return iter.ReadArray()
-}
-
-func (any *arrayLazyAny) ToInt() int {
- if any.ToBool() {
- return 1
- }
- return 0
-}
-
-func (any *arrayLazyAny) ToInt32() int32 {
- if any.ToBool() {
- return 1
- }
- return 0
-}
-
-func (any *arrayLazyAny) ToInt64() int64 {
- if any.ToBool() {
- return 1
- }
- return 0
-}
-
-func (any *arrayLazyAny) ToUint() uint {
- if any.ToBool() {
- return 1
- }
- return 0
-}
-
-func (any *arrayLazyAny) ToUint32() uint32 {
- if any.ToBool() {
- return 1
- }
- return 0
-}
-
-func (any *arrayLazyAny) ToUint64() uint64 {
- if any.ToBool() {
- return 1
- }
- return 0
-}
-
-func (any *arrayLazyAny) ToFloat32() float32 {
- if any.ToBool() {
- return 1
- }
- return 0
-}
-
-func (any *arrayLazyAny) ToFloat64() float64 {
- if any.ToBool() {
- return 1
- }
- return 0
-}
-
-func (any *arrayLazyAny) ToString() string {
- return *(*string)(unsafe.Pointer(&any.buf))
-}
-
-func (any *arrayLazyAny) ToVal(val interface{}) {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- iter.ReadVal(val)
-}
-
-func (any *arrayLazyAny) Get(path ...interface{}) Any {
- if len(path) == 0 {
- return any
- }
- switch firstPath := path[0].(type) {
- case int:
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- valueBytes := locateArrayElement(iter, firstPath)
- if valueBytes == nil {
- return newInvalidAny(path)
- }
- iter.ResetBytes(valueBytes)
- return locatePath(iter, path[1:])
- case int32:
- if '*' == firstPath {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- arr := make([]Any, 0)
- iter.ReadArrayCB(func(iter *Iterator) bool {
- found := iter.readAny().Get(path[1:]...)
- if found.ValueType() != InvalidValue {
- arr = append(arr, found)
- }
- return true
- })
- return wrapArray(arr)
- }
- return newInvalidAny(path)
- default:
- return newInvalidAny(path)
- }
-}
-
-func (any *arrayLazyAny) Size() int {
- size := 0
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- iter.ReadArrayCB(func(iter *Iterator) bool {
- size++
- iter.Skip()
- return true
- })
- return size
-}
-
-func (any *arrayLazyAny) WriteTo(stream *Stream) {
- stream.Write(any.buf)
-}
-
-func (any *arrayLazyAny) GetInterface() interface{} {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- return iter.Read()
-}
-
-type arrayAny struct {
- baseAny
- val reflect.Value
-}
-
-func wrapArray(val interface{}) *arrayAny {
- return &arrayAny{baseAny{}, reflect.ValueOf(val)}
-}
-
-func (any *arrayAny) ValueType() ValueType {
- return ArrayValue
-}
-
-func (any *arrayAny) MustBeValid() Any {
- return any
-}
-
-func (any *arrayAny) LastError() error {
- return nil
-}
-
-func (any *arrayAny) ToBool() bool {
- return any.val.Len() != 0
-}
-
-func (any *arrayAny) ToInt() int {
- if any.val.Len() == 0 {
- return 0
- }
- return 1
-}
-
-func (any *arrayAny) ToInt32() int32 {
- if any.val.Len() == 0 {
- return 0
- }
- return 1
-}
-
-func (any *arrayAny) ToInt64() int64 {
- if any.val.Len() == 0 {
- return 0
- }
- return 1
-}
-
-func (any *arrayAny) ToUint() uint {
- if any.val.Len() == 0 {
- return 0
- }
- return 1
-}
-
-func (any *arrayAny) ToUint32() uint32 {
- if any.val.Len() == 0 {
- return 0
- }
- return 1
-}
-
-func (any *arrayAny) ToUint64() uint64 {
- if any.val.Len() == 0 {
- return 0
- }
- return 1
-}
-
-func (any *arrayAny) ToFloat32() float32 {
- if any.val.Len() == 0 {
- return 0
- }
- return 1
-}
-
-func (any *arrayAny) ToFloat64() float64 {
- if any.val.Len() == 0 {
- return 0
- }
- return 1
-}
-
-func (any *arrayAny) ToString() string {
- str, _ := MarshalToString(any.val.Interface())
- return str
-}
-
-func (any *arrayAny) Get(path ...interface{}) Any {
- if len(path) == 0 {
- return any
- }
- switch firstPath := path[0].(type) {
- case int:
- if firstPath < 0 || firstPath >= any.val.Len() {
- return newInvalidAny(path)
- }
- return Wrap(any.val.Index(firstPath).Interface())
- case int32:
- if '*' == firstPath {
- mappedAll := make([]Any, 0)
- for i := 0; i < any.val.Len(); i++ {
- mapped := Wrap(any.val.Index(i).Interface()).Get(path[1:]...)
- if mapped.ValueType() != InvalidValue {
- mappedAll = append(mappedAll, mapped)
- }
- }
- return wrapArray(mappedAll)
- }
- return newInvalidAny(path)
- default:
- return newInvalidAny(path)
- }
-}
-
-func (any *arrayAny) Size() int {
- return any.val.Len()
-}
-
-func (any *arrayAny) WriteTo(stream *Stream) {
- stream.WriteVal(any.val)
-}
-
-func (any *arrayAny) GetInterface() interface{} {
- return any.val.Interface()
-}
diff --git a/vendor/github.com/json-iterator/go/any_bool.go b/vendor/github.com/json-iterator/go/any_bool.go
deleted file mode 100644
index 9452324a..00000000
--- a/vendor/github.com/json-iterator/go/any_bool.go
+++ /dev/null
@@ -1,137 +0,0 @@
-package jsoniter
-
-type trueAny struct {
- baseAny
-}
-
-func (any *trueAny) LastError() error {
- return nil
-}
-
-func (any *trueAny) ToBool() bool {
- return true
-}
-
-func (any *trueAny) ToInt() int {
- return 1
-}
-
-func (any *trueAny) ToInt32() int32 {
- return 1
-}
-
-func (any *trueAny) ToInt64() int64 {
- return 1
-}
-
-func (any *trueAny) ToUint() uint {
- return 1
-}
-
-func (any *trueAny) ToUint32() uint32 {
- return 1
-}
-
-func (any *trueAny) ToUint64() uint64 {
- return 1
-}
-
-func (any *trueAny) ToFloat32() float32 {
- return 1
-}
-
-func (any *trueAny) ToFloat64() float64 {
- return 1
-}
-
-func (any *trueAny) ToString() string {
- return "true"
-}
-
-func (any *trueAny) WriteTo(stream *Stream) {
- stream.WriteTrue()
-}
-
-func (any *trueAny) Parse() *Iterator {
- return nil
-}
-
-func (any *trueAny) GetInterface() interface{} {
- return true
-}
-
-func (any *trueAny) ValueType() ValueType {
- return BoolValue
-}
-
-func (any *trueAny) MustBeValid() Any {
- return any
-}
-
-type falseAny struct {
- baseAny
-}
-
-func (any *falseAny) LastError() error {
- return nil
-}
-
-func (any *falseAny) ToBool() bool {
- return false
-}
-
-func (any *falseAny) ToInt() int {
- return 0
-}
-
-func (any *falseAny) ToInt32() int32 {
- return 0
-}
-
-func (any *falseAny) ToInt64() int64 {
- return 0
-}
-
-func (any *falseAny) ToUint() uint {
- return 0
-}
-
-func (any *falseAny) ToUint32() uint32 {
- return 0
-}
-
-func (any *falseAny) ToUint64() uint64 {
- return 0
-}
-
-func (any *falseAny) ToFloat32() float32 {
- return 0
-}
-
-func (any *falseAny) ToFloat64() float64 {
- return 0
-}
-
-func (any *falseAny) ToString() string {
- return "false"
-}
-
-func (any *falseAny) WriteTo(stream *Stream) {
- stream.WriteFalse()
-}
-
-func (any *falseAny) Parse() *Iterator {
- return nil
-}
-
-func (any *falseAny) GetInterface() interface{} {
- return false
-}
-
-func (any *falseAny) ValueType() ValueType {
- return BoolValue
-}
-
-func (any *falseAny) MustBeValid() Any {
- return any
-}
diff --git a/vendor/github.com/json-iterator/go/any_float.go b/vendor/github.com/json-iterator/go/any_float.go
deleted file mode 100644
index 35fdb094..00000000
--- a/vendor/github.com/json-iterator/go/any_float.go
+++ /dev/null
@@ -1,83 +0,0 @@
-package jsoniter
-
-import (
- "strconv"
-)
-
-type floatAny struct {
- baseAny
- val float64
-}
-
-func (any *floatAny) Parse() *Iterator {
- return nil
-}
-
-func (any *floatAny) ValueType() ValueType {
- return NumberValue
-}
-
-func (any *floatAny) MustBeValid() Any {
- return any
-}
-
-func (any *floatAny) LastError() error {
- return nil
-}
-
-func (any *floatAny) ToBool() bool {
- return any.ToFloat64() != 0
-}
-
-func (any *floatAny) ToInt() int {
- return int(any.val)
-}
-
-func (any *floatAny) ToInt32() int32 {
- return int32(any.val)
-}
-
-func (any *floatAny) ToInt64() int64 {
- return int64(any.val)
-}
-
-func (any *floatAny) ToUint() uint {
- if any.val > 0 {
- return uint(any.val)
- }
- return 0
-}
-
-func (any *floatAny) ToUint32() uint32 {
- if any.val > 0 {
- return uint32(any.val)
- }
- return 0
-}
-
-func (any *floatAny) ToUint64() uint64 {
- if any.val > 0 {
- return uint64(any.val)
- }
- return 0
-}
-
-func (any *floatAny) ToFloat32() float32 {
- return float32(any.val)
-}
-
-func (any *floatAny) ToFloat64() float64 {
- return any.val
-}
-
-func (any *floatAny) ToString() string {
- return strconv.FormatFloat(any.val, 'E', -1, 64)
-}
-
-func (any *floatAny) WriteTo(stream *Stream) {
- stream.WriteFloat64(any.val)
-}
-
-func (any *floatAny) GetInterface() interface{} {
- return any.val
-}
diff --git a/vendor/github.com/json-iterator/go/any_int32.go b/vendor/github.com/json-iterator/go/any_int32.go
deleted file mode 100644
index 1b56f399..00000000
--- a/vendor/github.com/json-iterator/go/any_int32.go
+++ /dev/null
@@ -1,74 +0,0 @@
-package jsoniter
-
-import (
- "strconv"
-)
-
-type int32Any struct {
- baseAny
- val int32
-}
-
-func (any *int32Any) LastError() error {
- return nil
-}
-
-func (any *int32Any) ValueType() ValueType {
- return NumberValue
-}
-
-func (any *int32Any) MustBeValid() Any {
- return any
-}
-
-func (any *int32Any) ToBool() bool {
- return any.val != 0
-}
-
-func (any *int32Any) ToInt() int {
- return int(any.val)
-}
-
-func (any *int32Any) ToInt32() int32 {
- return any.val
-}
-
-func (any *int32Any) ToInt64() int64 {
- return int64(any.val)
-}
-
-func (any *int32Any) ToUint() uint {
- return uint(any.val)
-}
-
-func (any *int32Any) ToUint32() uint32 {
- return uint32(any.val)
-}
-
-func (any *int32Any) ToUint64() uint64 {
- return uint64(any.val)
-}
-
-func (any *int32Any) ToFloat32() float32 {
- return float32(any.val)
-}
-
-func (any *int32Any) ToFloat64() float64 {
- return float64(any.val)
-}
-
-func (any *int32Any) ToString() string {
- return strconv.FormatInt(int64(any.val), 10)
-}
-
-func (any *int32Any) WriteTo(stream *Stream) {
- stream.WriteInt32(any.val)
-}
-
-func (any *int32Any) Parse() *Iterator {
- return nil
-}
-
-func (any *int32Any) GetInterface() interface{} {
- return any.val
-}
diff --git a/vendor/github.com/json-iterator/go/any_int64.go b/vendor/github.com/json-iterator/go/any_int64.go
deleted file mode 100644
index c440d72b..00000000
--- a/vendor/github.com/json-iterator/go/any_int64.go
+++ /dev/null
@@ -1,74 +0,0 @@
-package jsoniter
-
-import (
- "strconv"
-)
-
-type int64Any struct {
- baseAny
- val int64
-}
-
-func (any *int64Any) LastError() error {
- return nil
-}
-
-func (any *int64Any) ValueType() ValueType {
- return NumberValue
-}
-
-func (any *int64Any) MustBeValid() Any {
- return any
-}
-
-func (any *int64Any) ToBool() bool {
- return any.val != 0
-}
-
-func (any *int64Any) ToInt() int {
- return int(any.val)
-}
-
-func (any *int64Any) ToInt32() int32 {
- return int32(any.val)
-}
-
-func (any *int64Any) ToInt64() int64 {
- return any.val
-}
-
-func (any *int64Any) ToUint() uint {
- return uint(any.val)
-}
-
-func (any *int64Any) ToUint32() uint32 {
- return uint32(any.val)
-}
-
-func (any *int64Any) ToUint64() uint64 {
- return uint64(any.val)
-}
-
-func (any *int64Any) ToFloat32() float32 {
- return float32(any.val)
-}
-
-func (any *int64Any) ToFloat64() float64 {
- return float64(any.val)
-}
-
-func (any *int64Any) ToString() string {
- return strconv.FormatInt(any.val, 10)
-}
-
-func (any *int64Any) WriteTo(stream *Stream) {
- stream.WriteInt64(any.val)
-}
-
-func (any *int64Any) Parse() *Iterator {
- return nil
-}
-
-func (any *int64Any) GetInterface() interface{} {
- return any.val
-}
diff --git a/vendor/github.com/json-iterator/go/any_invalid.go b/vendor/github.com/json-iterator/go/any_invalid.go
deleted file mode 100644
index 1d859eac..00000000
--- a/vendor/github.com/json-iterator/go/any_invalid.go
+++ /dev/null
@@ -1,82 +0,0 @@
-package jsoniter
-
-import "fmt"
-
-type invalidAny struct {
- baseAny
- err error
-}
-
-func newInvalidAny(path []interface{}) *invalidAny {
- return &invalidAny{baseAny{}, fmt.Errorf("%v not found", path)}
-}
-
-func (any *invalidAny) LastError() error {
- return any.err
-}
-
-func (any *invalidAny) ValueType() ValueType {
- return InvalidValue
-}
-
-func (any *invalidAny) MustBeValid() Any {
- panic(any.err)
-}
-
-func (any *invalidAny) ToBool() bool {
- return false
-}
-
-func (any *invalidAny) ToInt() int {
- return 0
-}
-
-func (any *invalidAny) ToInt32() int32 {
- return 0
-}
-
-func (any *invalidAny) ToInt64() int64 {
- return 0
-}
-
-func (any *invalidAny) ToUint() uint {
- return 0
-}
-
-func (any *invalidAny) ToUint32() uint32 {
- return 0
-}
-
-func (any *invalidAny) ToUint64() uint64 {
- return 0
-}
-
-func (any *invalidAny) ToFloat32() float32 {
- return 0
-}
-
-func (any *invalidAny) ToFloat64() float64 {
- return 0
-}
-
-func (any *invalidAny) ToString() string {
- return ""
-}
-
-func (any *invalidAny) WriteTo(stream *Stream) {
-}
-
-func (any *invalidAny) Get(path ...interface{}) Any {
- if any.err == nil {
- return &invalidAny{baseAny{}, fmt.Errorf("get %v from invalid", path)}
- }
- return &invalidAny{baseAny{}, fmt.Errorf("%v, get %v from invalid", any.err, path)}
-}
-
-func (any *invalidAny) Parse() *Iterator {
- return nil
-}
-
-func (any *invalidAny) GetInterface() interface{} {
- return nil
-}
diff --git a/vendor/github.com/json-iterator/go/any_nil.go b/vendor/github.com/json-iterator/go/any_nil.go
deleted file mode 100644
index d04cb54c..00000000
--- a/vendor/github.com/json-iterator/go/any_nil.go
+++ /dev/null
@@ -1,69 +0,0 @@
-package jsoniter
-
-type nilAny struct {
- baseAny
-}
-
-func (any *nilAny) LastError() error {
- return nil
-}
-
-func (any *nilAny) ValueType() ValueType {
- return NilValue
-}
-
-func (any *nilAny) MustBeValid() Any {
- return any
-}
-
-func (any *nilAny) ToBool() bool {
- return false
-}
-
-func (any *nilAny) ToInt() int {
- return 0
-}
-
-func (any *nilAny) ToInt32() int32 {
- return 0
-}
-
-func (any *nilAny) ToInt64() int64 {
- return 0
-}
-
-func (any *nilAny) ToUint() uint {
- return 0
-}
-
-func (any *nilAny) ToUint32() uint32 {
- return 0
-}
-
-func (any *nilAny) ToUint64() uint64 {
- return 0
-}
-
-func (any *nilAny) ToFloat32() float32 {
- return 0
-}
-
-func (any *nilAny) ToFloat64() float64 {
- return 0
-}
-
-func (any *nilAny) ToString() string {
- return ""
-}
-
-func (any *nilAny) WriteTo(stream *Stream) {
- stream.WriteNil()
-}
-
-func (any *nilAny) Parse() *Iterator {
- return nil
-}
-
-func (any *nilAny) GetInterface() interface{} {
- return nil
-}
diff --git a/vendor/github.com/json-iterator/go/any_number.go b/vendor/github.com/json-iterator/go/any_number.go
deleted file mode 100644
index 9d1e901a..00000000
--- a/vendor/github.com/json-iterator/go/any_number.go
+++ /dev/null
@@ -1,123 +0,0 @@
-package jsoniter
-
-import (
- "io"
- "unsafe"
-)
-
-type numberLazyAny struct {
- baseAny
- cfg *frozenConfig
- buf []byte
- err error
-}
-
-func (any *numberLazyAny) ValueType() ValueType {
- return NumberValue
-}
-
-func (any *numberLazyAny) MustBeValid() Any {
- return any
-}
-
-func (any *numberLazyAny) LastError() error {
- return any.err
-}
-
-func (any *numberLazyAny) ToBool() bool {
- return any.ToFloat64() != 0
-}
-
-func (any *numberLazyAny) ToInt() int {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- val := iter.ReadInt()
- if iter.Error != nil && iter.Error != io.EOF {
- any.err = iter.Error
- }
- return val
-}
-
-func (any *numberLazyAny) ToInt32() int32 {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- val := iter.ReadInt32()
- if iter.Error != nil && iter.Error != io.EOF {
- any.err = iter.Error
- }
- return val
-}
-
-func (any *numberLazyAny) ToInt64() int64 {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- val := iter.ReadInt64()
- if iter.Error != nil && iter.Error != io.EOF {
- any.err = iter.Error
- }
- return val
-}
-
-func (any *numberLazyAny) ToUint() uint {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- val := iter.ReadUint()
- if iter.Error != nil && iter.Error != io.EOF {
- any.err = iter.Error
- }
- return val
-}
-
-func (any *numberLazyAny) ToUint32() uint32 {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- val := iter.ReadUint32()
- if iter.Error != nil && iter.Error != io.EOF {
- any.err = iter.Error
- }
- return val
-}
-
-func (any *numberLazyAny) ToUint64() uint64 {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- val := iter.ReadUint64()
- if iter.Error != nil && iter.Error != io.EOF {
- any.err = iter.Error
- }
- return val
-}
-
-func (any *numberLazyAny) ToFloat32() float32 {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- val := iter.ReadFloat32()
- if iter.Error != nil && iter.Error != io.EOF {
- any.err = iter.Error
- }
- return val
-}
-
-func (any *numberLazyAny) ToFloat64() float64 {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- val := iter.ReadFloat64()
- if iter.Error != nil && iter.Error != io.EOF {
- any.err = iter.Error
- }
- return val
-}
-
-func (any *numberLazyAny) ToString() string {
- return *(*string)(unsafe.Pointer(&any.buf))
-}
-
-func (any *numberLazyAny) WriteTo(stream *Stream) {
- stream.Write(any.buf)
-}
-
-func (any *numberLazyAny) GetInterface() interface{} {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- return iter.Read()
-}
diff --git a/vendor/github.com/json-iterator/go/any_object.go b/vendor/github.com/json-iterator/go/any_object.go
deleted file mode 100644
index c44ef5c9..00000000
--- a/vendor/github.com/json-iterator/go/any_object.go
+++ /dev/null
@@ -1,374 +0,0 @@
-package jsoniter
-
-import (
- "reflect"
- "unsafe"
-)
-
-type objectLazyAny struct {
- baseAny
- cfg *frozenConfig
- buf []byte
- err error
-}
-
-func (any *objectLazyAny) ValueType() ValueType {
- return ObjectValue
-}
-
-func (any *objectLazyAny) MustBeValid() Any {
- return any
-}
-
-func (any *objectLazyAny) LastError() error {
- return any.err
-}
-
-func (any *objectLazyAny) ToBool() bool {
- return true
-}
-
-func (any *objectLazyAny) ToInt() int {
- return 0
-}
-
-func (any *objectLazyAny) ToInt32() int32 {
- return 0
-}
-
-func (any *objectLazyAny) ToInt64() int64 {
- return 0
-}
-
-func (any *objectLazyAny) ToUint() uint {
- return 0
-}
-
-func (any *objectLazyAny) ToUint32() uint32 {
- return 0
-}
-
-func (any *objectLazyAny) ToUint64() uint64 {
- return 0
-}
-
-func (any *objectLazyAny) ToFloat32() float32 {
- return 0
-}
-
-func (any *objectLazyAny) ToFloat64() float64 {
- return 0
-}
-
-func (any *objectLazyAny) ToString() string {
- return *(*string)(unsafe.Pointer(&any.buf))
-}
-
-func (any *objectLazyAny) ToVal(obj interface{}) {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- iter.ReadVal(obj)
-}
-
-func (any *objectLazyAny) Get(path ...interface{}) Any {
- if len(path) == 0 {
- return any
- }
- switch firstPath := path[0].(type) {
- case string:
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- valueBytes := locateObjectField(iter, firstPath)
- if valueBytes == nil {
- return newInvalidAny(path)
- }
- iter.ResetBytes(valueBytes)
- return locatePath(iter, path[1:])
- case int32:
- if '*' == firstPath {
- mappedAll := map[string]Any{}
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- iter.ReadMapCB(func(iter *Iterator, field string) bool {
- mapped := locatePath(iter, path[1:])
- if mapped.ValueType() != InvalidValue {
- mappedAll[field] = mapped
- }
- return true
- })
- return wrapMap(mappedAll)
- }
- return newInvalidAny(path)
- default:
- return newInvalidAny(path)
- }
-}
-
-func (any *objectLazyAny) Keys() []string {
- keys := []string{}
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- iter.ReadMapCB(func(iter *Iterator, field string) bool {
- iter.Skip()
- keys = append(keys, field)
- return true
- })
- return keys
-}
-
-func (any *objectLazyAny) Size() int {
- size := 0
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- iter.ReadObjectCB(func(iter *Iterator, field string) bool {
- iter.Skip()
- size++
- return true
- })
- return size
-}
-
-func (any *objectLazyAny) WriteTo(stream *Stream) {
- stream.Write(any.buf)
-}
-
-func (any *objectLazyAny) GetInterface() interface{} {
- iter := any.cfg.BorrowIterator(any.buf)
- defer any.cfg.ReturnIterator(iter)
- return iter.Read()
-}
-
-type objectAny struct {
- baseAny
- err error
- val reflect.Value
-}
-
-func wrapStruct(val interface{}) *objectAny {
- return &objectAny{baseAny{}, nil, reflect.ValueOf(val)}
-}
-
-func (any *objectAny) ValueType() ValueType {
- return ObjectValue
-}
-
-func (any *objectAny) MustBeValid() Any {
- return any
-}
-
-func (any *objectAny) Parse() *Iterator {
- return nil
-}
-
-func (any *objectAny) LastError() error {
- return any.err
-}
-
-func (any *objectAny) ToBool() bool {
- return any.val.NumField() != 0
-}
-
-func (any *objectAny) ToInt() int {
- return 0
-}
-
-func (any *objectAny) ToInt32() int32 {
- return 0
-}
-
-func (any *objectAny) ToInt64() int64 {
- return 0
-}
-
-func (any *objectAny) ToUint() uint {
- return 0
-}
-
-func (any *objectAny) ToUint32() uint32 {
- return 0
-}
-
-func (any *objectAny) ToUint64() uint64 {
- return 0
-}
-
-func (any *objectAny) ToFloat32() float32 {
- return 0
-}
-
-func (any *objectAny) ToFloat64() float64 {
- return 0
-}
-
-func (any *objectAny) ToString() string {
- str, err := MarshalToString(any.val.Interface())
- any.err = err
- return str
-}
-
-func (any *objectAny) Get(path ...interface{}) Any {
- if len(path) == 0 {
- return any
- }
- switch firstPath := path[0].(type) {
- case string:
- field := any.val.FieldByName(firstPath)
- if !field.IsValid() {
- return newInvalidAny(path)
- }
- return Wrap(field.Interface())
- case int32:
- if '*' == firstPath {
- mappedAll := map[string]Any{}
- for i := 0; i < any.val.NumField(); i++ {
- field := any.val.Field(i)
- if field.CanInterface() {
- mapped := Wrap(field.Interface()).Get(path[1:]...)
- if mapped.ValueType() != InvalidValue {
- mappedAll[any.val.Type().Field(i).Name] = mapped
- }
- }
- }
- return wrapMap(mappedAll)
- }
- return newInvalidAny(path)
- default:
- return newInvalidAny(path)
- }
-}
-
-func (any *objectAny) Keys() []string {
- keys := make([]string, 0, any.val.NumField())
- for i := 0; i < any.val.NumField(); i++ {
- keys = append(keys, any.val.Type().Field(i).Name)
- }
- return keys
-}
-
-func (any *objectAny) Size() int {
- return any.val.NumField()
-}
-
-func (any *objectAny) WriteTo(stream *Stream) {
- stream.WriteVal(any.val)
-}
-
-func (any *objectAny) GetInterface() interface{} {
- return any.val.Interface()
-}
-
-type mapAny struct {
- baseAny
- err error
- val reflect.Value
-}
-
-func wrapMap(val interface{}) *mapAny {
- return &mapAny{baseAny{}, nil, reflect.ValueOf(val)}
-}
-
-func (any *mapAny) ValueType() ValueType {
- return ObjectValue
-}
-
-func (any *mapAny) MustBeValid() Any {
- return any
-}
-
-func (any *mapAny) Parse() *Iterator {
- return nil
-}
-
-func (any *mapAny) LastError() error {
- return any.err
-}
-
-func (any *mapAny) ToBool() bool {
- return true
-}
-
-func (any *mapAny) ToInt() int {
- return 0
-}
-
-func (any *mapAny) ToInt32() int32 {
- return 0
-}
-
-func (any *mapAny) ToInt64() int64 {
- return 0
-}
-
-func (any *mapAny) ToUint() uint {
- return 0
-}
-
-func (any *mapAny) ToUint32() uint32 {
- return 0
-}
-
-func (any *mapAny) ToUint64() uint64 {
- return 0
-}
-
-func (any *mapAny) ToFloat32() float32 {
- return 0
-}
-
-func (any *mapAny) ToFloat64() float64 {
- return 0
-}
-
-func (any *mapAny) ToString() string {
- str, err := MarshalToString(any.val.Interface())
- any.err = err
- return str
-}
-
-func (any *mapAny) Get(path ...interface{}) Any {
- if len(path) == 0 {
- return any
- }
- switch firstPath := path[0].(type) {
- case int32:
- if '*' == firstPath {
- mappedAll := map[string]Any{}
- for _, key := range any.val.MapKeys() {
- keyAsStr := key.String()
- element := Wrap(any.val.MapIndex(key).Interface())
- mapped := element.Get(path[1:]...)
- if mapped.ValueType() != InvalidValue {
- mappedAll[keyAsStr] = mapped
- }
- }
- return wrapMap(mappedAll)
- }
- return newInvalidAny(path)
- default:
- value := any.val.MapIndex(reflect.ValueOf(firstPath))
- if !value.IsValid() {
- return newInvalidAny(path)
- }
- return Wrap(value.Interface())
- }
-}
-
-func (any *mapAny) Keys() []string {
- keys := make([]string, 0, any.val.Len())
- for _, key := range any.val.MapKeys() {
- keys = append(keys, key.String())
- }
- return keys
-}
-
-func (any *mapAny) Size() int {
- return any.val.Len()
-}
-
-func (any *mapAny) WriteTo(stream *Stream) {
- stream.WriteVal(any.val)
-}
-
-func (any *mapAny) GetInterface() interface{} {
- return any.val.Interface()
-}
diff --git a/vendor/github.com/json-iterator/go/any_str.go b/vendor/github.com/json-iterator/go/any_str.go
deleted file mode 100644
index 1f12f661..00000000
--- a/vendor/github.com/json-iterator/go/any_str.go
+++ /dev/null
@@ -1,166 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "strconv"
-)
-
-type stringAny struct {
- baseAny
- val string
-}
-
-func (any *stringAny) Get(path ...interface{}) Any {
- if len(path) == 0 {
- return any
- }
- return &invalidAny{baseAny{}, fmt.Errorf("GetIndex %v from simple value", path)}
-}
-
-func (any *stringAny) Parse() *Iterator {
- return nil
-}
-
-func (any *stringAny) ValueType() ValueType {
- return StringValue
-}
-
-func (any *stringAny) MustBeValid() Any {
- return any
-}
-
-func (any *stringAny) LastError() error {
- return nil
-}
-
-func (any *stringAny) ToBool() bool {
- str := any.ToString()
- if str == "0" {
- return false
- }
- for _, c := range str {
- switch c {
- case ' ', '\n', '\r', '\t':
- default:
- return true
- }
- }
- return false
-}
-
-func (any *stringAny) ToInt() int {
- return int(any.ToInt64())
-
-}
-
-func (any *stringAny) ToInt32() int32 {
- return int32(any.ToInt64())
-}
-
-func (any *stringAny) ToInt64() int64 {
- if any.val == "" {
- return 0
- }
-
- flag := 1
- startPos := 0
- if any.val[0] == '+' || any.val[0] == '-' {
- startPos = 1
- }
-
- if any.val[0] == '-' {
- flag = -1
- }
-
- endPos := startPos
- for i := startPos; i < len(any.val); i++ {
- if any.val[i] >= '0' && any.val[i] <= '9' {
- endPos = i + 1
- } else {
- break
- }
- }
- parsed, _ := strconv.ParseInt(any.val[startPos:endPos], 10, 64)
- return int64(flag) * parsed
-}
-
-func (any *stringAny) ToUint() uint {
- return uint(any.ToUint64())
-}
-
-func (any *stringAny) ToUint32() uint32 {
- return uint32(any.ToUint64())
-}
-
-func (any *stringAny) ToUint64() uint64 {
- if any.val == "" {
- return 0
- }
-
- startPos := 0
-
- if any.val[0] == '-' {
- return 0
- }
- if any.val[0] == '+' {
- startPos = 1
- }
-
- endPos := startPos
- for i := startPos; i < len(any.val); i++ {
- if any.val[i] >= '0' && any.val[i] <= '9' {
- endPos = i + 1
- } else {
- break
- }
- }
- parsed, _ := strconv.ParseUint(any.val[startPos:endPos], 10, 64)
- return parsed
-}
-
-func (any *stringAny) ToFloat32() float32 {
- return float32(any.ToFloat64())
-}
-
-func (any *stringAny) ToFloat64() float64 {
- if len(any.val) == 0 {
- return 0
- }
-
- // first char invalid
- if any.val[0] != '+' && any.val[0] != '-' && (any.val[0] > '9' || any.val[0] < '0') {
- return 0
- }
-
- // extract valid num expression from string
- // eg 123true => 123, -12.12xxa => -12.12
- endPos := 1
- for i := 1; i < len(any.val); i++ {
- if any.val[i] == '.' || any.val[i] == 'e' || any.val[i] == 'E' || any.val[i] == '+' || any.val[i] == '-' {
- endPos = i + 1
- continue
- }
-
- // end position is the first char which is not digit
- if any.val[i] >= '0' && any.val[i] <= '9' {
- endPos = i + 1
- } else {
- endPos = i
- break
- }
- }
- parsed, _ := strconv.ParseFloat(any.val[:endPos], 64)
- return parsed
-}
-
-func (any *stringAny) ToString() string {
- return any.val
-}
-
-func (any *stringAny) WriteTo(stream *Stream) {
- stream.WriteString(any.val)
-}
-
-func (any *stringAny) GetInterface() interface{} {
- return any.val
-}
diff --git a/vendor/github.com/json-iterator/go/any_uint32.go b/vendor/github.com/json-iterator/go/any_uint32.go
deleted file mode 100644
index 656bbd33..00000000
--- a/vendor/github.com/json-iterator/go/any_uint32.go
+++ /dev/null
@@ -1,74 +0,0 @@
-package jsoniter
-
-import (
- "strconv"
-)
-
-type uint32Any struct {
- baseAny
- val uint32
-}
-
-func (any *uint32Any) LastError() error {
- return nil
-}
-
-func (any *uint32Any) ValueType() ValueType {
- return NumberValue
-}
-
-func (any *uint32Any) MustBeValid() Any {
- return any
-}
-
-func (any *uint32Any) ToBool() bool {
- return any.val != 0
-}
-
-func (any *uint32Any) ToInt() int {
- return int(any.val)
-}
-
-func (any *uint32Any) ToInt32() int32 {
- return int32(any.val)
-}
-
-func (any *uint32Any) ToInt64() int64 {
- return int64(any.val)
-}
-
-func (any *uint32Any) ToUint() uint {
- return uint(any.val)
-}
-
-func (any *uint32Any) ToUint32() uint32 {
- return any.val
-}
-
-func (any *uint32Any) ToUint64() uint64 {
- return uint64(any.val)
-}
-
-func (any *uint32Any) ToFloat32() float32 {
- return float32(any.val)
-}
-
-func (any *uint32Any) ToFloat64() float64 {
- return float64(any.val)
-}
-
-func (any *uint32Any) ToString() string {
- return strconv.FormatInt(int64(any.val), 10)
-}
-
-func (any *uint32Any) WriteTo(stream *Stream) {
- stream.WriteUint32(any.val)
-}
-
-func (any *uint32Any) Parse() *Iterator {
- return nil
-}
-
-func (any *uint32Any) GetInterface() interface{} {
- return any.val
-}
diff --git a/vendor/github.com/json-iterator/go/any_uint64.go b/vendor/github.com/json-iterator/go/any_uint64.go
deleted file mode 100644
index 7df2fce3..00000000
--- a/vendor/github.com/json-iterator/go/any_uint64.go
+++ /dev/null
@@ -1,74 +0,0 @@
-package jsoniter
-
-import (
- "strconv"
-)
-
-type uint64Any struct {
- baseAny
- val uint64
-}
-
-func (any *uint64Any) LastError() error {
- return nil
-}
-
-func (any *uint64Any) ValueType() ValueType {
- return NumberValue
-}
-
-func (any *uint64Any) MustBeValid() Any {
- return any
-}
-
-func (any *uint64Any) ToBool() bool {
- return any.val != 0
-}
-
-func (any *uint64Any) ToInt() int {
- return int(any.val)
-}
-
-func (any *uint64Any) ToInt32() int32 {
- return int32(any.val)
-}
-
-func (any *uint64Any) ToInt64() int64 {
- return int64(any.val)
-}
-
-func (any *uint64Any) ToUint() uint {
- return uint(any.val)
-}
-
-func (any *uint64Any) ToUint32() uint32 {
- return uint32(any.val)
-}
-
-func (any *uint64Any) ToUint64() uint64 {
- return any.val
-}
-
-func (any *uint64Any) ToFloat32() float32 {
- return float32(any.val)
-}
-
-func (any *uint64Any) ToFloat64() float64 {
- return float64(any.val)
-}
-
-func (any *uint64Any) ToString() string {
- return strconv.FormatUint(any.val, 10)
-}
-
-func (any *uint64Any) WriteTo(stream *Stream) {
- stream.WriteUint64(any.val)
-}
-
-func (any *uint64Any) Parse() *Iterator {
- return nil
-}
-
-func (any *uint64Any) GetInterface() interface{} {
- return any.val
-}
diff --git a/vendor/github.com/json-iterator/go/build.sh b/vendor/github.com/json-iterator/go/build.sh
deleted file mode 100644
index b45ef688..00000000
--- a/vendor/github.com/json-iterator/go/build.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-set -e
-set -x
-
-if [ ! -d /tmp/build-golang/src/github.com/json-iterator ]; then
- mkdir -p /tmp/build-golang/src/github.com/json-iterator
- ln -s $PWD /tmp/build-golang/src/github.com/json-iterator/go
-fi
-export GOPATH=/tmp/build-golang
-go get -u github.com/golang/dep/cmd/dep
-cd /tmp/build-golang/src/github.com/json-iterator/go
-exec $GOPATH/bin/dep ensure -update
diff --git a/vendor/github.com/json-iterator/go/config.go b/vendor/github.com/json-iterator/go/config.go
deleted file mode 100644
index 2adcdc3b..00000000
--- a/vendor/github.com/json-iterator/go/config.go
+++ /dev/null
@@ -1,375 +0,0 @@
-package jsoniter
-
-import (
- "encoding/json"
- "io"
- "reflect"
- "sync"
- "unsafe"
-
- "github.com/modern-go/concurrent"
- "github.com/modern-go/reflect2"
-)
-
-// Config customize how the API should behave.
-// The API is created from Config by Froze.
-type Config struct {
- IndentionStep int
- MarshalFloatWith6Digits bool
- EscapeHTML bool
- SortMapKeys bool
- UseNumber bool
- DisallowUnknownFields bool
- TagKey string
- OnlyTaggedField bool
- ValidateJsonRawMessage bool
- ObjectFieldMustBeSimpleString bool
- CaseSensitive bool
-}
-
-// API the public interface of this package.
-// Primary Marshal and Unmarshal.
-type API interface {
- IteratorPool
- StreamPool
- MarshalToString(v interface{}) (string, error)
- Marshal(v interface{}) ([]byte, error)
- MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)
- UnmarshalFromString(str string, v interface{}) error
- Unmarshal(data []byte, v interface{}) error
- Get(data []byte, path ...interface{}) Any
- NewEncoder(writer io.Writer) *Encoder
- NewDecoder(reader io.Reader) *Decoder
- Valid(data []byte) bool
- RegisterExtension(extension Extension)
- DecoderOf(typ reflect2.Type) ValDecoder
- EncoderOf(typ reflect2.Type) ValEncoder
-}
-
-// ConfigDefault the default API
-var ConfigDefault = Config{
- EscapeHTML: true,
-}.Froze()
-
-// ConfigCompatibleWithStandardLibrary tries to be 100% compatible with standard library behavior
-var ConfigCompatibleWithStandardLibrary = Config{
- EscapeHTML: true,
- SortMapKeys: true,
- ValidateJsonRawMessage: true,
-}.Froze()
-
-// ConfigFastest marshals float with only 6 digits precision
-var ConfigFastest = Config{
- EscapeHTML: false,
- MarshalFloatWith6Digits: true, // will lose precession
- ObjectFieldMustBeSimpleString: true, // do not unescape object field
-}.Froze()
-
-type frozenConfig struct {
- configBeforeFrozen Config
- sortMapKeys bool
- indentionStep int
- objectFieldMustBeSimpleString bool
- onlyTaggedField bool
- disallowUnknownFields bool
- decoderCache *concurrent.Map
- encoderCache *concurrent.Map
- encoderExtension Extension
- decoderExtension Extension
- extraExtensions []Extension
- streamPool *sync.Pool
- iteratorPool *sync.Pool
- caseSensitive bool
-}
-
-func (cfg *frozenConfig) initCache() {
- cfg.decoderCache = concurrent.NewMap()
- cfg.encoderCache = concurrent.NewMap()
-}
-
-func (cfg *frozenConfig) addDecoderToCache(cacheKey uintptr, decoder ValDecoder) {
- cfg.decoderCache.Store(cacheKey, decoder)
-}
-
-func (cfg *frozenConfig) addEncoderToCache(cacheKey uintptr, encoder ValEncoder) {
- cfg.encoderCache.Store(cacheKey, encoder)
-}
-
-func (cfg *frozenConfig) getDecoderFromCache(cacheKey uintptr) ValDecoder {
- decoder, found := cfg.decoderCache.Load(cacheKey)
- if found {
- return decoder.(ValDecoder)
- }
- return nil
-}
-
-func (cfg *frozenConfig) getEncoderFromCache(cacheKey uintptr) ValEncoder {
- encoder, found := cfg.encoderCache.Load(cacheKey)
- if found {
- return encoder.(ValEncoder)
- }
- return nil
-}
-
-var cfgCache = concurrent.NewMap()
-
-func getFrozenConfigFromCache(cfg Config) *frozenConfig {
- obj, found := cfgCache.Load(cfg)
- if found {
- return obj.(*frozenConfig)
- }
- return nil
-}
-
-func addFrozenConfigToCache(cfg Config, frozenConfig *frozenConfig) {
- cfgCache.Store(cfg, frozenConfig)
-}
-
-// Froze forge API from config
-func (cfg Config) Froze() API {
- api := &frozenConfig{
- sortMapKeys: cfg.SortMapKeys,
- indentionStep: cfg.IndentionStep,
- objectFieldMustBeSimpleString: cfg.ObjectFieldMustBeSimpleString,
- onlyTaggedField: cfg.OnlyTaggedField,
- disallowUnknownFields: cfg.DisallowUnknownFields,
- caseSensitive: cfg.CaseSensitive,
- }
- api.streamPool = &sync.Pool{
- New: func() interface{} {
- return NewStream(api, nil, 512)
- },
- }
- api.iteratorPool = &sync.Pool{
- New: func() interface{} {
- return NewIterator(api)
- },
- }
- api.initCache()
- encoderExtension := EncoderExtension{}
- decoderExtension := DecoderExtension{}
- if cfg.MarshalFloatWith6Digits {
- api.marshalFloatWith6Digits(encoderExtension)
- }
- if cfg.EscapeHTML {
- api.escapeHTML(encoderExtension)
- }
- if cfg.UseNumber {
- api.useNumber(decoderExtension)
- }
- if cfg.ValidateJsonRawMessage {
- api.validateJsonRawMessage(encoderExtension)
- }
- api.encoderExtension = encoderExtension
- api.decoderExtension = decoderExtension
- api.configBeforeFrozen = cfg
- return api
-}
-
-func (cfg Config) frozeWithCacheReuse(extraExtensions []Extension) *frozenConfig {
- api := getFrozenConfigFromCache(cfg)
- if api != nil {
- return api
- }
- api = cfg.Froze().(*frozenConfig)
- for _, extension := range extraExtensions {
- api.RegisterExtension(extension)
- }
- addFrozenConfigToCache(cfg, api)
- return api
-}
-
-func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) {
- encoder := &funcEncoder{func(ptr unsafe.Pointer, stream *Stream) {
- rawMessage := *(*json.RawMessage)(ptr)
- iter := cfg.BorrowIterator([]byte(rawMessage))
- defer cfg.ReturnIterator(iter)
- iter.Read()
- if iter.Error != nil && iter.Error != io.EOF {
- stream.WriteRaw("null")
- } else {
- stream.WriteRaw(string(rawMessage))
- }
- }, func(ptr unsafe.Pointer) bool {
- return len(*((*json.RawMessage)(ptr))) == 0
- }}
- extension[reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()] = encoder
- extension[reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()] = encoder
-}
-
-func (cfg *frozenConfig) useNumber(extension DecoderExtension) {
- extension[reflect2.TypeOfPtr((*interface{})(nil)).Elem()] = &funcDecoder{func(ptr unsafe.Pointer, iter *Iterator) {
- exitingValue := *((*interface{})(ptr))
- if exitingValue != nil && reflect.TypeOf(exitingValue).Kind() == reflect.Ptr {
- iter.ReadVal(exitingValue)
- return
- }
- if iter.WhatIsNext() == NumberValue {
- *((*interface{})(ptr)) = json.Number(iter.readNumberAsString())
- } else {
- *((*interface{})(ptr)) = iter.Read()
- }
- }}
-}
-func (cfg *frozenConfig) getTagKey() string {
- tagKey := cfg.configBeforeFrozen.TagKey
- if tagKey == "" {
- return "json"
- }
- return tagKey
-}
-
-func (cfg *frozenConfig) RegisterExtension(extension Extension) {
- cfg.extraExtensions = append(cfg.extraExtensions, extension)
- copied := cfg.configBeforeFrozen
- cfg.configBeforeFrozen = copied
-}
-
-type lossyFloat32Encoder struct {
-}
-
-func (encoder *lossyFloat32Encoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteFloat32Lossy(*((*float32)(ptr)))
-}
-
-func (encoder *lossyFloat32Encoder) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*float32)(ptr)) == 0
-}
-
-type lossyFloat64Encoder struct {
-}
-
-func (encoder *lossyFloat64Encoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteFloat64Lossy(*((*float64)(ptr)))
-}
-
-func (encoder *lossyFloat64Encoder) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*float64)(ptr)) == 0
-}
-
-// EnableLossyFloatMarshalling keeps 10**(-6) precision
-// for float variables for better performance.
-func (cfg *frozenConfig) marshalFloatWith6Digits(extension EncoderExtension) {
- // for better performance
- extension[reflect2.TypeOfPtr((*float32)(nil)).Elem()] = &lossyFloat32Encoder{}
- extension[reflect2.TypeOfPtr((*float64)(nil)).Elem()] = &lossyFloat64Encoder{}
-}
-
-type htmlEscapedStringEncoder struct {
-}
-
-func (encoder *htmlEscapedStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- str := *((*string)(ptr))
- stream.WriteStringWithHTMLEscaped(str)
-}
-
-func (encoder *htmlEscapedStringEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*string)(ptr)) == ""
-}
-
-func (cfg *frozenConfig) escapeHTML(encoderExtension EncoderExtension) {
- encoderExtension[reflect2.TypeOfPtr((*string)(nil)).Elem()] = &htmlEscapedStringEncoder{}
-}
-
-func (cfg *frozenConfig) cleanDecoders() {
- typeDecoders = map[string]ValDecoder{}
- fieldDecoders = map[string]ValDecoder{}
- *cfg = *(cfg.configBeforeFrozen.Froze().(*frozenConfig))
-}
-
-func (cfg *frozenConfig) cleanEncoders() {
- typeEncoders = map[string]ValEncoder{}
- fieldEncoders = map[string]ValEncoder{}
- *cfg = *(cfg.configBeforeFrozen.Froze().(*frozenConfig))
-}
-
-func (cfg *frozenConfig) MarshalToString(v interface{}) (string, error) {
- stream := cfg.BorrowStream(nil)
- defer cfg.ReturnStream(stream)
- stream.WriteVal(v)
- if stream.Error != nil {
- return "", stream.Error
- }
- return string(stream.Buffer()), nil
-}
-
-func (cfg *frozenConfig) Marshal(v interface{}) ([]byte, error) {
- stream := cfg.BorrowStream(nil)
- defer cfg.ReturnStream(stream)
- stream.WriteVal(v)
- if stream.Error != nil {
- return nil, stream.Error
- }
- result := stream.Buffer()
- copied := make([]byte, len(result))
- copy(copied, result)
- return copied, nil
-}
-
-func (cfg *frozenConfig) MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
- if prefix != "" {
- panic("prefix is not supported")
- }
- for _, r := range indent {
- if r != ' ' {
- panic("indent can only be space")
- }
- }
- newCfg := cfg.configBeforeFrozen
- newCfg.IndentionStep = len(indent)
- return newCfg.frozeWithCacheReuse(cfg.extraExtensions).Marshal(v)
-}
-
-func (cfg *frozenConfig) UnmarshalFromString(str string, v interface{}) error {
- data := []byte(str)
- iter := cfg.BorrowIterator(data)
- defer cfg.ReturnIterator(iter)
- iter.ReadVal(v)
- c := iter.nextToken()
- if c == 0 {
- if iter.Error == io.EOF {
- return nil
- }
- return iter.Error
- }
- iter.ReportError("Unmarshal", "there are bytes left after unmarshal")
- return iter.Error
-}
-
-func (cfg *frozenConfig) Get(data []byte, path ...interface{}) Any {
- iter := cfg.BorrowIterator(data)
- defer cfg.ReturnIterator(iter)
- return locatePath(iter, path)
-}
-
-func (cfg *frozenConfig) Unmarshal(data []byte, v interface{}) error {
- iter := cfg.BorrowIterator(data)
- defer cfg.ReturnIterator(iter)
- iter.ReadVal(v)
- c := iter.nextToken()
- if c == 0 {
- if iter.Error == io.EOF {
- return nil
- }
- return iter.Error
- }
- iter.ReportError("Unmarshal", "there are bytes left after unmarshal")
- return iter.Error
-}
-
-func (cfg *frozenConfig) NewEncoder(writer io.Writer) *Encoder {
- stream := NewStream(cfg, writer, 512)
- return &Encoder{stream}
-}
-
-func (cfg *frozenConfig) NewDecoder(reader io.Reader) *Decoder {
- iter := Parse(cfg, reader, 512)
- return &Decoder{iter}
-}
-
-func (cfg *frozenConfig) Valid(data []byte) bool {
- iter := cfg.BorrowIterator(data)
- defer cfg.ReturnIterator(iter)
- iter.Skip()
- return iter.Error == nil
-}
diff --git a/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md b/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md
deleted file mode 100644
index 3095662b..00000000
--- a/vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md
+++ /dev/null
@@ -1,7 +0,0 @@
-| json type \ dest type | bool | int | uint | float |string|
-| --- | --- | --- | --- |--|--|
-| number | positive => true negative => true zero => false| 23.2 => 23 -32.1 => -32| 12.1 => 12 -12.1 => 0|as normal|same as origin|
-| string | empty string => false string "0" => false other strings => true | "123.32" => 123 "-123.4" => -123 "123.23xxxw" => 123 "abcde12" => 0 "-32.1" => -32| 13.2 => 13 -1.1 => 0 |12.1 => 12.1 -12.3 => -12.3 12.4xxa => 12.4 +1.1e2 =>110 |same as origin|
-| bool | true => true false => false| true => 1 false => 0 | true => 1 false => 0 |true => 1 false => 0|true => "true" false => "false"|
-| object | true | 0 | 0 |0|originnal json|
-| array | empty array => false nonempty array => true| [] => 0 [1,2] => 1 | [] => 0 [1,2] => 1 |[] => 0 [1,2] => 1|original json|
\ No newline at end of file
diff --git a/vendor/github.com/json-iterator/go/go.mod b/vendor/github.com/json-iterator/go/go.mod
deleted file mode 100644
index e05c42ff..00000000
--- a/vendor/github.com/json-iterator/go/go.mod
+++ /dev/null
@@ -1,11 +0,0 @@
-module github.com/json-iterator/go
-
-go 1.12
-
-require (
- github.com/davecgh/go-spew v1.1.1
- github.com/google/gofuzz v1.0.0
- github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
- github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
- github.com/stretchr/testify v1.3.0
-)
diff --git a/vendor/github.com/json-iterator/go/go.sum b/vendor/github.com/json-iterator/go/go.sum
deleted file mode 100644
index d778b5a1..00000000
--- a/vendor/github.com/json-iterator/go/go.sum
+++ /dev/null
@@ -1,14 +0,0 @@
-github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
-github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
-github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
diff --git a/vendor/github.com/json-iterator/go/iter.go b/vendor/github.com/json-iterator/go/iter.go
deleted file mode 100644
index 29b31cf7..00000000
--- a/vendor/github.com/json-iterator/go/iter.go
+++ /dev/null
@@ -1,349 +0,0 @@
-package jsoniter
-
-import (
- "encoding/json"
- "fmt"
- "io"
-)
-
-// ValueType the type for JSON element
-type ValueType int
-
-const (
- // InvalidValue invalid JSON element
- InvalidValue ValueType = iota
- // StringValue JSON element "string"
- StringValue
- // NumberValue JSON element 100 or 0.10
- NumberValue
- // NilValue JSON element null
- NilValue
- // BoolValue JSON element true or false
- BoolValue
- // ArrayValue JSON element []
- ArrayValue
- // ObjectValue JSON element {}
- ObjectValue
-)
-
-var hexDigits []byte
-var valueTypes []ValueType
-
-func init() {
- hexDigits = make([]byte, 256)
- for i := 0; i < len(hexDigits); i++ {
- hexDigits[i] = 255
- }
- for i := '0'; i <= '9'; i++ {
- hexDigits[i] = byte(i - '0')
- }
- for i := 'a'; i <= 'f'; i++ {
- hexDigits[i] = byte((i - 'a') + 10)
- }
- for i := 'A'; i <= 'F'; i++ {
- hexDigits[i] = byte((i - 'A') + 10)
- }
- valueTypes = make([]ValueType, 256)
- for i := 0; i < len(valueTypes); i++ {
- valueTypes[i] = InvalidValue
- }
- valueTypes['"'] = StringValue
- valueTypes['-'] = NumberValue
- valueTypes['0'] = NumberValue
- valueTypes['1'] = NumberValue
- valueTypes['2'] = NumberValue
- valueTypes['3'] = NumberValue
- valueTypes['4'] = NumberValue
- valueTypes['5'] = NumberValue
- valueTypes['6'] = NumberValue
- valueTypes['7'] = NumberValue
- valueTypes['8'] = NumberValue
- valueTypes['9'] = NumberValue
- valueTypes['t'] = BoolValue
- valueTypes['f'] = BoolValue
- valueTypes['n'] = NilValue
- valueTypes['['] = ArrayValue
- valueTypes['{'] = ObjectValue
-}
-
-// Iterator is a io.Reader like object, with JSON specific read functions.
-// Error is not returned as return value, but stored as Error member on this iterator instance.
-type Iterator struct {
- cfg *frozenConfig
- reader io.Reader
- buf []byte
- head int
- tail int
- depth int
- captureStartedAt int
- captured []byte
- Error error
- Attachment interface{} // open for customized decoder
-}
-
-// NewIterator creates an empty Iterator instance
-func NewIterator(cfg API) *Iterator {
- return &Iterator{
- cfg: cfg.(*frozenConfig),
- reader: nil,
- buf: nil,
- head: 0,
- tail: 0,
- depth: 0,
- }
-}
-
-// Parse creates an Iterator instance from io.Reader
-func Parse(cfg API, reader io.Reader, bufSize int) *Iterator {
- return &Iterator{
- cfg: cfg.(*frozenConfig),
- reader: reader,
- buf: make([]byte, bufSize),
- head: 0,
- tail: 0,
- depth: 0,
- }
-}
-
-// ParseBytes creates an Iterator instance from byte array
-func ParseBytes(cfg API, input []byte) *Iterator {
- return &Iterator{
- cfg: cfg.(*frozenConfig),
- reader: nil,
- buf: input,
- head: 0,
- tail: len(input),
- depth: 0,
- }
-}
-
-// ParseString creates an Iterator instance from string
-func ParseString(cfg API, input string) *Iterator {
- return ParseBytes(cfg, []byte(input))
-}
-
-// Pool returns a pool can provide more iterator with same configuration
-func (iter *Iterator) Pool() IteratorPool {
- return iter.cfg
-}
-
-// Reset reuse iterator instance by specifying another reader
-func (iter *Iterator) Reset(reader io.Reader) *Iterator {
- iter.reader = reader
- iter.head = 0
- iter.tail = 0
- iter.depth = 0
- return iter
-}
-
-// ResetBytes reuse iterator instance by specifying another byte array as input
-func (iter *Iterator) ResetBytes(input []byte) *Iterator {
- iter.reader = nil
- iter.buf = input
- iter.head = 0
- iter.tail = len(input)
- iter.depth = 0
- return iter
-}
-
-// WhatIsNext gets ValueType of relatively next json element
-func (iter *Iterator) WhatIsNext() ValueType {
- valueType := valueTypes[iter.nextToken()]
- iter.unreadByte()
- return valueType
-}
-
-func (iter *Iterator) skipWhitespacesWithoutLoadMore() bool {
- for i := iter.head; i < iter.tail; i++ {
- c := iter.buf[i]
- switch c {
- case ' ', '\n', '\t', '\r':
- continue
- }
- iter.head = i
- return false
- }
- return true
-}
-
-func (iter *Iterator) isObjectEnd() bool {
- c := iter.nextToken()
- if c == ',' {
- return false
- }
- if c == '}' {
- return true
- }
- iter.ReportError("isObjectEnd", "object ended prematurely, unexpected char "+string([]byte{c}))
- return true
-}
-
-func (iter *Iterator) nextToken() byte {
- // a variation of skip whitespaces, returning the next non-whitespace token
- for {
- for i := iter.head; i < iter.tail; i++ {
- c := iter.buf[i]
- switch c {
- case ' ', '\n', '\t', '\r':
- continue
- }
- iter.head = i + 1
- return c
- }
- if !iter.loadMore() {
- return 0
- }
- }
-}
-
-// ReportError record a error in iterator instance with current position.
-func (iter *Iterator) ReportError(operation string, msg string) {
- if iter.Error != nil {
- if iter.Error != io.EOF {
- return
- }
- }
- peekStart := iter.head - 10
- if peekStart < 0 {
- peekStart = 0
- }
- peekEnd := iter.head + 10
- if peekEnd > iter.tail {
- peekEnd = iter.tail
- }
- parsing := string(iter.buf[peekStart:peekEnd])
- contextStart := iter.head - 50
- if contextStart < 0 {
- contextStart = 0
- }
- contextEnd := iter.head + 50
- if contextEnd > iter.tail {
- contextEnd = iter.tail
- }
- context := string(iter.buf[contextStart:contextEnd])
- iter.Error = fmt.Errorf("%s: %s, error found in #%v byte of ...|%s|..., bigger context ...|%s|...",
- operation, msg, iter.head-peekStart, parsing, context)
-}
-
-// CurrentBuffer gets current buffer as string for debugging purpose
-func (iter *Iterator) CurrentBuffer() string {
- peekStart := iter.head - 10
- if peekStart < 0 {
- peekStart = 0
- }
- return fmt.Sprintf("parsing #%v byte, around ...|%s|..., whole buffer ...|%s|...", iter.head,
- string(iter.buf[peekStart:iter.head]), string(iter.buf[0:iter.tail]))
-}
-
-func (iter *Iterator) readByte() (ret byte) {
- if iter.head == iter.tail {
- if iter.loadMore() {
- ret = iter.buf[iter.head]
- iter.head++
- return ret
- }
- return 0
- }
- ret = iter.buf[iter.head]
- iter.head++
- return ret
-}
-
-func (iter *Iterator) loadMore() bool {
- if iter.reader == nil {
- if iter.Error == nil {
- iter.head = iter.tail
- iter.Error = io.EOF
- }
- return false
- }
- if iter.captured != nil {
- iter.captured = append(iter.captured,
- iter.buf[iter.captureStartedAt:iter.tail]...)
- iter.captureStartedAt = 0
- }
- for {
- n, err := iter.reader.Read(iter.buf)
- if n == 0 {
- if err != nil {
- if iter.Error == nil {
- iter.Error = err
- }
- return false
- }
- } else {
- iter.head = 0
- iter.tail = n
- return true
- }
- }
-}
-
-func (iter *Iterator) unreadByte() {
- if iter.Error != nil {
- return
- }
- iter.head--
- return
-}
-
-// Read read the next JSON element as generic interface{}.
-func (iter *Iterator) Read() interface{} {
- valueType := iter.WhatIsNext()
- switch valueType {
- case StringValue:
- return iter.ReadString()
- case NumberValue:
- if iter.cfg.configBeforeFrozen.UseNumber {
- return json.Number(iter.readNumberAsString())
- }
- return iter.ReadFloat64()
- case NilValue:
- iter.skipFourBytes('n', 'u', 'l', 'l')
- return nil
- case BoolValue:
- return iter.ReadBool()
- case ArrayValue:
- arr := []interface{}{}
- iter.ReadArrayCB(func(iter *Iterator) bool {
- var elem interface{}
- iter.ReadVal(&elem)
- arr = append(arr, elem)
- return true
- })
- return arr
- case ObjectValue:
- obj := map[string]interface{}{}
- iter.ReadMapCB(func(Iter *Iterator, field string) bool {
- var elem interface{}
- iter.ReadVal(&elem)
- obj[field] = elem
- return true
- })
- return obj
- default:
- iter.ReportError("Read", fmt.Sprintf("unexpected value type: %v", valueType))
- return nil
- }
-}
-
-// limit maximum depth of nesting, as allowed by https://tools.ietf.org/html/rfc7159#section-9
-const maxDepth = 10000
-
-func (iter *Iterator) incrementDepth() (success bool) {
- iter.depth++
- if iter.depth <= maxDepth {
- return true
- }
- iter.ReportError("incrementDepth", "exceeded max depth")
- return false
-}
-
-func (iter *Iterator) decrementDepth() (success bool) {
- iter.depth--
- if iter.depth >= 0 {
- return true
- }
- iter.ReportError("decrementDepth", "unexpected negative nesting")
- return false
-}
diff --git a/vendor/github.com/json-iterator/go/iter_array.go b/vendor/github.com/json-iterator/go/iter_array.go
deleted file mode 100644
index 204fe0e0..00000000
--- a/vendor/github.com/json-iterator/go/iter_array.go
+++ /dev/null
@@ -1,64 +0,0 @@
-package jsoniter
-
-// ReadArray read array element, tells if the array has more element to read.
-func (iter *Iterator) ReadArray() (ret bool) {
- c := iter.nextToken()
- switch c {
- case 'n':
- iter.skipThreeBytes('u', 'l', 'l')
- return false // null
- case '[':
- c = iter.nextToken()
- if c != ']' {
- iter.unreadByte()
- return true
- }
- return false
- case ']':
- return false
- case ',':
- return true
- default:
- iter.ReportError("ReadArray", "expect [ or , or ] or n, but found "+string([]byte{c}))
- return
- }
-}
-
-// ReadArrayCB read array with callback
-func (iter *Iterator) ReadArrayCB(callback func(*Iterator) bool) (ret bool) {
- c := iter.nextToken()
- if c == '[' {
- if !iter.incrementDepth() {
- return false
- }
- c = iter.nextToken()
- if c != ']' {
- iter.unreadByte()
- if !callback(iter) {
- iter.decrementDepth()
- return false
- }
- c = iter.nextToken()
- for c == ',' {
- if !callback(iter) {
- iter.decrementDepth()
- return false
- }
- c = iter.nextToken()
- }
- if c != ']' {
- iter.ReportError("ReadArrayCB", "expect ] in the end, but found "+string([]byte{c}))
- iter.decrementDepth()
- return false
- }
- return iter.decrementDepth()
- }
- return iter.decrementDepth()
- }
- if c == 'n' {
- iter.skipThreeBytes('u', 'l', 'l')
- return true // null
- }
- iter.ReportError("ReadArrayCB", "expect [ or n, but found "+string([]byte{c}))
- return false
-}
diff --git a/vendor/github.com/json-iterator/go/iter_float.go b/vendor/github.com/json-iterator/go/iter_float.go
deleted file mode 100644
index b9754638..00000000
--- a/vendor/github.com/json-iterator/go/iter_float.go
+++ /dev/null
@@ -1,339 +0,0 @@
-package jsoniter
-
-import (
- "encoding/json"
- "io"
- "math/big"
- "strconv"
- "strings"
- "unsafe"
-)
-
-var floatDigits []int8
-
-const invalidCharForNumber = int8(-1)
-const endOfNumber = int8(-2)
-const dotInNumber = int8(-3)
-
-func init() {
- floatDigits = make([]int8, 256)
- for i := 0; i < len(floatDigits); i++ {
- floatDigits[i] = invalidCharForNumber
- }
- for i := int8('0'); i <= int8('9'); i++ {
- floatDigits[i] = i - int8('0')
- }
- floatDigits[','] = endOfNumber
- floatDigits[']'] = endOfNumber
- floatDigits['}'] = endOfNumber
- floatDigits[' '] = endOfNumber
- floatDigits['\t'] = endOfNumber
- floatDigits['\n'] = endOfNumber
- floatDigits['.'] = dotInNumber
-}
-
-// ReadBigFloat read big.Float
-func (iter *Iterator) ReadBigFloat() (ret *big.Float) {
- str := iter.readNumberAsString()
- if iter.Error != nil && iter.Error != io.EOF {
- return nil
- }
- prec := 64
- if len(str) > prec {
- prec = len(str)
- }
- val, _, err := big.ParseFloat(str, 10, uint(prec), big.ToZero)
- if err != nil {
- iter.Error = err
- return nil
- }
- return val
-}
-
-// ReadBigInt read big.Int
-func (iter *Iterator) ReadBigInt() (ret *big.Int) {
- str := iter.readNumberAsString()
- if iter.Error != nil && iter.Error != io.EOF {
- return nil
- }
- ret = big.NewInt(0)
- var success bool
- ret, success = ret.SetString(str, 10)
- if !success {
- iter.ReportError("ReadBigInt", "invalid big int")
- return nil
- }
- return ret
-}
-
-//ReadFloat32 read float32
-func (iter *Iterator) ReadFloat32() (ret float32) {
- c := iter.nextToken()
- if c == '-' {
- return -iter.readPositiveFloat32()
- }
- iter.unreadByte()
- return iter.readPositiveFloat32()
-}
-
-func (iter *Iterator) readPositiveFloat32() (ret float32) {
- i := iter.head
- // first char
- if i == iter.tail {
- return iter.readFloat32SlowPath()
- }
- c := iter.buf[i]
- i++
- ind := floatDigits[c]
- switch ind {
- case invalidCharForNumber:
- return iter.readFloat32SlowPath()
- case endOfNumber:
- iter.ReportError("readFloat32", "empty number")
- return
- case dotInNumber:
- iter.ReportError("readFloat32", "leading dot is invalid")
- return
- case 0:
- if i == iter.tail {
- return iter.readFloat32SlowPath()
- }
- c = iter.buf[i]
- switch c {
- case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
- iter.ReportError("readFloat32", "leading zero is invalid")
- return
- }
- }
- value := uint64(ind)
- // chars before dot
-non_decimal_loop:
- for ; i < iter.tail; i++ {
- c = iter.buf[i]
- ind := floatDigits[c]
- switch ind {
- case invalidCharForNumber:
- return iter.readFloat32SlowPath()
- case endOfNumber:
- iter.head = i
- return float32(value)
- case dotInNumber:
- break non_decimal_loop
- }
- if value > uint64SafeToMultiple10 {
- return iter.readFloat32SlowPath()
- }
- value = (value << 3) + (value << 1) + uint64(ind) // value = value * 10 + ind;
- }
- // chars after dot
- if c == '.' {
- i++
- decimalPlaces := 0
- if i == iter.tail {
- return iter.readFloat32SlowPath()
- }
- for ; i < iter.tail; i++ {
- c = iter.buf[i]
- ind := floatDigits[c]
- switch ind {
- case endOfNumber:
- if decimalPlaces > 0 && decimalPlaces < len(pow10) {
- iter.head = i
- return float32(float64(value) / float64(pow10[decimalPlaces]))
- }
- // too many decimal places
- return iter.readFloat32SlowPath()
- case invalidCharForNumber, dotInNumber:
- return iter.readFloat32SlowPath()
- }
- decimalPlaces++
- if value > uint64SafeToMultiple10 {
- return iter.readFloat32SlowPath()
- }
- value = (value << 3) + (value << 1) + uint64(ind)
- }
- }
- return iter.readFloat32SlowPath()
-}
-
-func (iter *Iterator) readNumberAsString() (ret string) {
- strBuf := [16]byte{}
- str := strBuf[0:0]
-load_loop:
- for {
- for i := iter.head; i < iter.tail; i++ {
- c := iter.buf[i]
- switch c {
- case '+', '-', '.', 'e', 'E', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
- str = append(str, c)
- continue
- default:
- iter.head = i
- break load_loop
- }
- }
- if !iter.loadMore() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF {
- return
- }
- if len(str) == 0 {
- iter.ReportError("readNumberAsString", "invalid number")
- }
- return *(*string)(unsafe.Pointer(&str))
-}
-
-func (iter *Iterator) readFloat32SlowPath() (ret float32) {
- str := iter.readNumberAsString()
- if iter.Error != nil && iter.Error != io.EOF {
- return
- }
- errMsg := validateFloat(str)
- if errMsg != "" {
- iter.ReportError("readFloat32SlowPath", errMsg)
- return
- }
- val, err := strconv.ParseFloat(str, 32)
- if err != nil {
- iter.Error = err
- return
- }
- return float32(val)
-}
-
-// ReadFloat64 read float64
-func (iter *Iterator) ReadFloat64() (ret float64) {
- c := iter.nextToken()
- if c == '-' {
- return -iter.readPositiveFloat64()
- }
- iter.unreadByte()
- return iter.readPositiveFloat64()
-}
-
-func (iter *Iterator) readPositiveFloat64() (ret float64) {
- i := iter.head
- // first char
- if i == iter.tail {
- return iter.readFloat64SlowPath()
- }
- c := iter.buf[i]
- i++
- ind := floatDigits[c]
- switch ind {
- case invalidCharForNumber:
- return iter.readFloat64SlowPath()
- case endOfNumber:
- iter.ReportError("readFloat64", "empty number")
- return
- case dotInNumber:
- iter.ReportError("readFloat64", "leading dot is invalid")
- return
- case 0:
- if i == iter.tail {
- return iter.readFloat64SlowPath()
- }
- c = iter.buf[i]
- switch c {
- case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
- iter.ReportError("readFloat64", "leading zero is invalid")
- return
- }
- }
- value := uint64(ind)
- // chars before dot
-non_decimal_loop:
- for ; i < iter.tail; i++ {
- c = iter.buf[i]
- ind := floatDigits[c]
- switch ind {
- case invalidCharForNumber:
- return iter.readFloat64SlowPath()
- case endOfNumber:
- iter.head = i
- return float64(value)
- case dotInNumber:
- break non_decimal_loop
- }
- if value > uint64SafeToMultiple10 {
- return iter.readFloat64SlowPath()
- }
- value = (value << 3) + (value << 1) + uint64(ind) // value = value * 10 + ind;
- }
- // chars after dot
- if c == '.' {
- i++
- decimalPlaces := 0
- if i == iter.tail {
- return iter.readFloat64SlowPath()
- }
- for ; i < iter.tail; i++ {
- c = iter.buf[i]
- ind := floatDigits[c]
- switch ind {
- case endOfNumber:
- if decimalPlaces > 0 && decimalPlaces < len(pow10) {
- iter.head = i
- return float64(value) / float64(pow10[decimalPlaces])
- }
- // too many decimal places
- return iter.readFloat64SlowPath()
- case invalidCharForNumber, dotInNumber:
- return iter.readFloat64SlowPath()
- }
- decimalPlaces++
- if value > uint64SafeToMultiple10 {
- return iter.readFloat64SlowPath()
- }
- value = (value << 3) + (value << 1) + uint64(ind)
- }
- }
- return iter.readFloat64SlowPath()
-}
-
-func (iter *Iterator) readFloat64SlowPath() (ret float64) {
- str := iter.readNumberAsString()
- if iter.Error != nil && iter.Error != io.EOF {
- return
- }
- errMsg := validateFloat(str)
- if errMsg != "" {
- iter.ReportError("readFloat64SlowPath", errMsg)
- return
- }
- val, err := strconv.ParseFloat(str, 64)
- if err != nil {
- iter.Error = err
- return
- }
- return val
-}
-
-func validateFloat(str string) string {
- // strconv.ParseFloat is not validating `1.` or `1.e1`
- if len(str) == 0 {
- return "empty number"
- }
- if str[0] == '-' {
- return "-- is not valid"
- }
- dotPos := strings.IndexByte(str, '.')
- if dotPos != -1 {
- if dotPos == len(str)-1 {
- return "dot can not be last character"
- }
- switch str[dotPos+1] {
- case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
- default:
- return "missing digit after dot"
- }
- }
- return ""
-}
-
-// ReadNumber read json.Number
-func (iter *Iterator) ReadNumber() (ret json.Number) {
- return json.Number(iter.readNumberAsString())
-}
diff --git a/vendor/github.com/json-iterator/go/iter_int.go b/vendor/github.com/json-iterator/go/iter_int.go
deleted file mode 100644
index 21423203..00000000
--- a/vendor/github.com/json-iterator/go/iter_int.go
+++ /dev/null
@@ -1,345 +0,0 @@
-package jsoniter
-
-import (
- "math"
- "strconv"
-)
-
-var intDigits []int8
-
-const uint32SafeToMultiply10 = uint32(0xffffffff)/10 - 1
-const uint64SafeToMultiple10 = uint64(0xffffffffffffffff)/10 - 1
-
-func init() {
- intDigits = make([]int8, 256)
- for i := 0; i < len(intDigits); i++ {
- intDigits[i] = invalidCharForNumber
- }
- for i := int8('0'); i <= int8('9'); i++ {
- intDigits[i] = i - int8('0')
- }
-}
-
-// ReadUint read uint
-func (iter *Iterator) ReadUint() uint {
- if strconv.IntSize == 32 {
- return uint(iter.ReadUint32())
- }
- return uint(iter.ReadUint64())
-}
-
-// ReadInt read int
-func (iter *Iterator) ReadInt() int {
- if strconv.IntSize == 32 {
- return int(iter.ReadInt32())
- }
- return int(iter.ReadInt64())
-}
-
-// ReadInt8 read int8
-func (iter *Iterator) ReadInt8() (ret int8) {
- c := iter.nextToken()
- if c == '-' {
- val := iter.readUint32(iter.readByte())
- if val > math.MaxInt8+1 {
- iter.ReportError("ReadInt8", "overflow: "+strconv.FormatInt(int64(val), 10))
- return
- }
- return -int8(val)
- }
- val := iter.readUint32(c)
- if val > math.MaxInt8 {
- iter.ReportError("ReadInt8", "overflow: "+strconv.FormatInt(int64(val), 10))
- return
- }
- return int8(val)
-}
-
-// ReadUint8 read uint8
-func (iter *Iterator) ReadUint8() (ret uint8) {
- val := iter.readUint32(iter.nextToken())
- if val > math.MaxUint8 {
- iter.ReportError("ReadUint8", "overflow: "+strconv.FormatInt(int64(val), 10))
- return
- }
- return uint8(val)
-}
-
-// ReadInt16 read int16
-func (iter *Iterator) ReadInt16() (ret int16) {
- c := iter.nextToken()
- if c == '-' {
- val := iter.readUint32(iter.readByte())
- if val > math.MaxInt16+1 {
- iter.ReportError("ReadInt16", "overflow: "+strconv.FormatInt(int64(val), 10))
- return
- }
- return -int16(val)
- }
- val := iter.readUint32(c)
- if val > math.MaxInt16 {
- iter.ReportError("ReadInt16", "overflow: "+strconv.FormatInt(int64(val), 10))
- return
- }
- return int16(val)
-}
-
-// ReadUint16 read uint16
-func (iter *Iterator) ReadUint16() (ret uint16) {
- val := iter.readUint32(iter.nextToken())
- if val > math.MaxUint16 {
- iter.ReportError("ReadUint16", "overflow: "+strconv.FormatInt(int64(val), 10))
- return
- }
- return uint16(val)
-}
-
-// ReadInt32 read int32
-func (iter *Iterator) ReadInt32() (ret int32) {
- c := iter.nextToken()
- if c == '-' {
- val := iter.readUint32(iter.readByte())
- if val > math.MaxInt32+1 {
- iter.ReportError("ReadInt32", "overflow: "+strconv.FormatInt(int64(val), 10))
- return
- }
- return -int32(val)
- }
- val := iter.readUint32(c)
- if val > math.MaxInt32 {
- iter.ReportError("ReadInt32", "overflow: "+strconv.FormatInt(int64(val), 10))
- return
- }
- return int32(val)
-}
-
-// ReadUint32 read uint32
-func (iter *Iterator) ReadUint32() (ret uint32) {
- return iter.readUint32(iter.nextToken())
-}
-
-func (iter *Iterator) readUint32(c byte) (ret uint32) {
- ind := intDigits[c]
- if ind == 0 {
- iter.assertInteger()
- return 0 // single zero
- }
- if ind == invalidCharForNumber {
- iter.ReportError("readUint32", "unexpected character: "+string([]byte{byte(ind)}))
- return
- }
- value := uint32(ind)
- if iter.tail-iter.head > 10 {
- i := iter.head
- ind2 := intDigits[iter.buf[i]]
- if ind2 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value
- }
- i++
- ind3 := intDigits[iter.buf[i]]
- if ind3 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*10 + uint32(ind2)
- }
- //iter.head = i + 1
- //value = value * 100 + uint32(ind2) * 10 + uint32(ind3)
- i++
- ind4 := intDigits[iter.buf[i]]
- if ind4 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*100 + uint32(ind2)*10 + uint32(ind3)
- }
- i++
- ind5 := intDigits[iter.buf[i]]
- if ind5 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*1000 + uint32(ind2)*100 + uint32(ind3)*10 + uint32(ind4)
- }
- i++
- ind6 := intDigits[iter.buf[i]]
- if ind6 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*10000 + uint32(ind2)*1000 + uint32(ind3)*100 + uint32(ind4)*10 + uint32(ind5)
- }
- i++
- ind7 := intDigits[iter.buf[i]]
- if ind7 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*100000 + uint32(ind2)*10000 + uint32(ind3)*1000 + uint32(ind4)*100 + uint32(ind5)*10 + uint32(ind6)
- }
- i++
- ind8 := intDigits[iter.buf[i]]
- if ind8 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*1000000 + uint32(ind2)*100000 + uint32(ind3)*10000 + uint32(ind4)*1000 + uint32(ind5)*100 + uint32(ind6)*10 + uint32(ind7)
- }
- i++
- ind9 := intDigits[iter.buf[i]]
- value = value*10000000 + uint32(ind2)*1000000 + uint32(ind3)*100000 + uint32(ind4)*10000 + uint32(ind5)*1000 + uint32(ind6)*100 + uint32(ind7)*10 + uint32(ind8)
- iter.head = i
- if ind9 == invalidCharForNumber {
- iter.assertInteger()
- return value
- }
- }
- for {
- for i := iter.head; i < iter.tail; i++ {
- ind = intDigits[iter.buf[i]]
- if ind == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value
- }
- if value > uint32SafeToMultiply10 {
- value2 := (value << 3) + (value << 1) + uint32(ind)
- if value2 < value {
- iter.ReportError("readUint32", "overflow")
- return
- }
- value = value2
- continue
- }
- value = (value << 3) + (value << 1) + uint32(ind)
- }
- if !iter.loadMore() {
- iter.assertInteger()
- return value
- }
- }
-}
-
-// ReadInt64 read int64
-func (iter *Iterator) ReadInt64() (ret int64) {
- c := iter.nextToken()
- if c == '-' {
- val := iter.readUint64(iter.readByte())
- if val > math.MaxInt64+1 {
- iter.ReportError("ReadInt64", "overflow: "+strconv.FormatUint(uint64(val), 10))
- return
- }
- return -int64(val)
- }
- val := iter.readUint64(c)
- if val > math.MaxInt64 {
- iter.ReportError("ReadInt64", "overflow: "+strconv.FormatUint(uint64(val), 10))
- return
- }
- return int64(val)
-}
-
-// ReadUint64 read uint64
-func (iter *Iterator) ReadUint64() uint64 {
- return iter.readUint64(iter.nextToken())
-}
-
-func (iter *Iterator) readUint64(c byte) (ret uint64) {
- ind := intDigits[c]
- if ind == 0 {
- iter.assertInteger()
- return 0 // single zero
- }
- if ind == invalidCharForNumber {
- iter.ReportError("readUint64", "unexpected character: "+string([]byte{byte(ind)}))
- return
- }
- value := uint64(ind)
- if iter.tail-iter.head > 10 {
- i := iter.head
- ind2 := intDigits[iter.buf[i]]
- if ind2 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value
- }
- i++
- ind3 := intDigits[iter.buf[i]]
- if ind3 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*10 + uint64(ind2)
- }
- //iter.head = i + 1
- //value = value * 100 + uint32(ind2) * 10 + uint32(ind3)
- i++
- ind4 := intDigits[iter.buf[i]]
- if ind4 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*100 + uint64(ind2)*10 + uint64(ind3)
- }
- i++
- ind5 := intDigits[iter.buf[i]]
- if ind5 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*1000 + uint64(ind2)*100 + uint64(ind3)*10 + uint64(ind4)
- }
- i++
- ind6 := intDigits[iter.buf[i]]
- if ind6 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*10000 + uint64(ind2)*1000 + uint64(ind3)*100 + uint64(ind4)*10 + uint64(ind5)
- }
- i++
- ind7 := intDigits[iter.buf[i]]
- if ind7 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*100000 + uint64(ind2)*10000 + uint64(ind3)*1000 + uint64(ind4)*100 + uint64(ind5)*10 + uint64(ind6)
- }
- i++
- ind8 := intDigits[iter.buf[i]]
- if ind8 == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value*1000000 + uint64(ind2)*100000 + uint64(ind3)*10000 + uint64(ind4)*1000 + uint64(ind5)*100 + uint64(ind6)*10 + uint64(ind7)
- }
- i++
- ind9 := intDigits[iter.buf[i]]
- value = value*10000000 + uint64(ind2)*1000000 + uint64(ind3)*100000 + uint64(ind4)*10000 + uint64(ind5)*1000 + uint64(ind6)*100 + uint64(ind7)*10 + uint64(ind8)
- iter.head = i
- if ind9 == invalidCharForNumber {
- iter.assertInteger()
- return value
- }
- }
- for {
- for i := iter.head; i < iter.tail; i++ {
- ind = intDigits[iter.buf[i]]
- if ind == invalidCharForNumber {
- iter.head = i
- iter.assertInteger()
- return value
- }
- if value > uint64SafeToMultiple10 {
- value2 := (value << 3) + (value << 1) + uint64(ind)
- if value2 < value {
- iter.ReportError("readUint64", "overflow")
- return
- }
- value = value2
- continue
- }
- value = (value << 3) + (value << 1) + uint64(ind)
- }
- if !iter.loadMore() {
- iter.assertInteger()
- return value
- }
- }
-}
-
-func (iter *Iterator) assertInteger() {
- if iter.head < len(iter.buf) && iter.buf[iter.head] == '.' {
- iter.ReportError("assertInteger", "can not decode float as int")
- }
-}
diff --git a/vendor/github.com/json-iterator/go/iter_object.go b/vendor/github.com/json-iterator/go/iter_object.go
deleted file mode 100644
index 58ee89c8..00000000
--- a/vendor/github.com/json-iterator/go/iter_object.go
+++ /dev/null
@@ -1,267 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "strings"
-)
-
-// ReadObject read one field from object.
-// If object ended, returns empty string.
-// Otherwise, returns the field name.
-func (iter *Iterator) ReadObject() (ret string) {
- c := iter.nextToken()
- switch c {
- case 'n':
- iter.skipThreeBytes('u', 'l', 'l')
- return "" // null
- case '{':
- c = iter.nextToken()
- if c == '"' {
- iter.unreadByte()
- field := iter.ReadString()
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
- return field
- }
- if c == '}' {
- return "" // end of object
- }
- iter.ReportError("ReadObject", `expect " after {, but found `+string([]byte{c}))
- return
- case ',':
- field := iter.ReadString()
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
- return field
- case '}':
- return "" // end of object
- default:
- iter.ReportError("ReadObject", fmt.Sprintf(`expect { or , or } or n, but found %s`, string([]byte{c})))
- return
- }
-}
-
-// CaseInsensitive
-func (iter *Iterator) readFieldHash() int64 {
- hash := int64(0x811c9dc5)
- c := iter.nextToken()
- if c != '"' {
- iter.ReportError("readFieldHash", `expect ", but found `+string([]byte{c}))
- return 0
- }
- for {
- for i := iter.head; i < iter.tail; i++ {
- // require ascii string and no escape
- b := iter.buf[i]
- if b == '\\' {
- iter.head = i
- for _, b := range iter.readStringSlowPath() {
- if 'A' <= b && b <= 'Z' && !iter.cfg.caseSensitive {
- b += 'a' - 'A'
- }
- hash ^= int64(b)
- hash *= 0x1000193
- }
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("readFieldHash", `expect :, but found `+string([]byte{c}))
- return 0
- }
- return hash
- }
- if b == '"' {
- iter.head = i + 1
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("readFieldHash", `expect :, but found `+string([]byte{c}))
- return 0
- }
- return hash
- }
- if 'A' <= b && b <= 'Z' && !iter.cfg.caseSensitive {
- b += 'a' - 'A'
- }
- hash ^= int64(b)
- hash *= 0x1000193
- }
- if !iter.loadMore() {
- iter.ReportError("readFieldHash", `incomplete field name`)
- return 0
- }
- }
-}
-
-func calcHash(str string, caseSensitive bool) int64 {
- if !caseSensitive {
- str = strings.ToLower(str)
- }
- hash := int64(0x811c9dc5)
- for _, b := range []byte(str) {
- hash ^= int64(b)
- hash *= 0x1000193
- }
- return int64(hash)
-}
-
-// ReadObjectCB read object with callback, the key is ascii only and field name not copied
-func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool {
- c := iter.nextToken()
- var field string
- if c == '{' {
- if !iter.incrementDepth() {
- return false
- }
- c = iter.nextToken()
- if c == '"' {
- iter.unreadByte()
- field = iter.ReadString()
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
- if !callback(iter, field) {
- iter.decrementDepth()
- return false
- }
- c = iter.nextToken()
- for c == ',' {
- field = iter.ReadString()
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
- if !callback(iter, field) {
- iter.decrementDepth()
- return false
- }
- c = iter.nextToken()
- }
- if c != '}' {
- iter.ReportError("ReadObjectCB", `object not ended with }`)
- iter.decrementDepth()
- return false
- }
- return iter.decrementDepth()
- }
- if c == '}' {
- return iter.decrementDepth()
- }
- iter.ReportError("ReadObjectCB", `expect " after {, but found `+string([]byte{c}))
- iter.decrementDepth()
- return false
- }
- if c == 'n' {
- iter.skipThreeBytes('u', 'l', 'l')
- return true // null
- }
- iter.ReportError("ReadObjectCB", `expect { or n, but found `+string([]byte{c}))
- return false
-}
-
-// ReadMapCB read map with callback, the key can be any string
-func (iter *Iterator) ReadMapCB(callback func(*Iterator, string) bool) bool {
- c := iter.nextToken()
- if c == '{' {
- if !iter.incrementDepth() {
- return false
- }
- c = iter.nextToken()
- if c == '"' {
- iter.unreadByte()
- field := iter.ReadString()
- if iter.nextToken() != ':' {
- iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c}))
- iter.decrementDepth()
- return false
- }
- if !callback(iter, field) {
- iter.decrementDepth()
- return false
- }
- c = iter.nextToken()
- for c == ',' {
- field = iter.ReadString()
- if iter.nextToken() != ':' {
- iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c}))
- iter.decrementDepth()
- return false
- }
- if !callback(iter, field) {
- iter.decrementDepth()
- return false
- }
- c = iter.nextToken()
- }
- if c != '}' {
- iter.ReportError("ReadMapCB", `object not ended with }`)
- iter.decrementDepth()
- return false
- }
- return iter.decrementDepth()
- }
- if c == '}' {
- return iter.decrementDepth()
- }
- iter.ReportError("ReadMapCB", `expect " after {, but found `+string([]byte{c}))
- iter.decrementDepth()
- return false
- }
- if c == 'n' {
- iter.skipThreeBytes('u', 'l', 'l')
- return true // null
- }
- iter.ReportError("ReadMapCB", `expect { or n, but found `+string([]byte{c}))
- return false
-}
-
-func (iter *Iterator) readObjectStart() bool {
- c := iter.nextToken()
- if c == '{' {
- c = iter.nextToken()
- if c == '}' {
- return false
- }
- iter.unreadByte()
- return true
- } else if c == 'n' {
- iter.skipThreeBytes('u', 'l', 'l')
- return false
- }
- iter.ReportError("readObjectStart", "expect { or n, but found "+string([]byte{c}))
- return false
-}
-
-func (iter *Iterator) readObjectFieldAsBytes() (ret []byte) {
- str := iter.ReadStringAsSlice()
- if iter.skipWhitespacesWithoutLoadMore() {
- if ret == nil {
- ret = make([]byte, len(str))
- copy(ret, str)
- }
- if !iter.loadMore() {
- return
- }
- }
- if iter.buf[iter.head] != ':' {
- iter.ReportError("readObjectFieldAsBytes", "expect : after object field, but found "+string([]byte{iter.buf[iter.head]}))
- return
- }
- iter.head++
- if iter.skipWhitespacesWithoutLoadMore() {
- if ret == nil {
- ret = make([]byte, len(str))
- copy(ret, str)
- }
- if !iter.loadMore() {
- return
- }
- }
- if ret == nil {
- return str
- }
- return ret
-}
diff --git a/vendor/github.com/json-iterator/go/iter_skip.go b/vendor/github.com/json-iterator/go/iter_skip.go
deleted file mode 100644
index e91eefb1..00000000
--- a/vendor/github.com/json-iterator/go/iter_skip.go
+++ /dev/null
@@ -1,130 +0,0 @@
-package jsoniter
-
-import "fmt"
-
-// ReadNil reads a json object as nil and
-// returns whether it's a nil or not
-func (iter *Iterator) ReadNil() (ret bool) {
- c := iter.nextToken()
- if c == 'n' {
- iter.skipThreeBytes('u', 'l', 'l') // null
- return true
- }
- iter.unreadByte()
- return false
-}
-
-// ReadBool reads a json object as BoolValue
-func (iter *Iterator) ReadBool() (ret bool) {
- c := iter.nextToken()
- if c == 't' {
- iter.skipThreeBytes('r', 'u', 'e')
- return true
- }
- if c == 'f' {
- iter.skipFourBytes('a', 'l', 's', 'e')
- return false
- }
- iter.ReportError("ReadBool", "expect t or f, but found "+string([]byte{c}))
- return
-}
-
-// SkipAndReturnBytes skip next JSON element, and return its content as []byte.
-// The []byte can be kept, it is a copy of data.
-func (iter *Iterator) SkipAndReturnBytes() []byte {
- iter.startCapture(iter.head)
- iter.Skip()
- return iter.stopCapture()
-}
-
-// SkipAndAppendBytes skips next JSON element and appends its content to
-// buffer, returning the result.
-func (iter *Iterator) SkipAndAppendBytes(buf []byte) []byte {
- iter.startCaptureTo(buf, iter.head)
- iter.Skip()
- return iter.stopCapture()
-}
-
-func (iter *Iterator) startCaptureTo(buf []byte, captureStartedAt int) {
- if iter.captured != nil {
- panic("already in capture mode")
- }
- iter.captureStartedAt = captureStartedAt
- iter.captured = buf
-}
-
-func (iter *Iterator) startCapture(captureStartedAt int) {
- iter.startCaptureTo(make([]byte, 0, 32), captureStartedAt)
-}
-
-func (iter *Iterator) stopCapture() []byte {
- if iter.captured == nil {
- panic("not in capture mode")
- }
- captured := iter.captured
- remaining := iter.buf[iter.captureStartedAt:iter.head]
- iter.captureStartedAt = -1
- iter.captured = nil
- return append(captured, remaining...)
-}
-
-// Skip skips a json object and positions to relatively the next json object
-func (iter *Iterator) Skip() {
- c := iter.nextToken()
- switch c {
- case '"':
- iter.skipString()
- case 'n':
- iter.skipThreeBytes('u', 'l', 'l') // null
- case 't':
- iter.skipThreeBytes('r', 'u', 'e') // true
- case 'f':
- iter.skipFourBytes('a', 'l', 's', 'e') // false
- case '0':
- iter.unreadByte()
- iter.ReadFloat32()
- case '-', '1', '2', '3', '4', '5', '6', '7', '8', '9':
- iter.skipNumber()
- case '[':
- iter.skipArray()
- case '{':
- iter.skipObject()
- default:
- iter.ReportError("Skip", fmt.Sprintf("do not know how to skip: %v", c))
- return
- }
-}
-
-func (iter *Iterator) skipFourBytes(b1, b2, b3, b4 byte) {
- if iter.readByte() != b1 {
- iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4})))
- return
- }
- if iter.readByte() != b2 {
- iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4})))
- return
- }
- if iter.readByte() != b3 {
- iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4})))
- return
- }
- if iter.readByte() != b4 {
- iter.ReportError("skipFourBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3, b4})))
- return
- }
-}
-
-func (iter *Iterator) skipThreeBytes(b1, b2, b3 byte) {
- if iter.readByte() != b1 {
- iter.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3})))
- return
- }
- if iter.readByte() != b2 {
- iter.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3})))
- return
- }
- if iter.readByte() != b3 {
- iter.ReportError("skipThreeBytes", fmt.Sprintf("expect %s", string([]byte{b1, b2, b3})))
- return
- }
-}
diff --git a/vendor/github.com/json-iterator/go/iter_skip_sloppy.go b/vendor/github.com/json-iterator/go/iter_skip_sloppy.go
deleted file mode 100644
index 9303de41..00000000
--- a/vendor/github.com/json-iterator/go/iter_skip_sloppy.go
+++ /dev/null
@@ -1,163 +0,0 @@
-//+build jsoniter_sloppy
-
-package jsoniter
-
-// sloppy but faster implementation, do not validate the input json
-
-func (iter *Iterator) skipNumber() {
- for {
- for i := iter.head; i < iter.tail; i++ {
- c := iter.buf[i]
- switch c {
- case ' ', '\n', '\r', '\t', ',', '}', ']':
- iter.head = i
- return
- }
- }
- if !iter.loadMore() {
- return
- }
- }
-}
-
-func (iter *Iterator) skipArray() {
- level := 1
- if !iter.incrementDepth() {
- return
- }
- for {
- for i := iter.head; i < iter.tail; i++ {
- switch iter.buf[i] {
- case '"': // If inside string, skip it
- iter.head = i + 1
- iter.skipString()
- i = iter.head - 1 // it will be i++ soon
- case '[': // If open symbol, increase level
- level++
- if !iter.incrementDepth() {
- return
- }
- case ']': // If close symbol, increase level
- level--
- if !iter.decrementDepth() {
- return
- }
-
- // If we have returned to the original level, we're done
- if level == 0 {
- iter.head = i + 1
- return
- }
- }
- }
- if !iter.loadMore() {
- iter.ReportError("skipObject", "incomplete array")
- return
- }
- }
-}
-
-func (iter *Iterator) skipObject() {
- level := 1
- if !iter.incrementDepth() {
- return
- }
-
- for {
- for i := iter.head; i < iter.tail; i++ {
- switch iter.buf[i] {
- case '"': // If inside string, skip it
- iter.head = i + 1
- iter.skipString()
- i = iter.head - 1 // it will be i++ soon
- case '{': // If open symbol, increase level
- level++
- if !iter.incrementDepth() {
- return
- }
- case '}': // If close symbol, increase level
- level--
- if !iter.decrementDepth() {
- return
- }
-
- // If we have returned to the original level, we're done
- if level == 0 {
- iter.head = i + 1
- return
- }
- }
- }
- if !iter.loadMore() {
- iter.ReportError("skipObject", "incomplete object")
- return
- }
- }
-}
-
-func (iter *Iterator) skipString() {
- for {
- end, escaped := iter.findStringEnd()
- if end == -1 {
- if !iter.loadMore() {
- iter.ReportError("skipString", "incomplete string")
- return
- }
- if escaped {
- iter.head = 1 // skip the first char as last char read is \
- }
- } else {
- iter.head = end
- return
- }
- }
-}
-
-// adapted from: https://github.com/buger/jsonparser/blob/master/parser.go
-// Tries to find the end of string
-// Support if string contains escaped quote symbols.
-func (iter *Iterator) findStringEnd() (int, bool) {
- escaped := false
- for i := iter.head; i < iter.tail; i++ {
- c := iter.buf[i]
- if c == '"' {
- if !escaped {
- return i + 1, false
- }
- j := i - 1
- for {
- if j < iter.head || iter.buf[j] != '\\' {
- // even number of backslashes
- // either end of buffer, or " found
- return i + 1, true
- }
- j--
- if j < iter.head || iter.buf[j] != '\\' {
- // odd number of backslashes
- // it is \" or \\\"
- break
- }
- j--
- }
- } else if c == '\\' {
- escaped = true
- }
- }
- j := iter.tail - 1
- for {
- if j < iter.head || iter.buf[j] != '\\' {
- // even number of backslashes
- // either end of buffer, or " found
- return -1, false // do not end with \
- }
- j--
- if j < iter.head || iter.buf[j] != '\\' {
- // odd number of backslashes
- // it is \" or \\\"
- break
- }
- j--
-
- }
- return -1, true // end with \
-}
diff --git a/vendor/github.com/json-iterator/go/iter_skip_strict.go b/vendor/github.com/json-iterator/go/iter_skip_strict.go
deleted file mode 100644
index 6cf66d04..00000000
--- a/vendor/github.com/json-iterator/go/iter_skip_strict.go
+++ /dev/null
@@ -1,99 +0,0 @@
-//+build !jsoniter_sloppy
-
-package jsoniter
-
-import (
- "fmt"
- "io"
-)
-
-func (iter *Iterator) skipNumber() {
- if !iter.trySkipNumber() {
- iter.unreadByte()
- if iter.Error != nil && iter.Error != io.EOF {
- return
- }
- iter.ReadFloat64()
- if iter.Error != nil && iter.Error != io.EOF {
- iter.Error = nil
- iter.ReadBigFloat()
- }
- }
-}
-
-func (iter *Iterator) trySkipNumber() bool {
- dotFound := false
- for i := iter.head; i < iter.tail; i++ {
- c := iter.buf[i]
- switch c {
- case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
- case '.':
- if dotFound {
- iter.ReportError("validateNumber", `more than one dot found in number`)
- return true // already failed
- }
- if i+1 == iter.tail {
- return false
- }
- c = iter.buf[i+1]
- switch c {
- case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
- default:
- iter.ReportError("validateNumber", `missing digit after dot`)
- return true // already failed
- }
- dotFound = true
- default:
- switch c {
- case ',', ']', '}', ' ', '\t', '\n', '\r':
- if iter.head == i {
- return false // if - without following digits
- }
- iter.head = i
- return true // must be valid
- }
- return false // may be invalid
- }
- }
- return false
-}
-
-func (iter *Iterator) skipString() {
- if !iter.trySkipString() {
- iter.unreadByte()
- iter.ReadString()
- }
-}
-
-func (iter *Iterator) trySkipString() bool {
- for i := iter.head; i < iter.tail; i++ {
- c := iter.buf[i]
- if c == '"' {
- iter.head = i + 1
- return true // valid
- } else if c == '\\' {
- return false
- } else if c < ' ' {
- iter.ReportError("trySkipString",
- fmt.Sprintf(`invalid control character found: %d`, c))
- return true // already failed
- }
- }
- return false
-}
-
-func (iter *Iterator) skipObject() {
- iter.unreadByte()
- iter.ReadObjectCB(func(iter *Iterator, field string) bool {
- iter.Skip()
- return true
- })
-}
-
-func (iter *Iterator) skipArray() {
- iter.unreadByte()
- iter.ReadArrayCB(func(iter *Iterator) bool {
- iter.Skip()
- return true
- })
-}
diff --git a/vendor/github.com/json-iterator/go/iter_str.go b/vendor/github.com/json-iterator/go/iter_str.go
deleted file mode 100644
index adc487ea..00000000
--- a/vendor/github.com/json-iterator/go/iter_str.go
+++ /dev/null
@@ -1,215 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "unicode/utf16"
-)
-
-// ReadString read string from iterator
-func (iter *Iterator) ReadString() (ret string) {
- c := iter.nextToken()
- if c == '"' {
- for i := iter.head; i < iter.tail; i++ {
- c := iter.buf[i]
- if c == '"' {
- ret = string(iter.buf[iter.head:i])
- iter.head = i + 1
- return ret
- } else if c == '\\' {
- break
- } else if c < ' ' {
- iter.ReportError("ReadString",
- fmt.Sprintf(`invalid control character found: %d`, c))
- return
- }
- }
- return iter.readStringSlowPath()
- } else if c == 'n' {
- iter.skipThreeBytes('u', 'l', 'l')
- return ""
- }
- iter.ReportError("ReadString", `expects " or n, but found `+string([]byte{c}))
- return
-}
-
-func (iter *Iterator) readStringSlowPath() (ret string) {
- var str []byte
- var c byte
- for iter.Error == nil {
- c = iter.readByte()
- if c == '"' {
- return string(str)
- }
- if c == '\\' {
- c = iter.readByte()
- str = iter.readEscapedChar(c, str)
- } else {
- str = append(str, c)
- }
- }
- iter.ReportError("readStringSlowPath", "unexpected end of input")
- return
-}
-
-func (iter *Iterator) readEscapedChar(c byte, str []byte) []byte {
- switch c {
- case 'u':
- r := iter.readU4()
- if utf16.IsSurrogate(r) {
- c = iter.readByte()
- if iter.Error != nil {
- return nil
- }
- if c != '\\' {
- iter.unreadByte()
- str = appendRune(str, r)
- return str
- }
- c = iter.readByte()
- if iter.Error != nil {
- return nil
- }
- if c != 'u' {
- str = appendRune(str, r)
- return iter.readEscapedChar(c, str)
- }
- r2 := iter.readU4()
- if iter.Error != nil {
- return nil
- }
- combined := utf16.DecodeRune(r, r2)
- if combined == '\uFFFD' {
- str = appendRune(str, r)
- str = appendRune(str, r2)
- } else {
- str = appendRune(str, combined)
- }
- } else {
- str = appendRune(str, r)
- }
- case '"':
- str = append(str, '"')
- case '\\':
- str = append(str, '\\')
- case '/':
- str = append(str, '/')
- case 'b':
- str = append(str, '\b')
- case 'f':
- str = append(str, '\f')
- case 'n':
- str = append(str, '\n')
- case 'r':
- str = append(str, '\r')
- case 't':
- str = append(str, '\t')
- default:
- iter.ReportError("readEscapedChar",
- `invalid escape char after \`)
- return nil
- }
- return str
-}
-
-// ReadStringAsSlice read string from iterator without copying into string form.
-// The []byte can not be kept, as it will change after next iterator call.
-func (iter *Iterator) ReadStringAsSlice() (ret []byte) {
- c := iter.nextToken()
- if c == '"' {
- for i := iter.head; i < iter.tail; i++ {
- // require ascii string and no escape
- // for: field name, base64, number
- if iter.buf[i] == '"' {
- // fast path: reuse the underlying buffer
- ret = iter.buf[iter.head:i]
- iter.head = i + 1
- return ret
- }
- }
- readLen := iter.tail - iter.head
- copied := make([]byte, readLen, readLen*2)
- copy(copied, iter.buf[iter.head:iter.tail])
- iter.head = iter.tail
- for iter.Error == nil {
- c := iter.readByte()
- if c == '"' {
- return copied
- }
- copied = append(copied, c)
- }
- return copied
- }
- iter.ReportError("ReadStringAsSlice", `expects " or n, but found `+string([]byte{c}))
- return
-}
-
-func (iter *Iterator) readU4() (ret rune) {
- for i := 0; i < 4; i++ {
- c := iter.readByte()
- if iter.Error != nil {
- return
- }
- if c >= '0' && c <= '9' {
- ret = ret*16 + rune(c-'0')
- } else if c >= 'a' && c <= 'f' {
- ret = ret*16 + rune(c-'a'+10)
- } else if c >= 'A' && c <= 'F' {
- ret = ret*16 + rune(c-'A'+10)
- } else {
- iter.ReportError("readU4", "expects 0~9 or a~f, but found "+string([]byte{c}))
- return
- }
- }
- return ret
-}
-
-const (
- t1 = 0x00 // 0000 0000
- tx = 0x80 // 1000 0000
- t2 = 0xC0 // 1100 0000
- t3 = 0xE0 // 1110 0000
- t4 = 0xF0 // 1111 0000
- t5 = 0xF8 // 1111 1000
-
- maskx = 0x3F // 0011 1111
- mask2 = 0x1F // 0001 1111
- mask3 = 0x0F // 0000 1111
- mask4 = 0x07 // 0000 0111
-
- rune1Max = 1<<7 - 1
- rune2Max = 1<<11 - 1
- rune3Max = 1<<16 - 1
-
- surrogateMin = 0xD800
- surrogateMax = 0xDFFF
-
- maxRune = '\U0010FFFF' // Maximum valid Unicode code point.
- runeError = '\uFFFD' // the "error" Rune or "Unicode replacement character"
-)
-
-func appendRune(p []byte, r rune) []byte {
- // Negative values are erroneous. Making it unsigned addresses the problem.
- switch i := uint32(r); {
- case i <= rune1Max:
- p = append(p, byte(r))
- return p
- case i <= rune2Max:
- p = append(p, t2|byte(r>>6))
- p = append(p, tx|byte(r)&maskx)
- return p
- case i > maxRune, surrogateMin <= i && i <= surrogateMax:
- r = runeError
- fallthrough
- case i <= rune3Max:
- p = append(p, t3|byte(r>>12))
- p = append(p, tx|byte(r>>6)&maskx)
- p = append(p, tx|byte(r)&maskx)
- return p
- default:
- p = append(p, t4|byte(r>>18))
- p = append(p, tx|byte(r>>12)&maskx)
- p = append(p, tx|byte(r>>6)&maskx)
- p = append(p, tx|byte(r)&maskx)
- return p
- }
-}
diff --git a/vendor/github.com/json-iterator/go/jsoniter.go b/vendor/github.com/json-iterator/go/jsoniter.go
deleted file mode 100644
index c2934f91..00000000
--- a/vendor/github.com/json-iterator/go/jsoniter.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// Package jsoniter implements encoding and decoding of JSON as defined in
-// RFC 4627 and provides interfaces with identical syntax of standard lib encoding/json.
-// Converting from encoding/json to jsoniter is no more than replacing the package with jsoniter
-// and variable type declarations (if any).
-// jsoniter interfaces gives 100% compatibility with code using standard lib.
-//
-// "JSON and Go"
-// (https://golang.org/doc/articles/json_and_go.html)
-// gives a description of how Marshal/Unmarshal operate
-// between arbitrary or predefined json objects and bytes,
-// and it applies to jsoniter.Marshal/Unmarshal as well.
-//
-// Besides, jsoniter.Iterator provides a different set of interfaces
-// iterating given bytes/string/reader
-// and yielding parsed elements one by one.
-// This set of interfaces reads input as required and gives
-// better performance.
-package jsoniter
diff --git a/vendor/github.com/json-iterator/go/pool.go b/vendor/github.com/json-iterator/go/pool.go
deleted file mode 100644
index e2389b56..00000000
--- a/vendor/github.com/json-iterator/go/pool.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package jsoniter
-
-import (
- "io"
-)
-
-// IteratorPool a thread safe pool of iterators with same configuration
-type IteratorPool interface {
- BorrowIterator(data []byte) *Iterator
- ReturnIterator(iter *Iterator)
-}
-
-// StreamPool a thread safe pool of streams with same configuration
-type StreamPool interface {
- BorrowStream(writer io.Writer) *Stream
- ReturnStream(stream *Stream)
-}
-
-func (cfg *frozenConfig) BorrowStream(writer io.Writer) *Stream {
- stream := cfg.streamPool.Get().(*Stream)
- stream.Reset(writer)
- return stream
-}
-
-func (cfg *frozenConfig) ReturnStream(stream *Stream) {
- stream.out = nil
- stream.Error = nil
- stream.Attachment = nil
- cfg.streamPool.Put(stream)
-}
-
-func (cfg *frozenConfig) BorrowIterator(data []byte) *Iterator {
- iter := cfg.iteratorPool.Get().(*Iterator)
- iter.ResetBytes(data)
- return iter
-}
-
-func (cfg *frozenConfig) ReturnIterator(iter *Iterator) {
- iter.Error = nil
- iter.Attachment = nil
- cfg.iteratorPool.Put(iter)
-}
diff --git a/vendor/github.com/json-iterator/go/reflect.go b/vendor/github.com/json-iterator/go/reflect.go
deleted file mode 100644
index 74974ba7..00000000
--- a/vendor/github.com/json-iterator/go/reflect.go
+++ /dev/null
@@ -1,337 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "reflect"
- "unsafe"
-
- "github.com/modern-go/reflect2"
-)
-
-// ValDecoder is an internal type registered to cache as needed.
-// Don't confuse jsoniter.ValDecoder with json.Decoder.
-// For json.Decoder's adapter, refer to jsoniter.AdapterDecoder(todo link).
-//
-// Reflection on type to create decoders, which is then cached
-// Reflection on value is avoided as we can, as the reflect.Value itself will allocate, with following exceptions
-// 1. create instance of new value, for example *int will need a int to be allocated
-// 2. append to slice, if the existing cap is not enough, allocate will be done using Reflect.New
-// 3. assignment to map, both key and value will be reflect.Value
-// For a simple struct binding, it will be reflect.Value free and allocation free
-type ValDecoder interface {
- Decode(ptr unsafe.Pointer, iter *Iterator)
-}
-
-// ValEncoder is an internal type registered to cache as needed.
-// Don't confuse jsoniter.ValEncoder with json.Encoder.
-// For json.Encoder's adapter, refer to jsoniter.AdapterEncoder(todo godoc link).
-type ValEncoder interface {
- IsEmpty(ptr unsafe.Pointer) bool
- Encode(ptr unsafe.Pointer, stream *Stream)
-}
-
-type checkIsEmpty interface {
- IsEmpty(ptr unsafe.Pointer) bool
-}
-
-type ctx struct {
- *frozenConfig
- prefix string
- encoders map[reflect2.Type]ValEncoder
- decoders map[reflect2.Type]ValDecoder
-}
-
-func (b *ctx) caseSensitive() bool {
- if b.frozenConfig == nil {
- // default is case-insensitive
- return false
- }
- return b.frozenConfig.caseSensitive
-}
-
-func (b *ctx) append(prefix string) *ctx {
- return &ctx{
- frozenConfig: b.frozenConfig,
- prefix: b.prefix + " " + prefix,
- encoders: b.encoders,
- decoders: b.decoders,
- }
-}
-
-// ReadVal copy the underlying JSON into go interface, same as json.Unmarshal
-func (iter *Iterator) ReadVal(obj interface{}) {
- depth := iter.depth
- cacheKey := reflect2.RTypeOf(obj)
- decoder := iter.cfg.getDecoderFromCache(cacheKey)
- if decoder == nil {
- typ := reflect2.TypeOf(obj)
- if typ.Kind() != reflect.Ptr {
- iter.ReportError("ReadVal", "can only unmarshal into pointer")
- return
- }
- decoder = iter.cfg.DecoderOf(typ)
- }
- ptr := reflect2.PtrOf(obj)
- if ptr == nil {
- iter.ReportError("ReadVal", "can not read into nil pointer")
- return
- }
- decoder.Decode(ptr, iter)
- if iter.depth != depth {
- iter.ReportError("ReadVal", "unexpected mismatched nesting")
- return
- }
-}
-
-// WriteVal copy the go interface into underlying JSON, same as json.Marshal
-func (stream *Stream) WriteVal(val interface{}) {
- if nil == val {
- stream.WriteNil()
- return
- }
- cacheKey := reflect2.RTypeOf(val)
- encoder := stream.cfg.getEncoderFromCache(cacheKey)
- if encoder == nil {
- typ := reflect2.TypeOf(val)
- encoder = stream.cfg.EncoderOf(typ)
- }
- encoder.Encode(reflect2.PtrOf(val), stream)
-}
-
-func (cfg *frozenConfig) DecoderOf(typ reflect2.Type) ValDecoder {
- cacheKey := typ.RType()
- decoder := cfg.getDecoderFromCache(cacheKey)
- if decoder != nil {
- return decoder
- }
- ctx := &ctx{
- frozenConfig: cfg,
- prefix: "",
- decoders: map[reflect2.Type]ValDecoder{},
- encoders: map[reflect2.Type]ValEncoder{},
- }
- ptrType := typ.(*reflect2.UnsafePtrType)
- decoder = decoderOfType(ctx, ptrType.Elem())
- cfg.addDecoderToCache(cacheKey, decoder)
- return decoder
-}
-
-func decoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder {
- decoder := getTypeDecoderFromExtension(ctx, typ)
- if decoder != nil {
- return decoder
- }
- decoder = createDecoderOfType(ctx, typ)
- for _, extension := range extensions {
- decoder = extension.DecorateDecoder(typ, decoder)
- }
- decoder = ctx.decoderExtension.DecorateDecoder(typ, decoder)
- for _, extension := range ctx.extraExtensions {
- decoder = extension.DecorateDecoder(typ, decoder)
- }
- return decoder
-}
-
-func createDecoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder {
- decoder := ctx.decoders[typ]
- if decoder != nil {
- return decoder
- }
- placeholder := &placeholderDecoder{}
- ctx.decoders[typ] = placeholder
- decoder = _createDecoderOfType(ctx, typ)
- placeholder.decoder = decoder
- return decoder
-}
-
-func _createDecoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder {
- decoder := createDecoderOfJsonRawMessage(ctx, typ)
- if decoder != nil {
- return decoder
- }
- decoder = createDecoderOfJsonNumber(ctx, typ)
- if decoder != nil {
- return decoder
- }
- decoder = createDecoderOfMarshaler(ctx, typ)
- if decoder != nil {
- return decoder
- }
- decoder = createDecoderOfAny(ctx, typ)
- if decoder != nil {
- return decoder
- }
- decoder = createDecoderOfNative(ctx, typ)
- if decoder != nil {
- return decoder
- }
- switch typ.Kind() {
- case reflect.Interface:
- ifaceType, isIFace := typ.(*reflect2.UnsafeIFaceType)
- if isIFace {
- return &ifaceDecoder{valType: ifaceType}
- }
- return &efaceDecoder{}
- case reflect.Struct:
- return decoderOfStruct(ctx, typ)
- case reflect.Array:
- return decoderOfArray(ctx, typ)
- case reflect.Slice:
- return decoderOfSlice(ctx, typ)
- case reflect.Map:
- return decoderOfMap(ctx, typ)
- case reflect.Ptr:
- return decoderOfOptional(ctx, typ)
- default:
- return &lazyErrorDecoder{err: fmt.Errorf("%s%s is unsupported type", ctx.prefix, typ.String())}
- }
-}
-
-func (cfg *frozenConfig) EncoderOf(typ reflect2.Type) ValEncoder {
- cacheKey := typ.RType()
- encoder := cfg.getEncoderFromCache(cacheKey)
- if encoder != nil {
- return encoder
- }
- ctx := &ctx{
- frozenConfig: cfg,
- prefix: "",
- decoders: map[reflect2.Type]ValDecoder{},
- encoders: map[reflect2.Type]ValEncoder{},
- }
- encoder = encoderOfType(ctx, typ)
- if typ.LikePtr() {
- encoder = &onePtrEncoder{encoder}
- }
- cfg.addEncoderToCache(cacheKey, encoder)
- return encoder
-}
-
-type onePtrEncoder struct {
- encoder ValEncoder
-}
-
-func (encoder *onePtrEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.encoder.IsEmpty(unsafe.Pointer(&ptr))
-}
-
-func (encoder *onePtrEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- encoder.encoder.Encode(unsafe.Pointer(&ptr), stream)
-}
-
-func encoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder {
- encoder := getTypeEncoderFromExtension(ctx, typ)
- if encoder != nil {
- return encoder
- }
- encoder = createEncoderOfType(ctx, typ)
- for _, extension := range extensions {
- encoder = extension.DecorateEncoder(typ, encoder)
- }
- encoder = ctx.encoderExtension.DecorateEncoder(typ, encoder)
- for _, extension := range ctx.extraExtensions {
- encoder = extension.DecorateEncoder(typ, encoder)
- }
- return encoder
-}
-
-func createEncoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder {
- encoder := ctx.encoders[typ]
- if encoder != nil {
- return encoder
- }
- placeholder := &placeholderEncoder{}
- ctx.encoders[typ] = placeholder
- encoder = _createEncoderOfType(ctx, typ)
- placeholder.encoder = encoder
- return encoder
-}
-func _createEncoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder {
- encoder := createEncoderOfJsonRawMessage(ctx, typ)
- if encoder != nil {
- return encoder
- }
- encoder = createEncoderOfJsonNumber(ctx, typ)
- if encoder != nil {
- return encoder
- }
- encoder = createEncoderOfMarshaler(ctx, typ)
- if encoder != nil {
- return encoder
- }
- encoder = createEncoderOfAny(ctx, typ)
- if encoder != nil {
- return encoder
- }
- encoder = createEncoderOfNative(ctx, typ)
- if encoder != nil {
- return encoder
- }
- kind := typ.Kind()
- switch kind {
- case reflect.Interface:
- return &dynamicEncoder{typ}
- case reflect.Struct:
- return encoderOfStruct(ctx, typ)
- case reflect.Array:
- return encoderOfArray(ctx, typ)
- case reflect.Slice:
- return encoderOfSlice(ctx, typ)
- case reflect.Map:
- return encoderOfMap(ctx, typ)
- case reflect.Ptr:
- return encoderOfOptional(ctx, typ)
- default:
- return &lazyErrorEncoder{err: fmt.Errorf("%s%s is unsupported type", ctx.prefix, typ.String())}
- }
-}
-
-type lazyErrorDecoder struct {
- err error
-}
-
-func (decoder *lazyErrorDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if iter.WhatIsNext() != NilValue {
- if iter.Error == nil {
- iter.Error = decoder.err
- }
- } else {
- iter.Skip()
- }
-}
-
-type lazyErrorEncoder struct {
- err error
-}
-
-func (encoder *lazyErrorEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- if ptr == nil {
- stream.WriteNil()
- } else if stream.Error == nil {
- stream.Error = encoder.err
- }
-}
-
-func (encoder *lazyErrorEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return false
-}
-
-type placeholderDecoder struct {
- decoder ValDecoder
-}
-
-func (decoder *placeholderDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- decoder.decoder.Decode(ptr, iter)
-}
-
-type placeholderEncoder struct {
- encoder ValEncoder
-}
-
-func (encoder *placeholderEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- encoder.encoder.Encode(ptr, stream)
-}
-
-func (encoder *placeholderEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.encoder.IsEmpty(ptr)
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_array.go b/vendor/github.com/json-iterator/go/reflect_array.go
deleted file mode 100644
index 13a0b7b0..00000000
--- a/vendor/github.com/json-iterator/go/reflect_array.go
+++ /dev/null
@@ -1,104 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "github.com/modern-go/reflect2"
- "io"
- "unsafe"
-)
-
-func decoderOfArray(ctx *ctx, typ reflect2.Type) ValDecoder {
- arrayType := typ.(*reflect2.UnsafeArrayType)
- decoder := decoderOfType(ctx.append("[arrayElem]"), arrayType.Elem())
- return &arrayDecoder{arrayType, decoder}
-}
-
-func encoderOfArray(ctx *ctx, typ reflect2.Type) ValEncoder {
- arrayType := typ.(*reflect2.UnsafeArrayType)
- if arrayType.Len() == 0 {
- return emptyArrayEncoder{}
- }
- encoder := encoderOfType(ctx.append("[arrayElem]"), arrayType.Elem())
- return &arrayEncoder{arrayType, encoder}
-}
-
-type emptyArrayEncoder struct{}
-
-func (encoder emptyArrayEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteEmptyArray()
-}
-
-func (encoder emptyArrayEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return true
-}
-
-type arrayEncoder struct {
- arrayType *reflect2.UnsafeArrayType
- elemEncoder ValEncoder
-}
-
-func (encoder *arrayEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteArrayStart()
- elemPtr := unsafe.Pointer(ptr)
- encoder.elemEncoder.Encode(elemPtr, stream)
- for i := 1; i < encoder.arrayType.Len(); i++ {
- stream.WriteMore()
- elemPtr = encoder.arrayType.UnsafeGetIndex(ptr, i)
- encoder.elemEncoder.Encode(elemPtr, stream)
- }
- stream.WriteArrayEnd()
- if stream.Error != nil && stream.Error != io.EOF {
- stream.Error = fmt.Errorf("%v: %s", encoder.arrayType, stream.Error.Error())
- }
-}
-
-func (encoder *arrayEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return false
-}
-
-type arrayDecoder struct {
- arrayType *reflect2.UnsafeArrayType
- elemDecoder ValDecoder
-}
-
-func (decoder *arrayDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- decoder.doDecode(ptr, iter)
- if iter.Error != nil && iter.Error != io.EOF {
- iter.Error = fmt.Errorf("%v: %s", decoder.arrayType, iter.Error.Error())
- }
-}
-
-func (decoder *arrayDecoder) doDecode(ptr unsafe.Pointer, iter *Iterator) {
- c := iter.nextToken()
- arrayType := decoder.arrayType
- if c == 'n' {
- iter.skipThreeBytes('u', 'l', 'l')
- return
- }
- if c != '[' {
- iter.ReportError("decode array", "expect [ or n, but found "+string([]byte{c}))
- return
- }
- c = iter.nextToken()
- if c == ']' {
- return
- }
- iter.unreadByte()
- elemPtr := arrayType.UnsafeGetIndex(ptr, 0)
- decoder.elemDecoder.Decode(elemPtr, iter)
- length := 1
- for c = iter.nextToken(); c == ','; c = iter.nextToken() {
- if length >= arrayType.Len() {
- iter.Skip()
- continue
- }
- idx := length
- length += 1
- elemPtr = arrayType.UnsafeGetIndex(ptr, idx)
- decoder.elemDecoder.Decode(elemPtr, iter)
- }
- if c != ']' {
- iter.ReportError("decode array", "expect ], but found "+string([]byte{c}))
- return
- }
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_dynamic.go b/vendor/github.com/json-iterator/go/reflect_dynamic.go
deleted file mode 100644
index 8b6bc8b4..00000000
--- a/vendor/github.com/json-iterator/go/reflect_dynamic.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package jsoniter
-
-import (
- "github.com/modern-go/reflect2"
- "reflect"
- "unsafe"
-)
-
-type dynamicEncoder struct {
- valType reflect2.Type
-}
-
-func (encoder *dynamicEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- obj := encoder.valType.UnsafeIndirect(ptr)
- stream.WriteVal(obj)
-}
-
-func (encoder *dynamicEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.valType.UnsafeIndirect(ptr) == nil
-}
-
-type efaceDecoder struct {
-}
-
-func (decoder *efaceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- pObj := (*interface{})(ptr)
- obj := *pObj
- if obj == nil {
- *pObj = iter.Read()
- return
- }
- typ := reflect2.TypeOf(obj)
- if typ.Kind() != reflect.Ptr {
- *pObj = iter.Read()
- return
- }
- ptrType := typ.(*reflect2.UnsafePtrType)
- ptrElemType := ptrType.Elem()
- if iter.WhatIsNext() == NilValue {
- if ptrElemType.Kind() != reflect.Ptr {
- iter.skipFourBytes('n', 'u', 'l', 'l')
- *pObj = nil
- return
- }
- }
- if reflect2.IsNil(obj) {
- obj := ptrElemType.New()
- iter.ReadVal(obj)
- *pObj = obj
- return
- }
- iter.ReadVal(obj)
-}
-
-type ifaceDecoder struct {
- valType *reflect2.UnsafeIFaceType
-}
-
-func (decoder *ifaceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if iter.ReadNil() {
- decoder.valType.UnsafeSet(ptr, decoder.valType.UnsafeNew())
- return
- }
- obj := decoder.valType.UnsafeIndirect(ptr)
- if reflect2.IsNil(obj) {
- iter.ReportError("decode non empty interface", "can not unmarshal into nil")
- return
- }
- iter.ReadVal(obj)
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_extension.go b/vendor/github.com/json-iterator/go/reflect_extension.go
deleted file mode 100644
index 74a97bfe..00000000
--- a/vendor/github.com/json-iterator/go/reflect_extension.go
+++ /dev/null
@@ -1,483 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "github.com/modern-go/reflect2"
- "reflect"
- "sort"
- "strings"
- "unicode"
- "unsafe"
-)
-
-var typeDecoders = map[string]ValDecoder{}
-var fieldDecoders = map[string]ValDecoder{}
-var typeEncoders = map[string]ValEncoder{}
-var fieldEncoders = map[string]ValEncoder{}
-var extensions = []Extension{}
-
-// StructDescriptor describe how should we encode/decode the struct
-type StructDescriptor struct {
- Type reflect2.Type
- Fields []*Binding
-}
-
-// GetField get one field from the descriptor by its name.
-// Can not use map here to keep field orders.
-func (structDescriptor *StructDescriptor) GetField(fieldName string) *Binding {
- for _, binding := range structDescriptor.Fields {
- if binding.Field.Name() == fieldName {
- return binding
- }
- }
- return nil
-}
-
-// Binding describe how should we encode/decode the struct field
-type Binding struct {
- levels []int
- Field reflect2.StructField
- FromNames []string
- ToNames []string
- Encoder ValEncoder
- Decoder ValDecoder
-}
-
-// Extension the one for all SPI. Customize encoding/decoding by specifying alternate encoder/decoder.
-// Can also rename fields by UpdateStructDescriptor.
-type Extension interface {
- UpdateStructDescriptor(structDescriptor *StructDescriptor)
- CreateMapKeyDecoder(typ reflect2.Type) ValDecoder
- CreateMapKeyEncoder(typ reflect2.Type) ValEncoder
- CreateDecoder(typ reflect2.Type) ValDecoder
- CreateEncoder(typ reflect2.Type) ValEncoder
- DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder
- DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder
-}
-
-// DummyExtension embed this type get dummy implementation for all methods of Extension
-type DummyExtension struct {
-}
-
-// UpdateStructDescriptor No-op
-func (extension *DummyExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) {
-}
-
-// CreateMapKeyDecoder No-op
-func (extension *DummyExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder {
- return nil
-}
-
-// CreateMapKeyEncoder No-op
-func (extension *DummyExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder {
- return nil
-}
-
-// CreateDecoder No-op
-func (extension *DummyExtension) CreateDecoder(typ reflect2.Type) ValDecoder {
- return nil
-}
-
-// CreateEncoder No-op
-func (extension *DummyExtension) CreateEncoder(typ reflect2.Type) ValEncoder {
- return nil
-}
-
-// DecorateDecoder No-op
-func (extension *DummyExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder {
- return decoder
-}
-
-// DecorateEncoder No-op
-func (extension *DummyExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder {
- return encoder
-}
-
-type EncoderExtension map[reflect2.Type]ValEncoder
-
-// UpdateStructDescriptor No-op
-func (extension EncoderExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) {
-}
-
-// CreateDecoder No-op
-func (extension EncoderExtension) CreateDecoder(typ reflect2.Type) ValDecoder {
- return nil
-}
-
-// CreateEncoder get encoder from map
-func (extension EncoderExtension) CreateEncoder(typ reflect2.Type) ValEncoder {
- return extension[typ]
-}
-
-// CreateMapKeyDecoder No-op
-func (extension EncoderExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder {
- return nil
-}
-
-// CreateMapKeyEncoder No-op
-func (extension EncoderExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder {
- return nil
-}
-
-// DecorateDecoder No-op
-func (extension EncoderExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder {
- return decoder
-}
-
-// DecorateEncoder No-op
-func (extension EncoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder {
- return encoder
-}
-
-type DecoderExtension map[reflect2.Type]ValDecoder
-
-// UpdateStructDescriptor No-op
-func (extension DecoderExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) {
-}
-
-// CreateMapKeyDecoder No-op
-func (extension DecoderExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder {
- return nil
-}
-
-// CreateMapKeyEncoder No-op
-func (extension DecoderExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder {
- return nil
-}
-
-// CreateDecoder get decoder from map
-func (extension DecoderExtension) CreateDecoder(typ reflect2.Type) ValDecoder {
- return extension[typ]
-}
-
-// CreateEncoder No-op
-func (extension DecoderExtension) CreateEncoder(typ reflect2.Type) ValEncoder {
- return nil
-}
-
-// DecorateDecoder No-op
-func (extension DecoderExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder {
- return decoder
-}
-
-// DecorateEncoder No-op
-func (extension DecoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder {
- return encoder
-}
-
-type funcDecoder struct {
- fun DecoderFunc
-}
-
-func (decoder *funcDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- decoder.fun(ptr, iter)
-}
-
-type funcEncoder struct {
- fun EncoderFunc
- isEmptyFunc func(ptr unsafe.Pointer) bool
-}
-
-func (encoder *funcEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- encoder.fun(ptr, stream)
-}
-
-func (encoder *funcEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- if encoder.isEmptyFunc == nil {
- return false
- }
- return encoder.isEmptyFunc(ptr)
-}
-
-// DecoderFunc the function form of TypeDecoder
-type DecoderFunc func(ptr unsafe.Pointer, iter *Iterator)
-
-// EncoderFunc the function form of TypeEncoder
-type EncoderFunc func(ptr unsafe.Pointer, stream *Stream)
-
-// RegisterTypeDecoderFunc register TypeDecoder for a type with function
-func RegisterTypeDecoderFunc(typ string, fun DecoderFunc) {
- typeDecoders[typ] = &funcDecoder{fun}
-}
-
-// RegisterTypeDecoder register TypeDecoder for a typ
-func RegisterTypeDecoder(typ string, decoder ValDecoder) {
- typeDecoders[typ] = decoder
-}
-
-// RegisterFieldDecoderFunc register TypeDecoder for a struct field with function
-func RegisterFieldDecoderFunc(typ string, field string, fun DecoderFunc) {
- RegisterFieldDecoder(typ, field, &funcDecoder{fun})
-}
-
-// RegisterFieldDecoder register TypeDecoder for a struct field
-func RegisterFieldDecoder(typ string, field string, decoder ValDecoder) {
- fieldDecoders[fmt.Sprintf("%s/%s", typ, field)] = decoder
-}
-
-// RegisterTypeEncoderFunc register TypeEncoder for a type with encode/isEmpty function
-func RegisterTypeEncoderFunc(typ string, fun EncoderFunc, isEmptyFunc func(unsafe.Pointer) bool) {
- typeEncoders[typ] = &funcEncoder{fun, isEmptyFunc}
-}
-
-// RegisterTypeEncoder register TypeEncoder for a type
-func RegisterTypeEncoder(typ string, encoder ValEncoder) {
- typeEncoders[typ] = encoder
-}
-
-// RegisterFieldEncoderFunc register TypeEncoder for a struct field with encode/isEmpty function
-func RegisterFieldEncoderFunc(typ string, field string, fun EncoderFunc, isEmptyFunc func(unsafe.Pointer) bool) {
- RegisterFieldEncoder(typ, field, &funcEncoder{fun, isEmptyFunc})
-}
-
-// RegisterFieldEncoder register TypeEncoder for a struct field
-func RegisterFieldEncoder(typ string, field string, encoder ValEncoder) {
- fieldEncoders[fmt.Sprintf("%s/%s", typ, field)] = encoder
-}
-
-// RegisterExtension register extension
-func RegisterExtension(extension Extension) {
- extensions = append(extensions, extension)
-}
-
-func getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder {
- decoder := _getTypeDecoderFromExtension(ctx, typ)
- if decoder != nil {
- for _, extension := range extensions {
- decoder = extension.DecorateDecoder(typ, decoder)
- }
- decoder = ctx.decoderExtension.DecorateDecoder(typ, decoder)
- for _, extension := range ctx.extraExtensions {
- decoder = extension.DecorateDecoder(typ, decoder)
- }
- }
- return decoder
-}
-func _getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder {
- for _, extension := range extensions {
- decoder := extension.CreateDecoder(typ)
- if decoder != nil {
- return decoder
- }
- }
- decoder := ctx.decoderExtension.CreateDecoder(typ)
- if decoder != nil {
- return decoder
- }
- for _, extension := range ctx.extraExtensions {
- decoder := extension.CreateDecoder(typ)
- if decoder != nil {
- return decoder
- }
- }
- typeName := typ.String()
- decoder = typeDecoders[typeName]
- if decoder != nil {
- return decoder
- }
- if typ.Kind() == reflect.Ptr {
- ptrType := typ.(*reflect2.UnsafePtrType)
- decoder := typeDecoders[ptrType.Elem().String()]
- if decoder != nil {
- return &OptionalDecoder{ptrType.Elem(), decoder}
- }
- }
- return nil
-}
-
-func getTypeEncoderFromExtension(ctx *ctx, typ reflect2.Type) ValEncoder {
- encoder := _getTypeEncoderFromExtension(ctx, typ)
- if encoder != nil {
- for _, extension := range extensions {
- encoder = extension.DecorateEncoder(typ, encoder)
- }
- encoder = ctx.encoderExtension.DecorateEncoder(typ, encoder)
- for _, extension := range ctx.extraExtensions {
- encoder = extension.DecorateEncoder(typ, encoder)
- }
- }
- return encoder
-}
-
-func _getTypeEncoderFromExtension(ctx *ctx, typ reflect2.Type) ValEncoder {
- for _, extension := range extensions {
- encoder := extension.CreateEncoder(typ)
- if encoder != nil {
- return encoder
- }
- }
- encoder := ctx.encoderExtension.CreateEncoder(typ)
- if encoder != nil {
- return encoder
- }
- for _, extension := range ctx.extraExtensions {
- encoder := extension.CreateEncoder(typ)
- if encoder != nil {
- return encoder
- }
- }
- typeName := typ.String()
- encoder = typeEncoders[typeName]
- if encoder != nil {
- return encoder
- }
- if typ.Kind() == reflect.Ptr {
- typePtr := typ.(*reflect2.UnsafePtrType)
- encoder := typeEncoders[typePtr.Elem().String()]
- if encoder != nil {
- return &OptionalEncoder{encoder}
- }
- }
- return nil
-}
-
-func describeStruct(ctx *ctx, typ reflect2.Type) *StructDescriptor {
- structType := typ.(*reflect2.UnsafeStructType)
- embeddedBindings := []*Binding{}
- bindings := []*Binding{}
- for i := 0; i < structType.NumField(); i++ {
- field := structType.Field(i)
- tag, hastag := field.Tag().Lookup(ctx.getTagKey())
- if ctx.onlyTaggedField && !hastag && !field.Anonymous() {
- continue
- }
- if tag == "-" || field.Name() == "_" {
- continue
- }
- tagParts := strings.Split(tag, ",")
- if field.Anonymous() && (tag == "" || tagParts[0] == "") {
- if field.Type().Kind() == reflect.Struct {
- structDescriptor := describeStruct(ctx, field.Type())
- for _, binding := range structDescriptor.Fields {
- binding.levels = append([]int{i}, binding.levels...)
- omitempty := binding.Encoder.(*structFieldEncoder).omitempty
- binding.Encoder = &structFieldEncoder{field, binding.Encoder, omitempty}
- binding.Decoder = &structFieldDecoder{field, binding.Decoder}
- embeddedBindings = append(embeddedBindings, binding)
- }
- continue
- } else if field.Type().Kind() == reflect.Ptr {
- ptrType := field.Type().(*reflect2.UnsafePtrType)
- if ptrType.Elem().Kind() == reflect.Struct {
- structDescriptor := describeStruct(ctx, ptrType.Elem())
- for _, binding := range structDescriptor.Fields {
- binding.levels = append([]int{i}, binding.levels...)
- omitempty := binding.Encoder.(*structFieldEncoder).omitempty
- binding.Encoder = &dereferenceEncoder{binding.Encoder}
- binding.Encoder = &structFieldEncoder{field, binding.Encoder, omitempty}
- binding.Decoder = &dereferenceDecoder{ptrType.Elem(), binding.Decoder}
- binding.Decoder = &structFieldDecoder{field, binding.Decoder}
- embeddedBindings = append(embeddedBindings, binding)
- }
- continue
- }
- }
- }
- fieldNames := calcFieldNames(field.Name(), tagParts[0], tag)
- fieldCacheKey := fmt.Sprintf("%s/%s", typ.String(), field.Name())
- decoder := fieldDecoders[fieldCacheKey]
- if decoder == nil {
- decoder = decoderOfType(ctx.append(field.Name()), field.Type())
- }
- encoder := fieldEncoders[fieldCacheKey]
- if encoder == nil {
- encoder = encoderOfType(ctx.append(field.Name()), field.Type())
- }
- binding := &Binding{
- Field: field,
- FromNames: fieldNames,
- ToNames: fieldNames,
- Decoder: decoder,
- Encoder: encoder,
- }
- binding.levels = []int{i}
- bindings = append(bindings, binding)
- }
- return createStructDescriptor(ctx, typ, bindings, embeddedBindings)
-}
-func createStructDescriptor(ctx *ctx, typ reflect2.Type, bindings []*Binding, embeddedBindings []*Binding) *StructDescriptor {
- structDescriptor := &StructDescriptor{
- Type: typ,
- Fields: bindings,
- }
- for _, extension := range extensions {
- extension.UpdateStructDescriptor(structDescriptor)
- }
- ctx.encoderExtension.UpdateStructDescriptor(structDescriptor)
- ctx.decoderExtension.UpdateStructDescriptor(structDescriptor)
- for _, extension := range ctx.extraExtensions {
- extension.UpdateStructDescriptor(structDescriptor)
- }
- processTags(structDescriptor, ctx.frozenConfig)
- // merge normal & embedded bindings & sort with original order
- allBindings := sortableBindings(append(embeddedBindings, structDescriptor.Fields...))
- sort.Sort(allBindings)
- structDescriptor.Fields = allBindings
- return structDescriptor
-}
-
-type sortableBindings []*Binding
-
-func (bindings sortableBindings) Len() int {
- return len(bindings)
-}
-
-func (bindings sortableBindings) Less(i, j int) bool {
- left := bindings[i].levels
- right := bindings[j].levels
- k := 0
- for {
- if left[k] < right[k] {
- return true
- } else if left[k] > right[k] {
- return false
- }
- k++
- }
-}
-
-func (bindings sortableBindings) Swap(i, j int) {
- bindings[i], bindings[j] = bindings[j], bindings[i]
-}
-
-func processTags(structDescriptor *StructDescriptor, cfg *frozenConfig) {
- for _, binding := range structDescriptor.Fields {
- shouldOmitEmpty := false
- tagParts := strings.Split(binding.Field.Tag().Get(cfg.getTagKey()), ",")
- for _, tagPart := range tagParts[1:] {
- if tagPart == "omitempty" {
- shouldOmitEmpty = true
- } else if tagPart == "string" {
- if binding.Field.Type().Kind() == reflect.String {
- binding.Decoder = &stringModeStringDecoder{binding.Decoder, cfg}
- binding.Encoder = &stringModeStringEncoder{binding.Encoder, cfg}
- } else {
- binding.Decoder = &stringModeNumberDecoder{binding.Decoder}
- binding.Encoder = &stringModeNumberEncoder{binding.Encoder}
- }
- }
- }
- binding.Decoder = &structFieldDecoder{binding.Field, binding.Decoder}
- binding.Encoder = &structFieldEncoder{binding.Field, binding.Encoder, shouldOmitEmpty}
- }
-}
-
-func calcFieldNames(originalFieldName string, tagProvidedFieldName string, wholeTag string) []string {
- // ignore?
- if wholeTag == "-" {
- return []string{}
- }
- // rename?
- var fieldNames []string
- if tagProvidedFieldName == "" {
- fieldNames = []string{originalFieldName}
- } else {
- fieldNames = []string{tagProvidedFieldName}
- }
- // private?
- isNotExported := unicode.IsLower(rune(originalFieldName[0])) || originalFieldName[0] == '_'
- if isNotExported {
- fieldNames = []string{}
- }
- return fieldNames
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_json_number.go b/vendor/github.com/json-iterator/go/reflect_json_number.go
deleted file mode 100644
index 98d45c1e..00000000
--- a/vendor/github.com/json-iterator/go/reflect_json_number.go
+++ /dev/null
@@ -1,112 +0,0 @@
-package jsoniter
-
-import (
- "encoding/json"
- "github.com/modern-go/reflect2"
- "strconv"
- "unsafe"
-)
-
-type Number string
-
-// String returns the literal text of the number.
-func (n Number) String() string { return string(n) }
-
-// Float64 returns the number as a float64.
-func (n Number) Float64() (float64, error) {
- return strconv.ParseFloat(string(n), 64)
-}
-
-// Int64 returns the number as an int64.
-func (n Number) Int64() (int64, error) {
- return strconv.ParseInt(string(n), 10, 64)
-}
-
-func CastJsonNumber(val interface{}) (string, bool) {
- switch typedVal := val.(type) {
- case json.Number:
- return string(typedVal), true
- case Number:
- return string(typedVal), true
- }
- return "", false
-}
-
-var jsonNumberType = reflect2.TypeOfPtr((*json.Number)(nil)).Elem()
-var jsoniterNumberType = reflect2.TypeOfPtr((*Number)(nil)).Elem()
-
-func createDecoderOfJsonNumber(ctx *ctx, typ reflect2.Type) ValDecoder {
- if typ.AssignableTo(jsonNumberType) {
- return &jsonNumberCodec{}
- }
- if typ.AssignableTo(jsoniterNumberType) {
- return &jsoniterNumberCodec{}
- }
- return nil
-}
-
-func createEncoderOfJsonNumber(ctx *ctx, typ reflect2.Type) ValEncoder {
- if typ.AssignableTo(jsonNumberType) {
- return &jsonNumberCodec{}
- }
- if typ.AssignableTo(jsoniterNumberType) {
- return &jsoniterNumberCodec{}
- }
- return nil
-}
-
-type jsonNumberCodec struct {
-}
-
-func (codec *jsonNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- switch iter.WhatIsNext() {
- case StringValue:
- *((*json.Number)(ptr)) = json.Number(iter.ReadString())
- case NilValue:
- iter.skipFourBytes('n', 'u', 'l', 'l')
- *((*json.Number)(ptr)) = ""
- default:
- *((*json.Number)(ptr)) = json.Number([]byte(iter.readNumberAsString()))
- }
-}
-
-func (codec *jsonNumberCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- number := *((*json.Number)(ptr))
- if len(number) == 0 {
- stream.writeByte('0')
- } else {
- stream.WriteRaw(string(number))
- }
-}
-
-func (codec *jsonNumberCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return len(*((*json.Number)(ptr))) == 0
-}
-
-type jsoniterNumberCodec struct {
-}
-
-func (codec *jsoniterNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- switch iter.WhatIsNext() {
- case StringValue:
- *((*Number)(ptr)) = Number(iter.ReadString())
- case NilValue:
- iter.skipFourBytes('n', 'u', 'l', 'l')
- *((*Number)(ptr)) = ""
- default:
- *((*Number)(ptr)) = Number([]byte(iter.readNumberAsString()))
- }
-}
-
-func (codec *jsoniterNumberCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- number := *((*Number)(ptr))
- if len(number) == 0 {
- stream.writeByte('0')
- } else {
- stream.WriteRaw(string(number))
- }
-}
-
-func (codec *jsoniterNumberCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return len(*((*Number)(ptr))) == 0
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_json_raw_message.go b/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
deleted file mode 100644
index f2619936..00000000
--- a/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package jsoniter
-
-import (
- "encoding/json"
- "github.com/modern-go/reflect2"
- "unsafe"
-)
-
-var jsonRawMessageType = reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()
-var jsoniterRawMessageType = reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()
-
-func createEncoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValEncoder {
- if typ == jsonRawMessageType {
- return &jsonRawMessageCodec{}
- }
- if typ == jsoniterRawMessageType {
- return &jsoniterRawMessageCodec{}
- }
- return nil
-}
-
-func createDecoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValDecoder {
- if typ == jsonRawMessageType {
- return &jsonRawMessageCodec{}
- }
- if typ == jsoniterRawMessageType {
- return &jsoniterRawMessageCodec{}
- }
- return nil
-}
-
-type jsonRawMessageCodec struct {
-}
-
-func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- *((*json.RawMessage)(ptr)) = json.RawMessage(iter.SkipAndReturnBytes())
-}
-
-func (codec *jsonRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteRaw(string(*((*json.RawMessage)(ptr))))
-}
-
-func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return len(*((*json.RawMessage)(ptr))) == 0
-}
-
-type jsoniterRawMessageCodec struct {
-}
-
-func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- *((*RawMessage)(ptr)) = RawMessage(iter.SkipAndReturnBytes())
-}
-
-func (codec *jsoniterRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteRaw(string(*((*RawMessage)(ptr))))
-}
-
-func (codec *jsoniterRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return len(*((*RawMessage)(ptr))) == 0
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_map.go b/vendor/github.com/json-iterator/go/reflect_map.go
deleted file mode 100644
index 58296713..00000000
--- a/vendor/github.com/json-iterator/go/reflect_map.go
+++ /dev/null
@@ -1,346 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "github.com/modern-go/reflect2"
- "io"
- "reflect"
- "sort"
- "unsafe"
-)
-
-func decoderOfMap(ctx *ctx, typ reflect2.Type) ValDecoder {
- mapType := typ.(*reflect2.UnsafeMapType)
- keyDecoder := decoderOfMapKey(ctx.append("[mapKey]"), mapType.Key())
- elemDecoder := decoderOfType(ctx.append("[mapElem]"), mapType.Elem())
- return &mapDecoder{
- mapType: mapType,
- keyType: mapType.Key(),
- elemType: mapType.Elem(),
- keyDecoder: keyDecoder,
- elemDecoder: elemDecoder,
- }
-}
-
-func encoderOfMap(ctx *ctx, typ reflect2.Type) ValEncoder {
- mapType := typ.(*reflect2.UnsafeMapType)
- if ctx.sortMapKeys {
- return &sortKeysMapEncoder{
- mapType: mapType,
- keyEncoder: encoderOfMapKey(ctx.append("[mapKey]"), mapType.Key()),
- elemEncoder: encoderOfType(ctx.append("[mapElem]"), mapType.Elem()),
- }
- }
- return &mapEncoder{
- mapType: mapType,
- keyEncoder: encoderOfMapKey(ctx.append("[mapKey]"), mapType.Key()),
- elemEncoder: encoderOfType(ctx.append("[mapElem]"), mapType.Elem()),
- }
-}
-
-func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder {
- decoder := ctx.decoderExtension.CreateMapKeyDecoder(typ)
- if decoder != nil {
- return decoder
- }
- for _, extension := range ctx.extraExtensions {
- decoder := extension.CreateMapKeyDecoder(typ)
- if decoder != nil {
- return decoder
- }
- }
-
- ptrType := reflect2.PtrTo(typ)
- if ptrType.Implements(unmarshalerType) {
- return &referenceDecoder{
- &unmarshalerDecoder{
- valType: ptrType,
- },
- }
- }
- if typ.Implements(unmarshalerType) {
- return &unmarshalerDecoder{
- valType: typ,
- }
- }
- if ptrType.Implements(textUnmarshalerType) {
- return &referenceDecoder{
- &textUnmarshalerDecoder{
- valType: ptrType,
- },
- }
- }
- if typ.Implements(textUnmarshalerType) {
- return &textUnmarshalerDecoder{
- valType: typ,
- }
- }
-
- switch typ.Kind() {
- case reflect.String:
- return decoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String))
- case reflect.Bool,
- reflect.Uint8, reflect.Int8,
- reflect.Uint16, reflect.Int16,
- reflect.Uint32, reflect.Int32,
- reflect.Uint64, reflect.Int64,
- reflect.Uint, reflect.Int,
- reflect.Float32, reflect.Float64,
- reflect.Uintptr:
- typ = reflect2.DefaultTypeOfKind(typ.Kind())
- return &numericMapKeyDecoder{decoderOfType(ctx, typ)}
- default:
- return &lazyErrorDecoder{err: fmt.Errorf("unsupported map key type: %v", typ)}
- }
-}
-
-func encoderOfMapKey(ctx *ctx, typ reflect2.Type) ValEncoder {
- encoder := ctx.encoderExtension.CreateMapKeyEncoder(typ)
- if encoder != nil {
- return encoder
- }
- for _, extension := range ctx.extraExtensions {
- encoder := extension.CreateMapKeyEncoder(typ)
- if encoder != nil {
- return encoder
- }
- }
-
- if typ == textMarshalerType {
- return &directTextMarshalerEncoder{
- stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
- }
- }
- if typ.Implements(textMarshalerType) {
- return &textMarshalerEncoder{
- valType: typ,
- stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
- }
- }
-
- switch typ.Kind() {
- case reflect.String:
- return encoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String))
- case reflect.Bool,
- reflect.Uint8, reflect.Int8,
- reflect.Uint16, reflect.Int16,
- reflect.Uint32, reflect.Int32,
- reflect.Uint64, reflect.Int64,
- reflect.Uint, reflect.Int,
- reflect.Float32, reflect.Float64,
- reflect.Uintptr:
- typ = reflect2.DefaultTypeOfKind(typ.Kind())
- return &numericMapKeyEncoder{encoderOfType(ctx, typ)}
- default:
- if typ.Kind() == reflect.Interface {
- return &dynamicMapKeyEncoder{ctx, typ}
- }
- return &lazyErrorEncoder{err: fmt.Errorf("unsupported map key type: %v", typ)}
- }
-}
-
-type mapDecoder struct {
- mapType *reflect2.UnsafeMapType
- keyType reflect2.Type
- elemType reflect2.Type
- keyDecoder ValDecoder
- elemDecoder ValDecoder
-}
-
-func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- mapType := decoder.mapType
- c := iter.nextToken()
- if c == 'n' {
- iter.skipThreeBytes('u', 'l', 'l')
- *(*unsafe.Pointer)(ptr) = nil
- mapType.UnsafeSet(ptr, mapType.UnsafeNew())
- return
- }
- if mapType.UnsafeIsNil(ptr) {
- mapType.UnsafeSet(ptr, mapType.UnsafeMakeMap(0))
- }
- if c != '{' {
- iter.ReportError("ReadMapCB", `expect { or n, but found `+string([]byte{c}))
- return
- }
- c = iter.nextToken()
- if c == '}' {
- return
- }
- iter.unreadByte()
- key := decoder.keyType.UnsafeNew()
- decoder.keyDecoder.Decode(key, iter)
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c}))
- return
- }
- elem := decoder.elemType.UnsafeNew()
- decoder.elemDecoder.Decode(elem, iter)
- decoder.mapType.UnsafeSetIndex(ptr, key, elem)
- for c = iter.nextToken(); c == ','; c = iter.nextToken() {
- key := decoder.keyType.UnsafeNew()
- decoder.keyDecoder.Decode(key, iter)
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c}))
- return
- }
- elem := decoder.elemType.UnsafeNew()
- decoder.elemDecoder.Decode(elem, iter)
- decoder.mapType.UnsafeSetIndex(ptr, key, elem)
- }
- if c != '}' {
- iter.ReportError("ReadMapCB", `expect }, but found `+string([]byte{c}))
- }
-}
-
-type numericMapKeyDecoder struct {
- decoder ValDecoder
-}
-
-func (decoder *numericMapKeyDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- c := iter.nextToken()
- if c != '"' {
- iter.ReportError("ReadMapCB", `expect ", but found `+string([]byte{c}))
- return
- }
- decoder.decoder.Decode(ptr, iter)
- c = iter.nextToken()
- if c != '"' {
- iter.ReportError("ReadMapCB", `expect ", but found `+string([]byte{c}))
- return
- }
-}
-
-type numericMapKeyEncoder struct {
- encoder ValEncoder
-}
-
-func (encoder *numericMapKeyEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.writeByte('"')
- encoder.encoder.Encode(ptr, stream)
- stream.writeByte('"')
-}
-
-func (encoder *numericMapKeyEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return false
-}
-
-type dynamicMapKeyEncoder struct {
- ctx *ctx
- valType reflect2.Type
-}
-
-func (encoder *dynamicMapKeyEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- obj := encoder.valType.UnsafeIndirect(ptr)
- encoderOfMapKey(encoder.ctx, reflect2.TypeOf(obj)).Encode(reflect2.PtrOf(obj), stream)
-}
-
-func (encoder *dynamicMapKeyEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- obj := encoder.valType.UnsafeIndirect(ptr)
- return encoderOfMapKey(encoder.ctx, reflect2.TypeOf(obj)).IsEmpty(reflect2.PtrOf(obj))
-}
-
-type mapEncoder struct {
- mapType *reflect2.UnsafeMapType
- keyEncoder ValEncoder
- elemEncoder ValEncoder
-}
-
-func (encoder *mapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- if *(*unsafe.Pointer)(ptr) == nil {
- stream.WriteNil()
- return
- }
- stream.WriteObjectStart()
- iter := encoder.mapType.UnsafeIterate(ptr)
- for i := 0; iter.HasNext(); i++ {
- if i != 0 {
- stream.WriteMore()
- }
- key, elem := iter.UnsafeNext()
- encoder.keyEncoder.Encode(key, stream)
- if stream.indention > 0 {
- stream.writeTwoBytes(byte(':'), byte(' '))
- } else {
- stream.writeByte(':')
- }
- encoder.elemEncoder.Encode(elem, stream)
- }
- stream.WriteObjectEnd()
-}
-
-func (encoder *mapEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- iter := encoder.mapType.UnsafeIterate(ptr)
- return !iter.HasNext()
-}
-
-type sortKeysMapEncoder struct {
- mapType *reflect2.UnsafeMapType
- keyEncoder ValEncoder
- elemEncoder ValEncoder
-}
-
-func (encoder *sortKeysMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- if *(*unsafe.Pointer)(ptr) == nil {
- stream.WriteNil()
- return
- }
- stream.WriteObjectStart()
- mapIter := encoder.mapType.UnsafeIterate(ptr)
- subStream := stream.cfg.BorrowStream(nil)
- subStream.Attachment = stream.Attachment
- subIter := stream.cfg.BorrowIterator(nil)
- keyValues := encodedKeyValues{}
- for mapIter.HasNext() {
- key, elem := mapIter.UnsafeNext()
- subStreamIndex := subStream.Buffered()
- encoder.keyEncoder.Encode(key, subStream)
- if subStream.Error != nil && subStream.Error != io.EOF && stream.Error == nil {
- stream.Error = subStream.Error
- }
- encodedKey := subStream.Buffer()[subStreamIndex:]
- subIter.ResetBytes(encodedKey)
- decodedKey := subIter.ReadString()
- if stream.indention > 0 {
- subStream.writeTwoBytes(byte(':'), byte(' '))
- } else {
- subStream.writeByte(':')
- }
- encoder.elemEncoder.Encode(elem, subStream)
- keyValues = append(keyValues, encodedKV{
- key: decodedKey,
- keyValue: subStream.Buffer()[subStreamIndex:],
- })
- }
- sort.Sort(keyValues)
- for i, keyValue := range keyValues {
- if i != 0 {
- stream.WriteMore()
- }
- stream.Write(keyValue.keyValue)
- }
- if subStream.Error != nil && stream.Error == nil {
- stream.Error = subStream.Error
- }
- stream.WriteObjectEnd()
- stream.cfg.ReturnStream(subStream)
- stream.cfg.ReturnIterator(subIter)
-}
-
-func (encoder *sortKeysMapEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- iter := encoder.mapType.UnsafeIterate(ptr)
- return !iter.HasNext()
-}
-
-type encodedKeyValues []encodedKV
-
-type encodedKV struct {
- key string
- keyValue []byte
-}
-
-func (sv encodedKeyValues) Len() int { return len(sv) }
-func (sv encodedKeyValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] }
-func (sv encodedKeyValues) Less(i, j int) bool { return sv[i].key < sv[j].key }
diff --git a/vendor/github.com/json-iterator/go/reflect_marshaler.go b/vendor/github.com/json-iterator/go/reflect_marshaler.go
deleted file mode 100644
index 3e21f375..00000000
--- a/vendor/github.com/json-iterator/go/reflect_marshaler.go
+++ /dev/null
@@ -1,225 +0,0 @@
-package jsoniter
-
-import (
- "encoding"
- "encoding/json"
- "unsafe"
-
- "github.com/modern-go/reflect2"
-)
-
-var marshalerType = reflect2.TypeOfPtr((*json.Marshaler)(nil)).Elem()
-var unmarshalerType = reflect2.TypeOfPtr((*json.Unmarshaler)(nil)).Elem()
-var textMarshalerType = reflect2.TypeOfPtr((*encoding.TextMarshaler)(nil)).Elem()
-var textUnmarshalerType = reflect2.TypeOfPtr((*encoding.TextUnmarshaler)(nil)).Elem()
-
-func createDecoderOfMarshaler(ctx *ctx, typ reflect2.Type) ValDecoder {
- ptrType := reflect2.PtrTo(typ)
- if ptrType.Implements(unmarshalerType) {
- return &referenceDecoder{
- &unmarshalerDecoder{ptrType},
- }
- }
- if ptrType.Implements(textUnmarshalerType) {
- return &referenceDecoder{
- &textUnmarshalerDecoder{ptrType},
- }
- }
- return nil
-}
-
-func createEncoderOfMarshaler(ctx *ctx, typ reflect2.Type) ValEncoder {
- if typ == marshalerType {
- checkIsEmpty := createCheckIsEmpty(ctx, typ)
- var encoder ValEncoder = &directMarshalerEncoder{
- checkIsEmpty: checkIsEmpty,
- }
- return encoder
- }
- if typ.Implements(marshalerType) {
- checkIsEmpty := createCheckIsEmpty(ctx, typ)
- var encoder ValEncoder = &marshalerEncoder{
- valType: typ,
- checkIsEmpty: checkIsEmpty,
- }
- return encoder
- }
- ptrType := reflect2.PtrTo(typ)
- if ctx.prefix != "" && ptrType.Implements(marshalerType) {
- checkIsEmpty := createCheckIsEmpty(ctx, ptrType)
- var encoder ValEncoder = &marshalerEncoder{
- valType: ptrType,
- checkIsEmpty: checkIsEmpty,
- }
- return &referenceEncoder{encoder}
- }
- if typ == textMarshalerType {
- checkIsEmpty := createCheckIsEmpty(ctx, typ)
- var encoder ValEncoder = &directTextMarshalerEncoder{
- checkIsEmpty: checkIsEmpty,
- stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
- }
- return encoder
- }
- if typ.Implements(textMarshalerType) {
- checkIsEmpty := createCheckIsEmpty(ctx, typ)
- var encoder ValEncoder = &textMarshalerEncoder{
- valType: typ,
- stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
- checkIsEmpty: checkIsEmpty,
- }
- return encoder
- }
- // if prefix is empty, the type is the root type
- if ctx.prefix != "" && ptrType.Implements(textMarshalerType) {
- checkIsEmpty := createCheckIsEmpty(ctx, ptrType)
- var encoder ValEncoder = &textMarshalerEncoder{
- valType: ptrType,
- stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
- checkIsEmpty: checkIsEmpty,
- }
- return &referenceEncoder{encoder}
- }
- return nil
-}
-
-type marshalerEncoder struct {
- checkIsEmpty checkIsEmpty
- valType reflect2.Type
-}
-
-func (encoder *marshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- obj := encoder.valType.UnsafeIndirect(ptr)
- if encoder.valType.IsNullable() && reflect2.IsNil(obj) {
- stream.WriteNil()
- return
- }
- marshaler := obj.(json.Marshaler)
- bytes, err := marshaler.MarshalJSON()
- if err != nil {
- stream.Error = err
- } else {
- // html escape was already done by jsoniter
- // but the extra '\n' should be trimed
- l := len(bytes)
- if l > 0 && bytes[l-1] == '\n' {
- bytes = bytes[:l-1]
- }
- stream.Write(bytes)
- }
-}
-
-func (encoder *marshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.checkIsEmpty.IsEmpty(ptr)
-}
-
-type directMarshalerEncoder struct {
- checkIsEmpty checkIsEmpty
-}
-
-func (encoder *directMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- marshaler := *(*json.Marshaler)(ptr)
- if marshaler == nil {
- stream.WriteNil()
- return
- }
- bytes, err := marshaler.MarshalJSON()
- if err != nil {
- stream.Error = err
- } else {
- stream.Write(bytes)
- }
-}
-
-func (encoder *directMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.checkIsEmpty.IsEmpty(ptr)
-}
-
-type textMarshalerEncoder struct {
- valType reflect2.Type
- stringEncoder ValEncoder
- checkIsEmpty checkIsEmpty
-}
-
-func (encoder *textMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- obj := encoder.valType.UnsafeIndirect(ptr)
- if encoder.valType.IsNullable() && reflect2.IsNil(obj) {
- stream.WriteNil()
- return
- }
- marshaler := (obj).(encoding.TextMarshaler)
- bytes, err := marshaler.MarshalText()
- if err != nil {
- stream.Error = err
- } else {
- str := string(bytes)
- encoder.stringEncoder.Encode(unsafe.Pointer(&str), stream)
- }
-}
-
-func (encoder *textMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.checkIsEmpty.IsEmpty(ptr)
-}
-
-type directTextMarshalerEncoder struct {
- stringEncoder ValEncoder
- checkIsEmpty checkIsEmpty
-}
-
-func (encoder *directTextMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- marshaler := *(*encoding.TextMarshaler)(ptr)
- if marshaler == nil {
- stream.WriteNil()
- return
- }
- bytes, err := marshaler.MarshalText()
- if err != nil {
- stream.Error = err
- } else {
- str := string(bytes)
- encoder.stringEncoder.Encode(unsafe.Pointer(&str), stream)
- }
-}
-
-func (encoder *directTextMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.checkIsEmpty.IsEmpty(ptr)
-}
-
-type unmarshalerDecoder struct {
- valType reflect2.Type
-}
-
-func (decoder *unmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- valType := decoder.valType
- obj := valType.UnsafeIndirect(ptr)
- unmarshaler := obj.(json.Unmarshaler)
- iter.nextToken()
- iter.unreadByte() // skip spaces
- bytes := iter.SkipAndReturnBytes()
- err := unmarshaler.UnmarshalJSON(bytes)
- if err != nil {
- iter.ReportError("unmarshalerDecoder", err.Error())
- }
-}
-
-type textUnmarshalerDecoder struct {
- valType reflect2.Type
-}
-
-func (decoder *textUnmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- valType := decoder.valType
- obj := valType.UnsafeIndirect(ptr)
- if reflect2.IsNil(obj) {
- ptrType := valType.(*reflect2.UnsafePtrType)
- elemType := ptrType.Elem()
- elem := elemType.UnsafeNew()
- ptrType.UnsafeSet(ptr, unsafe.Pointer(&elem))
- obj = valType.UnsafeIndirect(ptr)
- }
- unmarshaler := (obj).(encoding.TextUnmarshaler)
- str := iter.ReadString()
- err := unmarshaler.UnmarshalText([]byte(str))
- if err != nil {
- iter.ReportError("textUnmarshalerDecoder", err.Error())
- }
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_native.go b/vendor/github.com/json-iterator/go/reflect_native.go
deleted file mode 100644
index f88722d1..00000000
--- a/vendor/github.com/json-iterator/go/reflect_native.go
+++ /dev/null
@@ -1,453 +0,0 @@
-package jsoniter
-
-import (
- "encoding/base64"
- "reflect"
- "strconv"
- "unsafe"
-
- "github.com/modern-go/reflect2"
-)
-
-const ptrSize = 32 << uintptr(^uintptr(0)>>63)
-
-func createEncoderOfNative(ctx *ctx, typ reflect2.Type) ValEncoder {
- if typ.Kind() == reflect.Slice && typ.(reflect2.SliceType).Elem().Kind() == reflect.Uint8 {
- sliceDecoder := decoderOfSlice(ctx, typ)
- return &base64Codec{sliceDecoder: sliceDecoder}
- }
- typeName := typ.String()
- kind := typ.Kind()
- switch kind {
- case reflect.String:
- if typeName != "string" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*string)(nil)).Elem())
- }
- return &stringCodec{}
- case reflect.Int:
- if typeName != "int" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*int)(nil)).Elem())
- }
- if strconv.IntSize == 32 {
- return &int32Codec{}
- }
- return &int64Codec{}
- case reflect.Int8:
- if typeName != "int8" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*int8)(nil)).Elem())
- }
- return &int8Codec{}
- case reflect.Int16:
- if typeName != "int16" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*int16)(nil)).Elem())
- }
- return &int16Codec{}
- case reflect.Int32:
- if typeName != "int32" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*int32)(nil)).Elem())
- }
- return &int32Codec{}
- case reflect.Int64:
- if typeName != "int64" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*int64)(nil)).Elem())
- }
- return &int64Codec{}
- case reflect.Uint:
- if typeName != "uint" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*uint)(nil)).Elem())
- }
- if strconv.IntSize == 32 {
- return &uint32Codec{}
- }
- return &uint64Codec{}
- case reflect.Uint8:
- if typeName != "uint8" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*uint8)(nil)).Elem())
- }
- return &uint8Codec{}
- case reflect.Uint16:
- if typeName != "uint16" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*uint16)(nil)).Elem())
- }
- return &uint16Codec{}
- case reflect.Uint32:
- if typeName != "uint32" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*uint32)(nil)).Elem())
- }
- return &uint32Codec{}
- case reflect.Uintptr:
- if typeName != "uintptr" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*uintptr)(nil)).Elem())
- }
- if ptrSize == 32 {
- return &uint32Codec{}
- }
- return &uint64Codec{}
- case reflect.Uint64:
- if typeName != "uint64" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*uint64)(nil)).Elem())
- }
- return &uint64Codec{}
- case reflect.Float32:
- if typeName != "float32" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*float32)(nil)).Elem())
- }
- return &float32Codec{}
- case reflect.Float64:
- if typeName != "float64" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*float64)(nil)).Elem())
- }
- return &float64Codec{}
- case reflect.Bool:
- if typeName != "bool" {
- return encoderOfType(ctx, reflect2.TypeOfPtr((*bool)(nil)).Elem())
- }
- return &boolCodec{}
- }
- return nil
-}
-
-func createDecoderOfNative(ctx *ctx, typ reflect2.Type) ValDecoder {
- if typ.Kind() == reflect.Slice && typ.(reflect2.SliceType).Elem().Kind() == reflect.Uint8 {
- sliceDecoder := decoderOfSlice(ctx, typ)
- return &base64Codec{sliceDecoder: sliceDecoder}
- }
- typeName := typ.String()
- switch typ.Kind() {
- case reflect.String:
- if typeName != "string" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*string)(nil)).Elem())
- }
- return &stringCodec{}
- case reflect.Int:
- if typeName != "int" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*int)(nil)).Elem())
- }
- if strconv.IntSize == 32 {
- return &int32Codec{}
- }
- return &int64Codec{}
- case reflect.Int8:
- if typeName != "int8" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*int8)(nil)).Elem())
- }
- return &int8Codec{}
- case reflect.Int16:
- if typeName != "int16" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*int16)(nil)).Elem())
- }
- return &int16Codec{}
- case reflect.Int32:
- if typeName != "int32" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*int32)(nil)).Elem())
- }
- return &int32Codec{}
- case reflect.Int64:
- if typeName != "int64" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*int64)(nil)).Elem())
- }
- return &int64Codec{}
- case reflect.Uint:
- if typeName != "uint" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*uint)(nil)).Elem())
- }
- if strconv.IntSize == 32 {
- return &uint32Codec{}
- }
- return &uint64Codec{}
- case reflect.Uint8:
- if typeName != "uint8" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*uint8)(nil)).Elem())
- }
- return &uint8Codec{}
- case reflect.Uint16:
- if typeName != "uint16" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*uint16)(nil)).Elem())
- }
- return &uint16Codec{}
- case reflect.Uint32:
- if typeName != "uint32" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*uint32)(nil)).Elem())
- }
- return &uint32Codec{}
- case reflect.Uintptr:
- if typeName != "uintptr" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*uintptr)(nil)).Elem())
- }
- if ptrSize == 32 {
- return &uint32Codec{}
- }
- return &uint64Codec{}
- case reflect.Uint64:
- if typeName != "uint64" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*uint64)(nil)).Elem())
- }
- return &uint64Codec{}
- case reflect.Float32:
- if typeName != "float32" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*float32)(nil)).Elem())
- }
- return &float32Codec{}
- case reflect.Float64:
- if typeName != "float64" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*float64)(nil)).Elem())
- }
- return &float64Codec{}
- case reflect.Bool:
- if typeName != "bool" {
- return decoderOfType(ctx, reflect2.TypeOfPtr((*bool)(nil)).Elem())
- }
- return &boolCodec{}
- }
- return nil
-}
-
-type stringCodec struct {
-}
-
-func (codec *stringCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- *((*string)(ptr)) = iter.ReadString()
-}
-
-func (codec *stringCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- str := *((*string)(ptr))
- stream.WriteString(str)
-}
-
-func (codec *stringCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*string)(ptr)) == ""
-}
-
-type int8Codec struct {
-}
-
-func (codec *int8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*int8)(ptr)) = iter.ReadInt8()
- }
-}
-
-func (codec *int8Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteInt8(*((*int8)(ptr)))
-}
-
-func (codec *int8Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*int8)(ptr)) == 0
-}
-
-type int16Codec struct {
-}
-
-func (codec *int16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*int16)(ptr)) = iter.ReadInt16()
- }
-}
-
-func (codec *int16Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteInt16(*((*int16)(ptr)))
-}
-
-func (codec *int16Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*int16)(ptr)) == 0
-}
-
-type int32Codec struct {
-}
-
-func (codec *int32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*int32)(ptr)) = iter.ReadInt32()
- }
-}
-
-func (codec *int32Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteInt32(*((*int32)(ptr)))
-}
-
-func (codec *int32Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*int32)(ptr)) == 0
-}
-
-type int64Codec struct {
-}
-
-func (codec *int64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*int64)(ptr)) = iter.ReadInt64()
- }
-}
-
-func (codec *int64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteInt64(*((*int64)(ptr)))
-}
-
-func (codec *int64Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*int64)(ptr)) == 0
-}
-
-type uint8Codec struct {
-}
-
-func (codec *uint8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*uint8)(ptr)) = iter.ReadUint8()
- }
-}
-
-func (codec *uint8Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteUint8(*((*uint8)(ptr)))
-}
-
-func (codec *uint8Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*uint8)(ptr)) == 0
-}
-
-type uint16Codec struct {
-}
-
-func (codec *uint16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*uint16)(ptr)) = iter.ReadUint16()
- }
-}
-
-func (codec *uint16Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteUint16(*((*uint16)(ptr)))
-}
-
-func (codec *uint16Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*uint16)(ptr)) == 0
-}
-
-type uint32Codec struct {
-}
-
-func (codec *uint32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*uint32)(ptr)) = iter.ReadUint32()
- }
-}
-
-func (codec *uint32Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteUint32(*((*uint32)(ptr)))
-}
-
-func (codec *uint32Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*uint32)(ptr)) == 0
-}
-
-type uint64Codec struct {
-}
-
-func (codec *uint64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*uint64)(ptr)) = iter.ReadUint64()
- }
-}
-
-func (codec *uint64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteUint64(*((*uint64)(ptr)))
-}
-
-func (codec *uint64Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*uint64)(ptr)) == 0
-}
-
-type float32Codec struct {
-}
-
-func (codec *float32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*float32)(ptr)) = iter.ReadFloat32()
- }
-}
-
-func (codec *float32Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteFloat32(*((*float32)(ptr)))
-}
-
-func (codec *float32Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*float32)(ptr)) == 0
-}
-
-type float64Codec struct {
-}
-
-func (codec *float64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*float64)(ptr)) = iter.ReadFloat64()
- }
-}
-
-func (codec *float64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteFloat64(*((*float64)(ptr)))
-}
-
-func (codec *float64Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*float64)(ptr)) == 0
-}
-
-type boolCodec struct {
-}
-
-func (codec *boolCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*bool)(ptr)) = iter.ReadBool()
- }
-}
-
-func (codec *boolCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteBool(*((*bool)(ptr)))
-}
-
-func (codec *boolCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return !(*((*bool)(ptr)))
-}
-
-type base64Codec struct {
- sliceType *reflect2.UnsafeSliceType
- sliceDecoder ValDecoder
-}
-
-func (codec *base64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if iter.ReadNil() {
- codec.sliceType.UnsafeSetNil(ptr)
- return
- }
- switch iter.WhatIsNext() {
- case StringValue:
- src := iter.ReadString()
- dst, err := base64.StdEncoding.DecodeString(src)
- if err != nil {
- iter.ReportError("decode base64", err.Error())
- } else {
- codec.sliceType.UnsafeSet(ptr, unsafe.Pointer(&dst))
- }
- case ArrayValue:
- codec.sliceDecoder.Decode(ptr, iter)
- default:
- iter.ReportError("base64Codec", "invalid input")
- }
-}
-
-func (codec *base64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- if codec.sliceType.UnsafeIsNil(ptr) {
- stream.WriteNil()
- return
- }
- src := *((*[]byte)(ptr))
- encoding := base64.StdEncoding
- stream.writeByte('"')
- if len(src) != 0 {
- size := encoding.EncodedLen(len(src))
- buf := make([]byte, size)
- encoding.Encode(buf, src)
- stream.buf = append(stream.buf, buf...)
- }
- stream.writeByte('"')
-}
-
-func (codec *base64Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return len(*((*[]byte)(ptr))) == 0
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_optional.go b/vendor/github.com/json-iterator/go/reflect_optional.go
deleted file mode 100644
index fa71f474..00000000
--- a/vendor/github.com/json-iterator/go/reflect_optional.go
+++ /dev/null
@@ -1,129 +0,0 @@
-package jsoniter
-
-import (
- "github.com/modern-go/reflect2"
- "unsafe"
-)
-
-func decoderOfOptional(ctx *ctx, typ reflect2.Type) ValDecoder {
- ptrType := typ.(*reflect2.UnsafePtrType)
- elemType := ptrType.Elem()
- decoder := decoderOfType(ctx, elemType)
- return &OptionalDecoder{elemType, decoder}
-}
-
-func encoderOfOptional(ctx *ctx, typ reflect2.Type) ValEncoder {
- ptrType := typ.(*reflect2.UnsafePtrType)
- elemType := ptrType.Elem()
- elemEncoder := encoderOfType(ctx, elemType)
- encoder := &OptionalEncoder{elemEncoder}
- return encoder
-}
-
-type OptionalDecoder struct {
- ValueType reflect2.Type
- ValueDecoder ValDecoder
-}
-
-func (decoder *OptionalDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if iter.ReadNil() {
- *((*unsafe.Pointer)(ptr)) = nil
- } else {
- if *((*unsafe.Pointer)(ptr)) == nil {
- //pointer to null, we have to allocate memory to hold the value
- newPtr := decoder.ValueType.UnsafeNew()
- decoder.ValueDecoder.Decode(newPtr, iter)
- *((*unsafe.Pointer)(ptr)) = newPtr
- } else {
- //reuse existing instance
- decoder.ValueDecoder.Decode(*((*unsafe.Pointer)(ptr)), iter)
- }
- }
-}
-
-type dereferenceDecoder struct {
- // only to deference a pointer
- valueType reflect2.Type
- valueDecoder ValDecoder
-}
-
-func (decoder *dereferenceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if *((*unsafe.Pointer)(ptr)) == nil {
- //pointer to null, we have to allocate memory to hold the value
- newPtr := decoder.valueType.UnsafeNew()
- decoder.valueDecoder.Decode(newPtr, iter)
- *((*unsafe.Pointer)(ptr)) = newPtr
- } else {
- //reuse existing instance
- decoder.valueDecoder.Decode(*((*unsafe.Pointer)(ptr)), iter)
- }
-}
-
-type OptionalEncoder struct {
- ValueEncoder ValEncoder
-}
-
-func (encoder *OptionalEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- if *((*unsafe.Pointer)(ptr)) == nil {
- stream.WriteNil()
- } else {
- encoder.ValueEncoder.Encode(*((*unsafe.Pointer)(ptr)), stream)
- }
-}
-
-func (encoder *OptionalEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*unsafe.Pointer)(ptr)) == nil
-}
-
-type dereferenceEncoder struct {
- ValueEncoder ValEncoder
-}
-
-func (encoder *dereferenceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- if *((*unsafe.Pointer)(ptr)) == nil {
- stream.WriteNil()
- } else {
- encoder.ValueEncoder.Encode(*((*unsafe.Pointer)(ptr)), stream)
- }
-}
-
-func (encoder *dereferenceEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- dePtr := *((*unsafe.Pointer)(ptr))
- if dePtr == nil {
- return true
- }
- return encoder.ValueEncoder.IsEmpty(dePtr)
-}
-
-func (encoder *dereferenceEncoder) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool {
- deReferenced := *((*unsafe.Pointer)(ptr))
- if deReferenced == nil {
- return true
- }
- isEmbeddedPtrNil, converted := encoder.ValueEncoder.(IsEmbeddedPtrNil)
- if !converted {
- return false
- }
- fieldPtr := unsafe.Pointer(deReferenced)
- return isEmbeddedPtrNil.IsEmbeddedPtrNil(fieldPtr)
-}
-
-type referenceEncoder struct {
- encoder ValEncoder
-}
-
-func (encoder *referenceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- encoder.encoder.Encode(unsafe.Pointer(&ptr), stream)
-}
-
-func (encoder *referenceEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.encoder.IsEmpty(unsafe.Pointer(&ptr))
-}
-
-type referenceDecoder struct {
- decoder ValDecoder
-}
-
-func (decoder *referenceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- decoder.decoder.Decode(unsafe.Pointer(&ptr), iter)
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_slice.go b/vendor/github.com/json-iterator/go/reflect_slice.go
deleted file mode 100644
index 9441d79d..00000000
--- a/vendor/github.com/json-iterator/go/reflect_slice.go
+++ /dev/null
@@ -1,99 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "github.com/modern-go/reflect2"
- "io"
- "unsafe"
-)
-
-func decoderOfSlice(ctx *ctx, typ reflect2.Type) ValDecoder {
- sliceType := typ.(*reflect2.UnsafeSliceType)
- decoder := decoderOfType(ctx.append("[sliceElem]"), sliceType.Elem())
- return &sliceDecoder{sliceType, decoder}
-}
-
-func encoderOfSlice(ctx *ctx, typ reflect2.Type) ValEncoder {
- sliceType := typ.(*reflect2.UnsafeSliceType)
- encoder := encoderOfType(ctx.append("[sliceElem]"), sliceType.Elem())
- return &sliceEncoder{sliceType, encoder}
-}
-
-type sliceEncoder struct {
- sliceType *reflect2.UnsafeSliceType
- elemEncoder ValEncoder
-}
-
-func (encoder *sliceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- if encoder.sliceType.UnsafeIsNil(ptr) {
- stream.WriteNil()
- return
- }
- length := encoder.sliceType.UnsafeLengthOf(ptr)
- if length == 0 {
- stream.WriteEmptyArray()
- return
- }
- stream.WriteArrayStart()
- encoder.elemEncoder.Encode(encoder.sliceType.UnsafeGetIndex(ptr, 0), stream)
- for i := 1; i < length; i++ {
- stream.WriteMore()
- elemPtr := encoder.sliceType.UnsafeGetIndex(ptr, i)
- encoder.elemEncoder.Encode(elemPtr, stream)
- }
- stream.WriteArrayEnd()
- if stream.Error != nil && stream.Error != io.EOF {
- stream.Error = fmt.Errorf("%v: %s", encoder.sliceType, stream.Error.Error())
- }
-}
-
-func (encoder *sliceEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.sliceType.UnsafeLengthOf(ptr) == 0
-}
-
-type sliceDecoder struct {
- sliceType *reflect2.UnsafeSliceType
- elemDecoder ValDecoder
-}
-
-func (decoder *sliceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- decoder.doDecode(ptr, iter)
- if iter.Error != nil && iter.Error != io.EOF {
- iter.Error = fmt.Errorf("%v: %s", decoder.sliceType, iter.Error.Error())
- }
-}
-
-func (decoder *sliceDecoder) doDecode(ptr unsafe.Pointer, iter *Iterator) {
- c := iter.nextToken()
- sliceType := decoder.sliceType
- if c == 'n' {
- iter.skipThreeBytes('u', 'l', 'l')
- sliceType.UnsafeSetNil(ptr)
- return
- }
- if c != '[' {
- iter.ReportError("decode slice", "expect [ or n, but found "+string([]byte{c}))
- return
- }
- c = iter.nextToken()
- if c == ']' {
- sliceType.UnsafeSet(ptr, sliceType.UnsafeMakeSlice(0, 0))
- return
- }
- iter.unreadByte()
- sliceType.UnsafeGrow(ptr, 1)
- elemPtr := sliceType.UnsafeGetIndex(ptr, 0)
- decoder.elemDecoder.Decode(elemPtr, iter)
- length := 1
- for c = iter.nextToken(); c == ','; c = iter.nextToken() {
- idx := length
- length += 1
- sliceType.UnsafeGrow(ptr, length)
- elemPtr = sliceType.UnsafeGetIndex(ptr, idx)
- decoder.elemDecoder.Decode(elemPtr, iter)
- }
- if c != ']' {
- iter.ReportError("decode slice", "expect ], but found "+string([]byte{c}))
- return
- }
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_struct_decoder.go b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go
deleted file mode 100644
index d7eb0eb5..00000000
--- a/vendor/github.com/json-iterator/go/reflect_struct_decoder.go
+++ /dev/null
@@ -1,1092 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "io"
- "strings"
- "unsafe"
-
- "github.com/modern-go/reflect2"
-)
-
-func decoderOfStruct(ctx *ctx, typ reflect2.Type) ValDecoder {
- bindings := map[string]*Binding{}
- structDescriptor := describeStruct(ctx, typ)
- for _, binding := range structDescriptor.Fields {
- for _, fromName := range binding.FromNames {
- old := bindings[fromName]
- if old == nil {
- bindings[fromName] = binding
- continue
- }
- ignoreOld, ignoreNew := resolveConflictBinding(ctx.frozenConfig, old, binding)
- if ignoreOld {
- delete(bindings, fromName)
- }
- if !ignoreNew {
- bindings[fromName] = binding
- }
- }
- }
- fields := map[string]*structFieldDecoder{}
- for k, binding := range bindings {
- fields[k] = binding.Decoder.(*structFieldDecoder)
- }
-
- if !ctx.caseSensitive() {
- for k, binding := range bindings {
- if _, found := fields[strings.ToLower(k)]; !found {
- fields[strings.ToLower(k)] = binding.Decoder.(*structFieldDecoder)
- }
- }
- }
-
- return createStructDecoder(ctx, typ, fields)
-}
-
-func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structFieldDecoder) ValDecoder {
- if ctx.disallowUnknownFields {
- return &generalStructDecoder{typ: typ, fields: fields, disallowUnknownFields: true}
- }
- knownHash := map[int64]struct{}{
- 0: {},
- }
-
- switch len(fields) {
- case 0:
- return &skipObjectDecoder{typ}
- case 1:
- for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName, ctx.caseSensitive())
- _, known := knownHash[fieldHash]
- if known {
- return &generalStructDecoder{typ, fields, false}
- }
- knownHash[fieldHash] = struct{}{}
- return &oneFieldStructDecoder{typ, fieldHash, fieldDecoder}
- }
- case 2:
- var fieldHash1 int64
- var fieldHash2 int64
- var fieldDecoder1 *structFieldDecoder
- var fieldDecoder2 *structFieldDecoder
- for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName, ctx.caseSensitive())
- _, known := knownHash[fieldHash]
- if known {
- return &generalStructDecoder{typ, fields, false}
- }
- knownHash[fieldHash] = struct{}{}
- if fieldHash1 == 0 {
- fieldHash1 = fieldHash
- fieldDecoder1 = fieldDecoder
- } else {
- fieldHash2 = fieldHash
- fieldDecoder2 = fieldDecoder
- }
- }
- return &twoFieldsStructDecoder{typ, fieldHash1, fieldDecoder1, fieldHash2, fieldDecoder2}
- case 3:
- var fieldName1 int64
- var fieldName2 int64
- var fieldName3 int64
- var fieldDecoder1 *structFieldDecoder
- var fieldDecoder2 *structFieldDecoder
- var fieldDecoder3 *structFieldDecoder
- for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName, ctx.caseSensitive())
- _, known := knownHash[fieldHash]
- if known {
- return &generalStructDecoder{typ, fields, false}
- }
- knownHash[fieldHash] = struct{}{}
- if fieldName1 == 0 {
- fieldName1 = fieldHash
- fieldDecoder1 = fieldDecoder
- } else if fieldName2 == 0 {
- fieldName2 = fieldHash
- fieldDecoder2 = fieldDecoder
- } else {
- fieldName3 = fieldHash
- fieldDecoder3 = fieldDecoder
- }
- }
- return &threeFieldsStructDecoder{typ,
- fieldName1, fieldDecoder1,
- fieldName2, fieldDecoder2,
- fieldName3, fieldDecoder3}
- case 4:
- var fieldName1 int64
- var fieldName2 int64
- var fieldName3 int64
- var fieldName4 int64
- var fieldDecoder1 *structFieldDecoder
- var fieldDecoder2 *structFieldDecoder
- var fieldDecoder3 *structFieldDecoder
- var fieldDecoder4 *structFieldDecoder
- for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName, ctx.caseSensitive())
- _, known := knownHash[fieldHash]
- if known {
- return &generalStructDecoder{typ, fields, false}
- }
- knownHash[fieldHash] = struct{}{}
- if fieldName1 == 0 {
- fieldName1 = fieldHash
- fieldDecoder1 = fieldDecoder
- } else if fieldName2 == 0 {
- fieldName2 = fieldHash
- fieldDecoder2 = fieldDecoder
- } else if fieldName3 == 0 {
- fieldName3 = fieldHash
- fieldDecoder3 = fieldDecoder
- } else {
- fieldName4 = fieldHash
- fieldDecoder4 = fieldDecoder
- }
- }
- return &fourFieldsStructDecoder{typ,
- fieldName1, fieldDecoder1,
- fieldName2, fieldDecoder2,
- fieldName3, fieldDecoder3,
- fieldName4, fieldDecoder4}
- case 5:
- var fieldName1 int64
- var fieldName2 int64
- var fieldName3 int64
- var fieldName4 int64
- var fieldName5 int64
- var fieldDecoder1 *structFieldDecoder
- var fieldDecoder2 *structFieldDecoder
- var fieldDecoder3 *structFieldDecoder
- var fieldDecoder4 *structFieldDecoder
- var fieldDecoder5 *structFieldDecoder
- for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName, ctx.caseSensitive())
- _, known := knownHash[fieldHash]
- if known {
- return &generalStructDecoder{typ, fields, false}
- }
- knownHash[fieldHash] = struct{}{}
- if fieldName1 == 0 {
- fieldName1 = fieldHash
- fieldDecoder1 = fieldDecoder
- } else if fieldName2 == 0 {
- fieldName2 = fieldHash
- fieldDecoder2 = fieldDecoder
- } else if fieldName3 == 0 {
- fieldName3 = fieldHash
- fieldDecoder3 = fieldDecoder
- } else if fieldName4 == 0 {
- fieldName4 = fieldHash
- fieldDecoder4 = fieldDecoder
- } else {
- fieldName5 = fieldHash
- fieldDecoder5 = fieldDecoder
- }
- }
- return &fiveFieldsStructDecoder{typ,
- fieldName1, fieldDecoder1,
- fieldName2, fieldDecoder2,
- fieldName3, fieldDecoder3,
- fieldName4, fieldDecoder4,
- fieldName5, fieldDecoder5}
- case 6:
- var fieldName1 int64
- var fieldName2 int64
- var fieldName3 int64
- var fieldName4 int64
- var fieldName5 int64
- var fieldName6 int64
- var fieldDecoder1 *structFieldDecoder
- var fieldDecoder2 *structFieldDecoder
- var fieldDecoder3 *structFieldDecoder
- var fieldDecoder4 *structFieldDecoder
- var fieldDecoder5 *structFieldDecoder
- var fieldDecoder6 *structFieldDecoder
- for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName, ctx.caseSensitive())
- _, known := knownHash[fieldHash]
- if known {
- return &generalStructDecoder{typ, fields, false}
- }
- knownHash[fieldHash] = struct{}{}
- if fieldName1 == 0 {
- fieldName1 = fieldHash
- fieldDecoder1 = fieldDecoder
- } else if fieldName2 == 0 {
- fieldName2 = fieldHash
- fieldDecoder2 = fieldDecoder
- } else if fieldName3 == 0 {
- fieldName3 = fieldHash
- fieldDecoder3 = fieldDecoder
- } else if fieldName4 == 0 {
- fieldName4 = fieldHash
- fieldDecoder4 = fieldDecoder
- } else if fieldName5 == 0 {
- fieldName5 = fieldHash
- fieldDecoder5 = fieldDecoder
- } else {
- fieldName6 = fieldHash
- fieldDecoder6 = fieldDecoder
- }
- }
- return &sixFieldsStructDecoder{typ,
- fieldName1, fieldDecoder1,
- fieldName2, fieldDecoder2,
- fieldName3, fieldDecoder3,
- fieldName4, fieldDecoder4,
- fieldName5, fieldDecoder5,
- fieldName6, fieldDecoder6}
- case 7:
- var fieldName1 int64
- var fieldName2 int64
- var fieldName3 int64
- var fieldName4 int64
- var fieldName5 int64
- var fieldName6 int64
- var fieldName7 int64
- var fieldDecoder1 *structFieldDecoder
- var fieldDecoder2 *structFieldDecoder
- var fieldDecoder3 *structFieldDecoder
- var fieldDecoder4 *structFieldDecoder
- var fieldDecoder5 *structFieldDecoder
- var fieldDecoder6 *structFieldDecoder
- var fieldDecoder7 *structFieldDecoder
- for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName, ctx.caseSensitive())
- _, known := knownHash[fieldHash]
- if known {
- return &generalStructDecoder{typ, fields, false}
- }
- knownHash[fieldHash] = struct{}{}
- if fieldName1 == 0 {
- fieldName1 = fieldHash
- fieldDecoder1 = fieldDecoder
- } else if fieldName2 == 0 {
- fieldName2 = fieldHash
- fieldDecoder2 = fieldDecoder
- } else if fieldName3 == 0 {
- fieldName3 = fieldHash
- fieldDecoder3 = fieldDecoder
- } else if fieldName4 == 0 {
- fieldName4 = fieldHash
- fieldDecoder4 = fieldDecoder
- } else if fieldName5 == 0 {
- fieldName5 = fieldHash
- fieldDecoder5 = fieldDecoder
- } else if fieldName6 == 0 {
- fieldName6 = fieldHash
- fieldDecoder6 = fieldDecoder
- } else {
- fieldName7 = fieldHash
- fieldDecoder7 = fieldDecoder
- }
- }
- return &sevenFieldsStructDecoder{typ,
- fieldName1, fieldDecoder1,
- fieldName2, fieldDecoder2,
- fieldName3, fieldDecoder3,
- fieldName4, fieldDecoder4,
- fieldName5, fieldDecoder5,
- fieldName6, fieldDecoder6,
- fieldName7, fieldDecoder7}
- case 8:
- var fieldName1 int64
- var fieldName2 int64
- var fieldName3 int64
- var fieldName4 int64
- var fieldName5 int64
- var fieldName6 int64
- var fieldName7 int64
- var fieldName8 int64
- var fieldDecoder1 *structFieldDecoder
- var fieldDecoder2 *structFieldDecoder
- var fieldDecoder3 *structFieldDecoder
- var fieldDecoder4 *structFieldDecoder
- var fieldDecoder5 *structFieldDecoder
- var fieldDecoder6 *structFieldDecoder
- var fieldDecoder7 *structFieldDecoder
- var fieldDecoder8 *structFieldDecoder
- for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName, ctx.caseSensitive())
- _, known := knownHash[fieldHash]
- if known {
- return &generalStructDecoder{typ, fields, false}
- }
- knownHash[fieldHash] = struct{}{}
- if fieldName1 == 0 {
- fieldName1 = fieldHash
- fieldDecoder1 = fieldDecoder
- } else if fieldName2 == 0 {
- fieldName2 = fieldHash
- fieldDecoder2 = fieldDecoder
- } else if fieldName3 == 0 {
- fieldName3 = fieldHash
- fieldDecoder3 = fieldDecoder
- } else if fieldName4 == 0 {
- fieldName4 = fieldHash
- fieldDecoder4 = fieldDecoder
- } else if fieldName5 == 0 {
- fieldName5 = fieldHash
- fieldDecoder5 = fieldDecoder
- } else if fieldName6 == 0 {
- fieldName6 = fieldHash
- fieldDecoder6 = fieldDecoder
- } else if fieldName7 == 0 {
- fieldName7 = fieldHash
- fieldDecoder7 = fieldDecoder
- } else {
- fieldName8 = fieldHash
- fieldDecoder8 = fieldDecoder
- }
- }
- return &eightFieldsStructDecoder{typ,
- fieldName1, fieldDecoder1,
- fieldName2, fieldDecoder2,
- fieldName3, fieldDecoder3,
- fieldName4, fieldDecoder4,
- fieldName5, fieldDecoder5,
- fieldName6, fieldDecoder6,
- fieldName7, fieldDecoder7,
- fieldName8, fieldDecoder8}
- case 9:
- var fieldName1 int64
- var fieldName2 int64
- var fieldName3 int64
- var fieldName4 int64
- var fieldName5 int64
- var fieldName6 int64
- var fieldName7 int64
- var fieldName8 int64
- var fieldName9 int64
- var fieldDecoder1 *structFieldDecoder
- var fieldDecoder2 *structFieldDecoder
- var fieldDecoder3 *structFieldDecoder
- var fieldDecoder4 *structFieldDecoder
- var fieldDecoder5 *structFieldDecoder
- var fieldDecoder6 *structFieldDecoder
- var fieldDecoder7 *structFieldDecoder
- var fieldDecoder8 *structFieldDecoder
- var fieldDecoder9 *structFieldDecoder
- for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName, ctx.caseSensitive())
- _, known := knownHash[fieldHash]
- if known {
- return &generalStructDecoder{typ, fields, false}
- }
- knownHash[fieldHash] = struct{}{}
- if fieldName1 == 0 {
- fieldName1 = fieldHash
- fieldDecoder1 = fieldDecoder
- } else if fieldName2 == 0 {
- fieldName2 = fieldHash
- fieldDecoder2 = fieldDecoder
- } else if fieldName3 == 0 {
- fieldName3 = fieldHash
- fieldDecoder3 = fieldDecoder
- } else if fieldName4 == 0 {
- fieldName4 = fieldHash
- fieldDecoder4 = fieldDecoder
- } else if fieldName5 == 0 {
- fieldName5 = fieldHash
- fieldDecoder5 = fieldDecoder
- } else if fieldName6 == 0 {
- fieldName6 = fieldHash
- fieldDecoder6 = fieldDecoder
- } else if fieldName7 == 0 {
- fieldName7 = fieldHash
- fieldDecoder7 = fieldDecoder
- } else if fieldName8 == 0 {
- fieldName8 = fieldHash
- fieldDecoder8 = fieldDecoder
- } else {
- fieldName9 = fieldHash
- fieldDecoder9 = fieldDecoder
- }
- }
- return &nineFieldsStructDecoder{typ,
- fieldName1, fieldDecoder1,
- fieldName2, fieldDecoder2,
- fieldName3, fieldDecoder3,
- fieldName4, fieldDecoder4,
- fieldName5, fieldDecoder5,
- fieldName6, fieldDecoder6,
- fieldName7, fieldDecoder7,
- fieldName8, fieldDecoder8,
- fieldName9, fieldDecoder9}
- case 10:
- var fieldName1 int64
- var fieldName2 int64
- var fieldName3 int64
- var fieldName4 int64
- var fieldName5 int64
- var fieldName6 int64
- var fieldName7 int64
- var fieldName8 int64
- var fieldName9 int64
- var fieldName10 int64
- var fieldDecoder1 *structFieldDecoder
- var fieldDecoder2 *structFieldDecoder
- var fieldDecoder3 *structFieldDecoder
- var fieldDecoder4 *structFieldDecoder
- var fieldDecoder5 *structFieldDecoder
- var fieldDecoder6 *structFieldDecoder
- var fieldDecoder7 *structFieldDecoder
- var fieldDecoder8 *structFieldDecoder
- var fieldDecoder9 *structFieldDecoder
- var fieldDecoder10 *structFieldDecoder
- for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName, ctx.caseSensitive())
- _, known := knownHash[fieldHash]
- if known {
- return &generalStructDecoder{typ, fields, false}
- }
- knownHash[fieldHash] = struct{}{}
- if fieldName1 == 0 {
- fieldName1 = fieldHash
- fieldDecoder1 = fieldDecoder
- } else if fieldName2 == 0 {
- fieldName2 = fieldHash
- fieldDecoder2 = fieldDecoder
- } else if fieldName3 == 0 {
- fieldName3 = fieldHash
- fieldDecoder3 = fieldDecoder
- } else if fieldName4 == 0 {
- fieldName4 = fieldHash
- fieldDecoder4 = fieldDecoder
- } else if fieldName5 == 0 {
- fieldName5 = fieldHash
- fieldDecoder5 = fieldDecoder
- } else if fieldName6 == 0 {
- fieldName6 = fieldHash
- fieldDecoder6 = fieldDecoder
- } else if fieldName7 == 0 {
- fieldName7 = fieldHash
- fieldDecoder7 = fieldDecoder
- } else if fieldName8 == 0 {
- fieldName8 = fieldHash
- fieldDecoder8 = fieldDecoder
- } else if fieldName9 == 0 {
- fieldName9 = fieldHash
- fieldDecoder9 = fieldDecoder
- } else {
- fieldName10 = fieldHash
- fieldDecoder10 = fieldDecoder
- }
- }
- return &tenFieldsStructDecoder{typ,
- fieldName1, fieldDecoder1,
- fieldName2, fieldDecoder2,
- fieldName3, fieldDecoder3,
- fieldName4, fieldDecoder4,
- fieldName5, fieldDecoder5,
- fieldName6, fieldDecoder6,
- fieldName7, fieldDecoder7,
- fieldName8, fieldDecoder8,
- fieldName9, fieldDecoder9,
- fieldName10, fieldDecoder10}
- }
- return &generalStructDecoder{typ, fields, false}
-}
-
-type generalStructDecoder struct {
- typ reflect2.Type
- fields map[string]*structFieldDecoder
- disallowUnknownFields bool
-}
-
-func (decoder *generalStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- var c byte
- for c = ','; c == ','; c = iter.nextToken() {
- decoder.decodeOneField(ptr, iter)
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- if c != '}' {
- iter.ReportError("struct Decode", `expect }, but found `+string([]byte{c}))
- }
- iter.decrementDepth()
-}
-
-func (decoder *generalStructDecoder) decodeOneField(ptr unsafe.Pointer, iter *Iterator) {
- var field string
- var fieldDecoder *structFieldDecoder
- if iter.cfg.objectFieldMustBeSimpleString {
- fieldBytes := iter.ReadStringAsSlice()
- field = *(*string)(unsafe.Pointer(&fieldBytes))
- fieldDecoder = decoder.fields[field]
- if fieldDecoder == nil && !iter.cfg.caseSensitive {
- fieldDecoder = decoder.fields[strings.ToLower(field)]
- }
- } else {
- field = iter.ReadString()
- fieldDecoder = decoder.fields[field]
- if fieldDecoder == nil && !iter.cfg.caseSensitive {
- fieldDecoder = decoder.fields[strings.ToLower(field)]
- }
- }
- if fieldDecoder == nil {
- if decoder.disallowUnknownFields {
- msg := "found unknown field: " + field
- iter.ReportError("ReadObject", msg)
- }
- c := iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
- iter.Skip()
- return
- }
- c := iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
- fieldDecoder.Decode(ptr, iter)
-}
-
-type skipObjectDecoder struct {
- typ reflect2.Type
-}
-
-func (decoder *skipObjectDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- valueType := iter.WhatIsNext()
- if valueType != ObjectValue && valueType != NilValue {
- iter.ReportError("skipObjectDecoder", "expect object or null")
- return
- }
- iter.Skip()
-}
-
-type oneFieldStructDecoder struct {
- typ reflect2.Type
- fieldHash int64
- fieldDecoder *structFieldDecoder
-}
-
-func (decoder *oneFieldStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- for {
- if iter.readFieldHash() == decoder.fieldHash {
- decoder.fieldDecoder.Decode(ptr, iter)
- } else {
- iter.Skip()
- }
- if iter.isObjectEnd() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- iter.decrementDepth()
-}
-
-type twoFieldsStructDecoder struct {
- typ reflect2.Type
- fieldHash1 int64
- fieldDecoder1 *structFieldDecoder
- fieldHash2 int64
- fieldDecoder2 *structFieldDecoder
-}
-
-func (decoder *twoFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- for {
- switch iter.readFieldHash() {
- case decoder.fieldHash1:
- decoder.fieldDecoder1.Decode(ptr, iter)
- case decoder.fieldHash2:
- decoder.fieldDecoder2.Decode(ptr, iter)
- default:
- iter.Skip()
- }
- if iter.isObjectEnd() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- iter.decrementDepth()
-}
-
-type threeFieldsStructDecoder struct {
- typ reflect2.Type
- fieldHash1 int64
- fieldDecoder1 *structFieldDecoder
- fieldHash2 int64
- fieldDecoder2 *structFieldDecoder
- fieldHash3 int64
- fieldDecoder3 *structFieldDecoder
-}
-
-func (decoder *threeFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- for {
- switch iter.readFieldHash() {
- case decoder.fieldHash1:
- decoder.fieldDecoder1.Decode(ptr, iter)
- case decoder.fieldHash2:
- decoder.fieldDecoder2.Decode(ptr, iter)
- case decoder.fieldHash3:
- decoder.fieldDecoder3.Decode(ptr, iter)
- default:
- iter.Skip()
- }
- if iter.isObjectEnd() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- iter.decrementDepth()
-}
-
-type fourFieldsStructDecoder struct {
- typ reflect2.Type
- fieldHash1 int64
- fieldDecoder1 *structFieldDecoder
- fieldHash2 int64
- fieldDecoder2 *structFieldDecoder
- fieldHash3 int64
- fieldDecoder3 *structFieldDecoder
- fieldHash4 int64
- fieldDecoder4 *structFieldDecoder
-}
-
-func (decoder *fourFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- for {
- switch iter.readFieldHash() {
- case decoder.fieldHash1:
- decoder.fieldDecoder1.Decode(ptr, iter)
- case decoder.fieldHash2:
- decoder.fieldDecoder2.Decode(ptr, iter)
- case decoder.fieldHash3:
- decoder.fieldDecoder3.Decode(ptr, iter)
- case decoder.fieldHash4:
- decoder.fieldDecoder4.Decode(ptr, iter)
- default:
- iter.Skip()
- }
- if iter.isObjectEnd() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- iter.decrementDepth()
-}
-
-type fiveFieldsStructDecoder struct {
- typ reflect2.Type
- fieldHash1 int64
- fieldDecoder1 *structFieldDecoder
- fieldHash2 int64
- fieldDecoder2 *structFieldDecoder
- fieldHash3 int64
- fieldDecoder3 *structFieldDecoder
- fieldHash4 int64
- fieldDecoder4 *structFieldDecoder
- fieldHash5 int64
- fieldDecoder5 *structFieldDecoder
-}
-
-func (decoder *fiveFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- for {
- switch iter.readFieldHash() {
- case decoder.fieldHash1:
- decoder.fieldDecoder1.Decode(ptr, iter)
- case decoder.fieldHash2:
- decoder.fieldDecoder2.Decode(ptr, iter)
- case decoder.fieldHash3:
- decoder.fieldDecoder3.Decode(ptr, iter)
- case decoder.fieldHash4:
- decoder.fieldDecoder4.Decode(ptr, iter)
- case decoder.fieldHash5:
- decoder.fieldDecoder5.Decode(ptr, iter)
- default:
- iter.Skip()
- }
- if iter.isObjectEnd() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- iter.decrementDepth()
-}
-
-type sixFieldsStructDecoder struct {
- typ reflect2.Type
- fieldHash1 int64
- fieldDecoder1 *structFieldDecoder
- fieldHash2 int64
- fieldDecoder2 *structFieldDecoder
- fieldHash3 int64
- fieldDecoder3 *structFieldDecoder
- fieldHash4 int64
- fieldDecoder4 *structFieldDecoder
- fieldHash5 int64
- fieldDecoder5 *structFieldDecoder
- fieldHash6 int64
- fieldDecoder6 *structFieldDecoder
-}
-
-func (decoder *sixFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- for {
- switch iter.readFieldHash() {
- case decoder.fieldHash1:
- decoder.fieldDecoder1.Decode(ptr, iter)
- case decoder.fieldHash2:
- decoder.fieldDecoder2.Decode(ptr, iter)
- case decoder.fieldHash3:
- decoder.fieldDecoder3.Decode(ptr, iter)
- case decoder.fieldHash4:
- decoder.fieldDecoder4.Decode(ptr, iter)
- case decoder.fieldHash5:
- decoder.fieldDecoder5.Decode(ptr, iter)
- case decoder.fieldHash6:
- decoder.fieldDecoder6.Decode(ptr, iter)
- default:
- iter.Skip()
- }
- if iter.isObjectEnd() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- iter.decrementDepth()
-}
-
-type sevenFieldsStructDecoder struct {
- typ reflect2.Type
- fieldHash1 int64
- fieldDecoder1 *structFieldDecoder
- fieldHash2 int64
- fieldDecoder2 *structFieldDecoder
- fieldHash3 int64
- fieldDecoder3 *structFieldDecoder
- fieldHash4 int64
- fieldDecoder4 *structFieldDecoder
- fieldHash5 int64
- fieldDecoder5 *structFieldDecoder
- fieldHash6 int64
- fieldDecoder6 *structFieldDecoder
- fieldHash7 int64
- fieldDecoder7 *structFieldDecoder
-}
-
-func (decoder *sevenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- for {
- switch iter.readFieldHash() {
- case decoder.fieldHash1:
- decoder.fieldDecoder1.Decode(ptr, iter)
- case decoder.fieldHash2:
- decoder.fieldDecoder2.Decode(ptr, iter)
- case decoder.fieldHash3:
- decoder.fieldDecoder3.Decode(ptr, iter)
- case decoder.fieldHash4:
- decoder.fieldDecoder4.Decode(ptr, iter)
- case decoder.fieldHash5:
- decoder.fieldDecoder5.Decode(ptr, iter)
- case decoder.fieldHash6:
- decoder.fieldDecoder6.Decode(ptr, iter)
- case decoder.fieldHash7:
- decoder.fieldDecoder7.Decode(ptr, iter)
- default:
- iter.Skip()
- }
- if iter.isObjectEnd() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- iter.decrementDepth()
-}
-
-type eightFieldsStructDecoder struct {
- typ reflect2.Type
- fieldHash1 int64
- fieldDecoder1 *structFieldDecoder
- fieldHash2 int64
- fieldDecoder2 *structFieldDecoder
- fieldHash3 int64
- fieldDecoder3 *structFieldDecoder
- fieldHash4 int64
- fieldDecoder4 *structFieldDecoder
- fieldHash5 int64
- fieldDecoder5 *structFieldDecoder
- fieldHash6 int64
- fieldDecoder6 *structFieldDecoder
- fieldHash7 int64
- fieldDecoder7 *structFieldDecoder
- fieldHash8 int64
- fieldDecoder8 *structFieldDecoder
-}
-
-func (decoder *eightFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- for {
- switch iter.readFieldHash() {
- case decoder.fieldHash1:
- decoder.fieldDecoder1.Decode(ptr, iter)
- case decoder.fieldHash2:
- decoder.fieldDecoder2.Decode(ptr, iter)
- case decoder.fieldHash3:
- decoder.fieldDecoder3.Decode(ptr, iter)
- case decoder.fieldHash4:
- decoder.fieldDecoder4.Decode(ptr, iter)
- case decoder.fieldHash5:
- decoder.fieldDecoder5.Decode(ptr, iter)
- case decoder.fieldHash6:
- decoder.fieldDecoder6.Decode(ptr, iter)
- case decoder.fieldHash7:
- decoder.fieldDecoder7.Decode(ptr, iter)
- case decoder.fieldHash8:
- decoder.fieldDecoder8.Decode(ptr, iter)
- default:
- iter.Skip()
- }
- if iter.isObjectEnd() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- iter.decrementDepth()
-}
-
-type nineFieldsStructDecoder struct {
- typ reflect2.Type
- fieldHash1 int64
- fieldDecoder1 *structFieldDecoder
- fieldHash2 int64
- fieldDecoder2 *structFieldDecoder
- fieldHash3 int64
- fieldDecoder3 *structFieldDecoder
- fieldHash4 int64
- fieldDecoder4 *structFieldDecoder
- fieldHash5 int64
- fieldDecoder5 *structFieldDecoder
- fieldHash6 int64
- fieldDecoder6 *structFieldDecoder
- fieldHash7 int64
- fieldDecoder7 *structFieldDecoder
- fieldHash8 int64
- fieldDecoder8 *structFieldDecoder
- fieldHash9 int64
- fieldDecoder9 *structFieldDecoder
-}
-
-func (decoder *nineFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- for {
- switch iter.readFieldHash() {
- case decoder.fieldHash1:
- decoder.fieldDecoder1.Decode(ptr, iter)
- case decoder.fieldHash2:
- decoder.fieldDecoder2.Decode(ptr, iter)
- case decoder.fieldHash3:
- decoder.fieldDecoder3.Decode(ptr, iter)
- case decoder.fieldHash4:
- decoder.fieldDecoder4.Decode(ptr, iter)
- case decoder.fieldHash5:
- decoder.fieldDecoder5.Decode(ptr, iter)
- case decoder.fieldHash6:
- decoder.fieldDecoder6.Decode(ptr, iter)
- case decoder.fieldHash7:
- decoder.fieldDecoder7.Decode(ptr, iter)
- case decoder.fieldHash8:
- decoder.fieldDecoder8.Decode(ptr, iter)
- case decoder.fieldHash9:
- decoder.fieldDecoder9.Decode(ptr, iter)
- default:
- iter.Skip()
- }
- if iter.isObjectEnd() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- iter.decrementDepth()
-}
-
-type tenFieldsStructDecoder struct {
- typ reflect2.Type
- fieldHash1 int64
- fieldDecoder1 *structFieldDecoder
- fieldHash2 int64
- fieldDecoder2 *structFieldDecoder
- fieldHash3 int64
- fieldDecoder3 *structFieldDecoder
- fieldHash4 int64
- fieldDecoder4 *structFieldDecoder
- fieldHash5 int64
- fieldDecoder5 *structFieldDecoder
- fieldHash6 int64
- fieldDecoder6 *structFieldDecoder
- fieldHash7 int64
- fieldDecoder7 *structFieldDecoder
- fieldHash8 int64
- fieldDecoder8 *structFieldDecoder
- fieldHash9 int64
- fieldDecoder9 *structFieldDecoder
- fieldHash10 int64
- fieldDecoder10 *structFieldDecoder
-}
-
-func (decoder *tenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.readObjectStart() {
- return
- }
- if !iter.incrementDepth() {
- return
- }
- for {
- switch iter.readFieldHash() {
- case decoder.fieldHash1:
- decoder.fieldDecoder1.Decode(ptr, iter)
- case decoder.fieldHash2:
- decoder.fieldDecoder2.Decode(ptr, iter)
- case decoder.fieldHash3:
- decoder.fieldDecoder3.Decode(ptr, iter)
- case decoder.fieldHash4:
- decoder.fieldDecoder4.Decode(ptr, iter)
- case decoder.fieldHash5:
- decoder.fieldDecoder5.Decode(ptr, iter)
- case decoder.fieldHash6:
- decoder.fieldDecoder6.Decode(ptr, iter)
- case decoder.fieldHash7:
- decoder.fieldDecoder7.Decode(ptr, iter)
- case decoder.fieldHash8:
- decoder.fieldDecoder8.Decode(ptr, iter)
- case decoder.fieldHash9:
- decoder.fieldDecoder9.Decode(ptr, iter)
- case decoder.fieldHash10:
- decoder.fieldDecoder10.Decode(ptr, iter)
- default:
- iter.Skip()
- }
- if iter.isObjectEnd() {
- break
- }
- }
- if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 {
- iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
- }
- iter.decrementDepth()
-}
-
-type structFieldDecoder struct {
- field reflect2.StructField
- fieldDecoder ValDecoder
-}
-
-func (decoder *structFieldDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- fieldPtr := decoder.field.UnsafeGet(ptr)
- decoder.fieldDecoder.Decode(fieldPtr, iter)
- if iter.Error != nil && iter.Error != io.EOF {
- iter.Error = fmt.Errorf("%s: %s", decoder.field.Name(), iter.Error.Error())
- }
-}
-
-type stringModeStringDecoder struct {
- elemDecoder ValDecoder
- cfg *frozenConfig
-}
-
-func (decoder *stringModeStringDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- decoder.elemDecoder.Decode(ptr, iter)
- str := *((*string)(ptr))
- tempIter := decoder.cfg.BorrowIterator([]byte(str))
- defer decoder.cfg.ReturnIterator(tempIter)
- *((*string)(ptr)) = tempIter.ReadString()
-}
-
-type stringModeNumberDecoder struct {
- elemDecoder ValDecoder
-}
-
-func (decoder *stringModeNumberDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- c := iter.nextToken()
- if c != '"' {
- iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c}))
- return
- }
- decoder.elemDecoder.Decode(ptr, iter)
- if iter.Error != nil {
- return
- }
- c = iter.readByte()
- if c != '"' {
- iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c}))
- return
- }
-}
diff --git a/vendor/github.com/json-iterator/go/reflect_struct_encoder.go b/vendor/github.com/json-iterator/go/reflect_struct_encoder.go
deleted file mode 100644
index 152e3ef5..00000000
--- a/vendor/github.com/json-iterator/go/reflect_struct_encoder.go
+++ /dev/null
@@ -1,211 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "github.com/modern-go/reflect2"
- "io"
- "reflect"
- "unsafe"
-)
-
-func encoderOfStruct(ctx *ctx, typ reflect2.Type) ValEncoder {
- type bindingTo struct {
- binding *Binding
- toName string
- ignored bool
- }
- orderedBindings := []*bindingTo{}
- structDescriptor := describeStruct(ctx, typ)
- for _, binding := range structDescriptor.Fields {
- for _, toName := range binding.ToNames {
- new := &bindingTo{
- binding: binding,
- toName: toName,
- }
- for _, old := range orderedBindings {
- if old.toName != toName {
- continue
- }
- old.ignored, new.ignored = resolveConflictBinding(ctx.frozenConfig, old.binding, new.binding)
- }
- orderedBindings = append(orderedBindings, new)
- }
- }
- if len(orderedBindings) == 0 {
- return &emptyStructEncoder{}
- }
- finalOrderedFields := []structFieldTo{}
- for _, bindingTo := range orderedBindings {
- if !bindingTo.ignored {
- finalOrderedFields = append(finalOrderedFields, structFieldTo{
- encoder: bindingTo.binding.Encoder.(*structFieldEncoder),
- toName: bindingTo.toName,
- })
- }
- }
- return &structEncoder{typ, finalOrderedFields}
-}
-
-func createCheckIsEmpty(ctx *ctx, typ reflect2.Type) checkIsEmpty {
- encoder := createEncoderOfNative(ctx, typ)
- if encoder != nil {
- return encoder
- }
- kind := typ.Kind()
- switch kind {
- case reflect.Interface:
- return &dynamicEncoder{typ}
- case reflect.Struct:
- return &structEncoder{typ: typ}
- case reflect.Array:
- return &arrayEncoder{}
- case reflect.Slice:
- return &sliceEncoder{}
- case reflect.Map:
- return encoderOfMap(ctx, typ)
- case reflect.Ptr:
- return &OptionalEncoder{}
- default:
- return &lazyErrorEncoder{err: fmt.Errorf("unsupported type: %v", typ)}
- }
-}
-
-func resolveConflictBinding(cfg *frozenConfig, old, new *Binding) (ignoreOld, ignoreNew bool) {
- newTagged := new.Field.Tag().Get(cfg.getTagKey()) != ""
- oldTagged := old.Field.Tag().Get(cfg.getTagKey()) != ""
- if newTagged {
- if oldTagged {
- if len(old.levels) > len(new.levels) {
- return true, false
- } else if len(new.levels) > len(old.levels) {
- return false, true
- } else {
- return true, true
- }
- } else {
- return true, false
- }
- } else {
- if oldTagged {
- return true, false
- }
- if len(old.levels) > len(new.levels) {
- return true, false
- } else if len(new.levels) > len(old.levels) {
- return false, true
- } else {
- return true, true
- }
- }
-}
-
-type structFieldEncoder struct {
- field reflect2.StructField
- fieldEncoder ValEncoder
- omitempty bool
-}
-
-func (encoder *structFieldEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- fieldPtr := encoder.field.UnsafeGet(ptr)
- encoder.fieldEncoder.Encode(fieldPtr, stream)
- if stream.Error != nil && stream.Error != io.EOF {
- stream.Error = fmt.Errorf("%s: %s", encoder.field.Name(), stream.Error.Error())
- }
-}
-
-func (encoder *structFieldEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- fieldPtr := encoder.field.UnsafeGet(ptr)
- return encoder.fieldEncoder.IsEmpty(fieldPtr)
-}
-
-func (encoder *structFieldEncoder) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool {
- isEmbeddedPtrNil, converted := encoder.fieldEncoder.(IsEmbeddedPtrNil)
- if !converted {
- return false
- }
- fieldPtr := encoder.field.UnsafeGet(ptr)
- return isEmbeddedPtrNil.IsEmbeddedPtrNil(fieldPtr)
-}
-
-type IsEmbeddedPtrNil interface {
- IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
-}
-
-type structEncoder struct {
- typ reflect2.Type
- fields []structFieldTo
-}
-
-type structFieldTo struct {
- encoder *structFieldEncoder
- toName string
-}
-
-func (encoder *structEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteObjectStart()
- isNotFirst := false
- for _, field := range encoder.fields {
- if field.encoder.omitempty && field.encoder.IsEmpty(ptr) {
- continue
- }
- if field.encoder.IsEmbeddedPtrNil(ptr) {
- continue
- }
- if isNotFirst {
- stream.WriteMore()
- }
- stream.WriteObjectField(field.toName)
- field.encoder.Encode(ptr, stream)
- isNotFirst = true
- }
- stream.WriteObjectEnd()
- if stream.Error != nil && stream.Error != io.EOF {
- stream.Error = fmt.Errorf("%v.%s", encoder.typ, stream.Error.Error())
- }
-}
-
-func (encoder *structEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return false
-}
-
-type emptyStructEncoder struct {
-}
-
-func (encoder *emptyStructEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteEmptyObject()
-}
-
-func (encoder *emptyStructEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return false
-}
-
-type stringModeNumberEncoder struct {
- elemEncoder ValEncoder
-}
-
-func (encoder *stringModeNumberEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.writeByte('"')
- encoder.elemEncoder.Encode(ptr, stream)
- stream.writeByte('"')
-}
-
-func (encoder *stringModeNumberEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.elemEncoder.IsEmpty(ptr)
-}
-
-type stringModeStringEncoder struct {
- elemEncoder ValEncoder
- cfg *frozenConfig
-}
-
-func (encoder *stringModeStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- tempStream := encoder.cfg.BorrowStream(nil)
- tempStream.Attachment = stream.Attachment
- defer encoder.cfg.ReturnStream(tempStream)
- encoder.elemEncoder.Encode(ptr, tempStream)
- stream.WriteString(string(tempStream.Buffer()))
-}
-
-func (encoder *stringModeStringEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.elemEncoder.IsEmpty(ptr)
-}
diff --git a/vendor/github.com/json-iterator/go/stream.go b/vendor/github.com/json-iterator/go/stream.go
deleted file mode 100644
index 23d8a3ad..00000000
--- a/vendor/github.com/json-iterator/go/stream.go
+++ /dev/null
@@ -1,210 +0,0 @@
-package jsoniter
-
-import (
- "io"
-)
-
-// stream is a io.Writer like object, with JSON specific write functions.
-// Error is not returned as return value, but stored as Error member on this stream instance.
-type Stream struct {
- cfg *frozenConfig
- out io.Writer
- buf []byte
- Error error
- indention int
- Attachment interface{} // open for customized encoder
-}
-
-// NewStream create new stream instance.
-// cfg can be jsoniter.ConfigDefault.
-// out can be nil if write to internal buffer.
-// bufSize is the initial size for the internal buffer in bytes.
-func NewStream(cfg API, out io.Writer, bufSize int) *Stream {
- return &Stream{
- cfg: cfg.(*frozenConfig),
- out: out,
- buf: make([]byte, 0, bufSize),
- Error: nil,
- indention: 0,
- }
-}
-
-// Pool returns a pool can provide more stream with same configuration
-func (stream *Stream) Pool() StreamPool {
- return stream.cfg
-}
-
-// Reset reuse this stream instance by assign a new writer
-func (stream *Stream) Reset(out io.Writer) {
- stream.out = out
- stream.buf = stream.buf[:0]
-}
-
-// Available returns how many bytes are unused in the buffer.
-func (stream *Stream) Available() int {
- return cap(stream.buf) - len(stream.buf)
-}
-
-// Buffered returns the number of bytes that have been written into the current buffer.
-func (stream *Stream) Buffered() int {
- return len(stream.buf)
-}
-
-// Buffer if writer is nil, use this method to take the result
-func (stream *Stream) Buffer() []byte {
- return stream.buf
-}
-
-// SetBuffer allows to append to the internal buffer directly
-func (stream *Stream) SetBuffer(buf []byte) {
- stream.buf = buf
-}
-
-// Write writes the contents of p into the buffer.
-// It returns the number of bytes written.
-// If nn < len(p), it also returns an error explaining
-// why the write is short.
-func (stream *Stream) Write(p []byte) (nn int, err error) {
- stream.buf = append(stream.buf, p...)
- if stream.out != nil {
- nn, err = stream.out.Write(stream.buf)
- stream.buf = stream.buf[nn:]
- return
- }
- return len(p), nil
-}
-
-// WriteByte writes a single byte.
-func (stream *Stream) writeByte(c byte) {
- stream.buf = append(stream.buf, c)
-}
-
-func (stream *Stream) writeTwoBytes(c1 byte, c2 byte) {
- stream.buf = append(stream.buf, c1, c2)
-}
-
-func (stream *Stream) writeThreeBytes(c1 byte, c2 byte, c3 byte) {
- stream.buf = append(stream.buf, c1, c2, c3)
-}
-
-func (stream *Stream) writeFourBytes(c1 byte, c2 byte, c3 byte, c4 byte) {
- stream.buf = append(stream.buf, c1, c2, c3, c4)
-}
-
-func (stream *Stream) writeFiveBytes(c1 byte, c2 byte, c3 byte, c4 byte, c5 byte) {
- stream.buf = append(stream.buf, c1, c2, c3, c4, c5)
-}
-
-// Flush writes any buffered data to the underlying io.Writer.
-func (stream *Stream) Flush() error {
- if stream.out == nil {
- return nil
- }
- if stream.Error != nil {
- return stream.Error
- }
- _, err := stream.out.Write(stream.buf)
- if err != nil {
- if stream.Error == nil {
- stream.Error = err
- }
- return err
- }
- stream.buf = stream.buf[:0]
- return nil
-}
-
-// WriteRaw write string out without quotes, just like []byte
-func (stream *Stream) WriteRaw(s string) {
- stream.buf = append(stream.buf, s...)
-}
-
-// WriteNil write null to stream
-func (stream *Stream) WriteNil() {
- stream.writeFourBytes('n', 'u', 'l', 'l')
-}
-
-// WriteTrue write true to stream
-func (stream *Stream) WriteTrue() {
- stream.writeFourBytes('t', 'r', 'u', 'e')
-}
-
-// WriteFalse write false to stream
-func (stream *Stream) WriteFalse() {
- stream.writeFiveBytes('f', 'a', 'l', 's', 'e')
-}
-
-// WriteBool write true or false into stream
-func (stream *Stream) WriteBool(val bool) {
- if val {
- stream.WriteTrue()
- } else {
- stream.WriteFalse()
- }
-}
-
-// WriteObjectStart write { with possible indention
-func (stream *Stream) WriteObjectStart() {
- stream.indention += stream.cfg.indentionStep
- stream.writeByte('{')
- stream.writeIndention(0)
-}
-
-// WriteObjectField write "field": with possible indention
-func (stream *Stream) WriteObjectField(field string) {
- stream.WriteString(field)
- if stream.indention > 0 {
- stream.writeTwoBytes(':', ' ')
- } else {
- stream.writeByte(':')
- }
-}
-
-// WriteObjectEnd write } with possible indention
-func (stream *Stream) WriteObjectEnd() {
- stream.writeIndention(stream.cfg.indentionStep)
- stream.indention -= stream.cfg.indentionStep
- stream.writeByte('}')
-}
-
-// WriteEmptyObject write {}
-func (stream *Stream) WriteEmptyObject() {
- stream.writeByte('{')
- stream.writeByte('}')
-}
-
-// WriteMore write , with possible indention
-func (stream *Stream) WriteMore() {
- stream.writeByte(',')
- stream.writeIndention(0)
-}
-
-// WriteArrayStart write [ with possible indention
-func (stream *Stream) WriteArrayStart() {
- stream.indention += stream.cfg.indentionStep
- stream.writeByte('[')
- stream.writeIndention(0)
-}
-
-// WriteEmptyArray write []
-func (stream *Stream) WriteEmptyArray() {
- stream.writeTwoBytes('[', ']')
-}
-
-// WriteArrayEnd write ] with possible indention
-func (stream *Stream) WriteArrayEnd() {
- stream.writeIndention(stream.cfg.indentionStep)
- stream.indention -= stream.cfg.indentionStep
- stream.writeByte(']')
-}
-
-func (stream *Stream) writeIndention(delta int) {
- if stream.indention == 0 {
- return
- }
- stream.writeByte('\n')
- toWrite := stream.indention - delta
- for i := 0; i < toWrite; i++ {
- stream.buf = append(stream.buf, ' ')
- }
-}
diff --git a/vendor/github.com/json-iterator/go/stream_float.go b/vendor/github.com/json-iterator/go/stream_float.go
deleted file mode 100644
index 826aa594..00000000
--- a/vendor/github.com/json-iterator/go/stream_float.go
+++ /dev/null
@@ -1,111 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "math"
- "strconv"
-)
-
-var pow10 []uint64
-
-func init() {
- pow10 = []uint64{1, 10, 100, 1000, 10000, 100000, 1000000}
-}
-
-// WriteFloat32 write float32 to stream
-func (stream *Stream) WriteFloat32(val float32) {
- if math.IsInf(float64(val), 0) || math.IsNaN(float64(val)) {
- stream.Error = fmt.Errorf("unsupported value: %f", val)
- return
- }
- abs := math.Abs(float64(val))
- fmt := byte('f')
- // Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right.
- if abs != 0 {
- if float32(abs) < 1e-6 || float32(abs) >= 1e21 {
- fmt = 'e'
- }
- }
- stream.buf = strconv.AppendFloat(stream.buf, float64(val), fmt, -1, 32)
-}
-
-// WriteFloat32Lossy write float32 to stream with ONLY 6 digits precision although much much faster
-func (stream *Stream) WriteFloat32Lossy(val float32) {
- if math.IsInf(float64(val), 0) || math.IsNaN(float64(val)) {
- stream.Error = fmt.Errorf("unsupported value: %f", val)
- return
- }
- if val < 0 {
- stream.writeByte('-')
- val = -val
- }
- if val > 0x4ffffff {
- stream.WriteFloat32(val)
- return
- }
- precision := 6
- exp := uint64(1000000) // 6
- lval := uint64(float64(val)*float64(exp) + 0.5)
- stream.WriteUint64(lval / exp)
- fval := lval % exp
- if fval == 0 {
- return
- }
- stream.writeByte('.')
- for p := precision - 1; p > 0 && fval < pow10[p]; p-- {
- stream.writeByte('0')
- }
- stream.WriteUint64(fval)
- for stream.buf[len(stream.buf)-1] == '0' {
- stream.buf = stream.buf[:len(stream.buf)-1]
- }
-}
-
-// WriteFloat64 write float64 to stream
-func (stream *Stream) WriteFloat64(val float64) {
- if math.IsInf(val, 0) || math.IsNaN(val) {
- stream.Error = fmt.Errorf("unsupported value: %f", val)
- return
- }
- abs := math.Abs(val)
- fmt := byte('f')
- // Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right.
- if abs != 0 {
- if abs < 1e-6 || abs >= 1e21 {
- fmt = 'e'
- }
- }
- stream.buf = strconv.AppendFloat(stream.buf, float64(val), fmt, -1, 64)
-}
-
-// WriteFloat64Lossy write float64 to stream with ONLY 6 digits precision although much much faster
-func (stream *Stream) WriteFloat64Lossy(val float64) {
- if math.IsInf(val, 0) || math.IsNaN(val) {
- stream.Error = fmt.Errorf("unsupported value: %f", val)
- return
- }
- if val < 0 {
- stream.writeByte('-')
- val = -val
- }
- if val > 0x4ffffff {
- stream.WriteFloat64(val)
- return
- }
- precision := 6
- exp := uint64(1000000) // 6
- lval := uint64(val*float64(exp) + 0.5)
- stream.WriteUint64(lval / exp)
- fval := lval % exp
- if fval == 0 {
- return
- }
- stream.writeByte('.')
- for p := precision - 1; p > 0 && fval < pow10[p]; p-- {
- stream.writeByte('0')
- }
- stream.WriteUint64(fval)
- for stream.buf[len(stream.buf)-1] == '0' {
- stream.buf = stream.buf[:len(stream.buf)-1]
- }
-}
diff --git a/vendor/github.com/json-iterator/go/stream_int.go b/vendor/github.com/json-iterator/go/stream_int.go
deleted file mode 100644
index d1059ee4..00000000
--- a/vendor/github.com/json-iterator/go/stream_int.go
+++ /dev/null
@@ -1,190 +0,0 @@
-package jsoniter
-
-var digits []uint32
-
-func init() {
- digits = make([]uint32, 1000)
- for i := uint32(0); i < 1000; i++ {
- digits[i] = (((i / 100) + '0') << 16) + ((((i / 10) % 10) + '0') << 8) + i%10 + '0'
- if i < 10 {
- digits[i] += 2 << 24
- } else if i < 100 {
- digits[i] += 1 << 24
- }
- }
-}
-
-func writeFirstBuf(space []byte, v uint32) []byte {
- start := v >> 24
- if start == 0 {
- space = append(space, byte(v>>16), byte(v>>8))
- } else if start == 1 {
- space = append(space, byte(v>>8))
- }
- space = append(space, byte(v))
- return space
-}
-
-func writeBuf(buf []byte, v uint32) []byte {
- return append(buf, byte(v>>16), byte(v>>8), byte(v))
-}
-
-// WriteUint8 write uint8 to stream
-func (stream *Stream) WriteUint8(val uint8) {
- stream.buf = writeFirstBuf(stream.buf, digits[val])
-}
-
-// WriteInt8 write int8 to stream
-func (stream *Stream) WriteInt8(nval int8) {
- var val uint8
- if nval < 0 {
- val = uint8(-nval)
- stream.buf = append(stream.buf, '-')
- } else {
- val = uint8(nval)
- }
- stream.buf = writeFirstBuf(stream.buf, digits[val])
-}
-
-// WriteUint16 write uint16 to stream
-func (stream *Stream) WriteUint16(val uint16) {
- q1 := val / 1000
- if q1 == 0 {
- stream.buf = writeFirstBuf(stream.buf, digits[val])
- return
- }
- r1 := val - q1*1000
- stream.buf = writeFirstBuf(stream.buf, digits[q1])
- stream.buf = writeBuf(stream.buf, digits[r1])
- return
-}
-
-// WriteInt16 write int16 to stream
-func (stream *Stream) WriteInt16(nval int16) {
- var val uint16
- if nval < 0 {
- val = uint16(-nval)
- stream.buf = append(stream.buf, '-')
- } else {
- val = uint16(nval)
- }
- stream.WriteUint16(val)
-}
-
-// WriteUint32 write uint32 to stream
-func (stream *Stream) WriteUint32(val uint32) {
- q1 := val / 1000
- if q1 == 0 {
- stream.buf = writeFirstBuf(stream.buf, digits[val])
- return
- }
- r1 := val - q1*1000
- q2 := q1 / 1000
- if q2 == 0 {
- stream.buf = writeFirstBuf(stream.buf, digits[q1])
- stream.buf = writeBuf(stream.buf, digits[r1])
- return
- }
- r2 := q1 - q2*1000
- q3 := q2 / 1000
- if q3 == 0 {
- stream.buf = writeFirstBuf(stream.buf, digits[q2])
- } else {
- r3 := q2 - q3*1000
- stream.buf = append(stream.buf, byte(q3+'0'))
- stream.buf = writeBuf(stream.buf, digits[r3])
- }
- stream.buf = writeBuf(stream.buf, digits[r2])
- stream.buf = writeBuf(stream.buf, digits[r1])
-}
-
-// WriteInt32 write int32 to stream
-func (stream *Stream) WriteInt32(nval int32) {
- var val uint32
- if nval < 0 {
- val = uint32(-nval)
- stream.buf = append(stream.buf, '-')
- } else {
- val = uint32(nval)
- }
- stream.WriteUint32(val)
-}
-
-// WriteUint64 write uint64 to stream
-func (stream *Stream) WriteUint64(val uint64) {
- q1 := val / 1000
- if q1 == 0 {
- stream.buf = writeFirstBuf(stream.buf, digits[val])
- return
- }
- r1 := val - q1*1000
- q2 := q1 / 1000
- if q2 == 0 {
- stream.buf = writeFirstBuf(stream.buf, digits[q1])
- stream.buf = writeBuf(stream.buf, digits[r1])
- return
- }
- r2 := q1 - q2*1000
- q3 := q2 / 1000
- if q3 == 0 {
- stream.buf = writeFirstBuf(stream.buf, digits[q2])
- stream.buf = writeBuf(stream.buf, digits[r2])
- stream.buf = writeBuf(stream.buf, digits[r1])
- return
- }
- r3 := q2 - q3*1000
- q4 := q3 / 1000
- if q4 == 0 {
- stream.buf = writeFirstBuf(stream.buf, digits[q3])
- stream.buf = writeBuf(stream.buf, digits[r3])
- stream.buf = writeBuf(stream.buf, digits[r2])
- stream.buf = writeBuf(stream.buf, digits[r1])
- return
- }
- r4 := q3 - q4*1000
- q5 := q4 / 1000
- if q5 == 0 {
- stream.buf = writeFirstBuf(stream.buf, digits[q4])
- stream.buf = writeBuf(stream.buf, digits[r4])
- stream.buf = writeBuf(stream.buf, digits[r3])
- stream.buf = writeBuf(stream.buf, digits[r2])
- stream.buf = writeBuf(stream.buf, digits[r1])
- return
- }
- r5 := q4 - q5*1000
- q6 := q5 / 1000
- if q6 == 0 {
- stream.buf = writeFirstBuf(stream.buf, digits[q5])
- } else {
- stream.buf = writeFirstBuf(stream.buf, digits[q6])
- r6 := q5 - q6*1000
- stream.buf = writeBuf(stream.buf, digits[r6])
- }
- stream.buf = writeBuf(stream.buf, digits[r5])
- stream.buf = writeBuf(stream.buf, digits[r4])
- stream.buf = writeBuf(stream.buf, digits[r3])
- stream.buf = writeBuf(stream.buf, digits[r2])
- stream.buf = writeBuf(stream.buf, digits[r1])
-}
-
-// WriteInt64 write int64 to stream
-func (stream *Stream) WriteInt64(nval int64) {
- var val uint64
- if nval < 0 {
- val = uint64(-nval)
- stream.buf = append(stream.buf, '-')
- } else {
- val = uint64(nval)
- }
- stream.WriteUint64(val)
-}
-
-// WriteInt write int to stream
-func (stream *Stream) WriteInt(val int) {
- stream.WriteInt64(int64(val))
-}
-
-// WriteUint write uint to stream
-func (stream *Stream) WriteUint(val uint) {
- stream.WriteUint64(uint64(val))
-}
diff --git a/vendor/github.com/json-iterator/go/stream_str.go b/vendor/github.com/json-iterator/go/stream_str.go
deleted file mode 100644
index 54c2ba0b..00000000
--- a/vendor/github.com/json-iterator/go/stream_str.go
+++ /dev/null
@@ -1,372 +0,0 @@
-package jsoniter
-
-import (
- "unicode/utf8"
-)
-
-// htmlSafeSet holds the value true if the ASCII character with the given
-// array position can be safely represented inside a JSON string, embedded
-// inside of HTML " that closes the next token. If
- // non-empty, the subsequent call to Next will return a raw or RCDATA text
- // token: one that treats "" as text instead of an element.
- // rawTag's contents are lower-cased.
- rawTag string
- // textIsRaw is whether the current text token's data is not escaped.
- textIsRaw bool
- // convertNUL is whether NUL bytes in the current token's data should
- // be converted into \ufffd replacement characters.
- convertNUL bool
- // allowCDATA is whether CDATA sections are allowed in the current context.
- allowCDATA bool
-}
-
-// AllowCDATA sets whether or not the tokenizer recognizes as
-// the text "foo". The default value is false, which means to recognize it as
-// a bogus comment "" instead.
-//
-// Strictly speaking, an HTML5 compliant tokenizer should allow CDATA if and
-// only if tokenizing foreign content, such as MathML and SVG. However,
-// tracking foreign-contentness is difficult to do purely in the tokenizer,
-// as opposed to the parser, due to HTML integration points: an element
-// can contain a that is foreign-to-SVG but not foreign-to-
-// HTML. For strict compliance with the HTML5 tokenization algorithm, it is the
-// responsibility of the user of a tokenizer to call AllowCDATA as appropriate.
-// In practice, if using the tokenizer without caring whether MathML or SVG
-// CDATA is text or comments, such as tokenizing HTML to find all the anchor
-// text, it is acceptable to ignore this responsibility.
-func (z *Tokenizer) AllowCDATA(allowCDATA bool) {
- z.allowCDATA = allowCDATA
-}
-
-// NextIsNotRawText instructs the tokenizer that the next token should not be
-// considered as 'raw text'. Some elements, such as script and title elements,
-// normally require the next token after the opening tag to be 'raw text' that
-// has no child elements. For example, tokenizing "ac d "
-// yields a start tag token for "", a text token for "ac d", and
-// an end tag token for " ". There are no distinct start tag or end tag
-// tokens for the "" and " ".
-//
-// This tokenizer implementation will generally look for raw text at the right
-// times. Strictly speaking, an HTML5 compliant tokenizer should not look for
-// raw text if in foreign content: generally needs raw text, but a
-// inside an does not. Another example is that a