Documentation ¶
Index ¶
- Constants
- func Annotation(s string) string
- func StrPtr(s string) *string
- type Catalog
- func (c *Catalog) AddBaseURL(serverName, path string) error
- func (c *Catalog) AddDescriptionToHTTPMethod(d directive.Directive, text string) error
- func (c *Catalog) AddDescriptionToInfo(text string) error
- func (c *Catalog) AddDescriptionToJsonRpcMethod(d directive.Directive, text string) error
- func (c *Catalog) AddDescriptionToTag(name, description string) error
- func (c *Catalog) AddEnum(d *directive.Directive, e *enum.Enum) *jerr.JApiError
- func (c *Catalog) AddHTTPMethod(d directive.Directive) *jerr.JApiError
- func (c *Catalog) AddInfo(d directive.Directive) error
- func (c *Catalog) AddJSight(version string) error
- func (c *Catalog) AddJsonRpcMethod(d directive.Directive) *jerr.JApiError
- func (c *Catalog) AddJsonRpcParams(s *ExchangeJSightSchema, d directive.Directive) error
- func (c *Catalog) AddJsonRpcResult(s *ExchangeJSightSchema, d directive.Directive) error
- func (c *Catalog) AddQueryToCurrentMethod(d directive.Directive, q Query) error
- func (c *Catalog) AddRequest(d directive.Directive) error
- func (c *Catalog) AddRequestBody(s ExchangeSchema, f SerializeFormat, d directive.Directive) error
- func (c *Catalog) AddRequestHeaders(s *ExchangeJSightSchema, d directive.Directive) error
- func (c *Catalog) AddResponse(code, annotation string, d directive.Directive) error
- func (c *Catalog) AddResponseBody(schemaBytes bytes.Bytes, bodyFormat SerializeFormat, ...) *jerr.JApiError
- func (c *Catalog) AddResponseHeaders(s *ExchangeJSightSchema, d directive.Directive) error
- func (c *Catalog) AddServer(name, annotation string) error
- func (c *Catalog) AddTag(name, title string) error
- func (c *Catalog) AddTitle(name string) error
- func (c *Catalog) AddType(d directive.Directive, coreUserTypes *UserSchemas) *jerr.JApiError
- func (c *Catalog) AddVersion(version string) error
- func (c *Catalog) MarshalJSON() ([]byte, error)
- func (*Catalog) Read(coords directive.Coords) bytes.Bytes
- func (c *Catalog) ToJson() ([]byte, error)
- func (c *Catalog) ToJsonIndent() ([]byte, error)
- type ExchangeContent
- func (c *ExchangeContent) IsObjectHaveProperty(k string) bool
- func (c *ExchangeContent) MarshalJSON() (b []byte, err error)
- func (c *ExchangeContent) ObjectProperty(k string) *ExchangeContent
- func (c *ExchangeContent) ToUsedUserTypes(uut *StringSet)
- func (c *ExchangeContent) Unshift(v *ExchangeContent)
- type ExchangeJSightSchema
- func (e *ExchangeJSightSchema) CastToObject() *ExchangeJSightSchema
- func (e *ExchangeJSightSchema) Compile() (err error)
- func (e *ExchangeJSightSchema) Example() ([]byte, error)
- func (e *ExchangeJSightSchema) MarshalJSON() ([]byte, error)
- func (e *ExchangeJSightSchema) Notation() notation.SchemaNotation
- type ExchangePseudoSchema
- type ExchangeRegexSchema
- type ExchangeSchema
- type HTTPInteraction
- type HTTPInteractionID
- type HTTPMethod
- type HTTPRequest
- type HTTPRequestBody
- type HTTPRequestHeaders
- type HTTPResponse
- type HTTPResponseBody
- type HTTPResponseHeaders
- type Info
- type Interaction
- type InteractionID
- type Interactions
- func (m *Interactions) Each(fn eachInteractionsFunc) error
- func (m *Interactions) EachReverse(fn eachInteractionsFunc) error
- func (m *Interactions) EachSafe(fn eachSafeInteractionsFunc)
- func (m *Interactions) Find(fn findInteractionsFunc) (InteractionsItem, bool)
- func (m *Interactions) Get(k InteractionID) (Interaction, bool)
- func (m *Interactions) GetValue(k InteractionID) Interaction
- func (m *Interactions) Has(k InteractionID) bool
- func (m *Interactions) Len() int
- func (m *Interactions) Map(fn mapInteractionsFunc) error
- func (m *Interactions) MarshalJSON() ([]byte, error)
- func (m *Interactions) Set(k InteractionID, v Interaction)
- func (m *Interactions) SetToTop(k InteractionID, v Interaction)
- func (m *Interactions) Update(k InteractionID, fn func(v Interaction) Interaction)
- type InteractionsItem
- type JSchemaObject
- type JsonRpcInteraction
- type JsonRpcInteractionId
- type ObjectBuilder
- type Path
- type PathVariables
- type PathVariablesBuilder
- type Prop
- type Protocol
- type Query
- type Rule
- type RuleTokenType
- type Rules
- type RulesBuilder
- type SerializeFormat
- type Server
- type Servers
- func (m *Servers) Each(fn eachServersFunc) error
- func (m *Servers) EachReverse(fn eachServersFunc) error
- func (m *Servers) EachSafe(fn eachSafeServersFunc)
- func (m *Servers) Find(fn findServersFunc) (ServersItem, bool)
- func (m *Servers) Get(k string) (*Server, bool)
- func (m *Servers) GetValue(k string) *Server
- func (m *Servers) Has(k string) bool
- func (m *Servers) Len() int
- func (m *Servers) Map(fn mapServersFunc) error
- func (m *Servers) MarshalJSON() ([]byte, error)
- func (m *Servers) Set(k string, v *Server)
- func (m *Servers) SetToTop(k string, v *Server)
- func (m *Servers) Update(k string, fn func(v *Server) *Server)
- type ServersItem
- type StringSet
- type Tag
- type TagHTTPInteractionGroup
- type TagInteractionGroup
- type TagJsonRpcInteractionGroup
- type TagName
- type Tags
- func (m *Tags) Each(fn eachTagsFunc) error
- func (m *Tags) EachReverse(fn eachTagsFunc) error
- func (m *Tags) EachSafe(fn eachSafeTagsFunc)
- func (m *Tags) Find(fn findTagsFunc) (TagsItem, bool)
- func (m *Tags) Get(k TagName) (*Tag, bool)
- func (m *Tags) GetValue(k TagName) *Tag
- func (m *Tags) Has(k TagName) bool
- func (m *Tags) Len() int
- func (m *Tags) Map(fn mapTagsFunc) error
- func (m *Tags) MarshalJSON() ([]byte, error)
- func (m *Tags) Set(k TagName, v *Tag)
- func (m *Tags) SetToTop(k TagName, v *Tag)
- func (m *Tags) Update(k TagName, fn func(v *Tag) *Tag)
- type TagsItem
- type UserRule
- type UserRules
- func (m *UserRules) Each(fn eachUserRulesFunc) error
- func (m *UserRules) EachReverse(fn eachUserRulesFunc) error
- func (m *UserRules) EachSafe(fn eachSafeUserRulesFunc)
- func (m *UserRules) Find(fn findUserRulesFunc) (UserRulesItem, bool)
- func (m *UserRules) Get(k string) (*UserRule, bool)
- func (m *UserRules) GetValue(k string) *UserRule
- func (m *UserRules) Has(k string) bool
- func (m *UserRules) Len() int
- func (m *UserRules) Map(fn mapUserRulesFunc) error
- func (m *UserRules) MarshalJSON() ([]byte, error)
- func (m *UserRules) Set(k string, v *UserRule)
- func (m *UserRules) SetToTop(k string, v *UserRule)
- func (m *UserRules) Update(k string, fn func(v *UserRule) *UserRule)
- type UserRulesItem
- type UserSchemas
- func (m *UserSchemas) Each(fn eachUserSchemasFunc) error
- func (m *UserSchemas) EachSafe(fn eachSafeUserSchemasFunc)
- func (m *UserSchemas) Get(k string) (schema.Schema, bool)
- func (m *UserSchemas) GetValue(k string) schema.Schema
- func (m *UserSchemas) Has(k string) bool
- func (m *UserSchemas) Len() int
- func (m *UserSchemas) Map(fn mapUserSchemasFunc) error
- func (m *UserSchemas) MarshalJSON() ([]byte, error)
- func (m *UserSchemas) Set(k string, v schema.Schema)
- func (m *UserSchemas) Update(k string, fn func(v schema.Schema) schema.Schema)
- type UserSchemasItem
- type UserType
- type UserTypes
- func (m *UserTypes) Each(fn eachUserTypesFunc) error
- func (m *UserTypes) EachReverse(fn eachUserTypesFunc) error
- func (m *UserTypes) EachSafe(fn eachSafeUserTypesFunc)
- func (m *UserTypes) Find(fn findUserTypesFunc) (UserTypesItem, bool)
- func (m *UserTypes) Get(k string) (*UserType, bool)
- func (m *UserTypes) GetValue(k string) *UserType
- func (m *UserTypes) Has(k string) bool
- func (m *UserTypes) Len() int
- func (m *UserTypes) Map(fn mapUserTypesFunc) error
- func (m *UserTypes) MarshalJSON() ([]byte, error)
- func (m *UserTypes) Set(k string, v *UserType)
- func (m *UserTypes) SetToTop(k string, v *UserType)
- func (m *UserTypes) Update(k string, fn func(v *UserType) *UserType)
- type UserTypesItem
Constants ¶
const JDocExchangeVersion = "2.0.0"
Variables ¶
This section is empty.
Functions ¶
func Annotation ¶
Types ¶
type Catalog ¶
type Catalog struct { // Info represent "INFO" directive structure. Info *Info // Servers contains information about servers. Servers *Servers // UserTypes contains information about defined user types. UserTypes *UserTypes // UserEnums contains information about defined user enums. UserEnums *UserRules Interactions *Interactions Tags *Tags JSightVersion string }
Catalog is the main result of processing .jst file, represents all accumulated Api data more closely to API terms. Has no direct connection to Directives but operates with models with similar structure, but in API terms. Has flat URL structure, each URL is unique and indicates a separate Resource. Each Resource has Requests — available http methods and their properties. Each Resource or Request has it its own complex properties, which can be added through dedicated methods.
func NewCatalog ¶
func NewCatalog() *Catalog
func (*Catalog) AddBaseURL ¶
func (*Catalog) AddDescriptionToHTTPMethod ¶
func (*Catalog) AddDescriptionToInfo ¶
func (*Catalog) AddDescriptionToJsonRpcMethod ¶
func (*Catalog) AddDescriptionToTag ¶
func (*Catalog) AddHTTPMethod ¶
func (*Catalog) AddJsonRpcMethod ¶
func (*Catalog) AddJsonRpcParams ¶
func (c *Catalog) AddJsonRpcParams(s *ExchangeJSightSchema, d directive.Directive) error
func (*Catalog) AddJsonRpcResult ¶
func (c *Catalog) AddJsonRpcResult(s *ExchangeJSightSchema, d directive.Directive) error
func (*Catalog) AddQueryToCurrentMethod ¶
func (*Catalog) AddRequestBody ¶
func (c *Catalog) AddRequestBody(s ExchangeSchema, f SerializeFormat, d directive.Directive) error
func (*Catalog) AddRequestHeaders ¶
func (c *Catalog) AddRequestHeaders(s *ExchangeJSightSchema, d directive.Directive) error
func (*Catalog) AddResponse ¶
func (*Catalog) AddResponseBody ¶
func (c *Catalog) AddResponseBody( schemaBytes bytes.Bytes, bodyFormat SerializeFormat, sn notation.SchemaNotation, d directive.Directive, tt *UserSchemas, rr map[string]schema.Rule, ) *jerr.JApiError
func (*Catalog) AddResponseHeaders ¶
func (c *Catalog) AddResponseHeaders(s *ExchangeJSightSchema, d directive.Directive) error
func (*Catalog) AddVersion ¶
func (*Catalog) MarshalJSON ¶
func (*Catalog) ToJsonIndent ¶
type ExchangeContent ¶
type ExchangeContent struct { // Key is key of object element. Key *string // TokenType a JSON type. TokenType string // Type a JSight type. Type string // ScalarValue contains scalar value from the example. // Make sense only for scalar types like string, integer, and etc. ScalarValue string // InheritedFrom a user defined type from which this property is inherited. InheritedFrom string // Note a user note. Note string // Rules a list of attached rules. Rules *Rules // Children represent available object properties or array items. Children []*ExchangeContent // IsKeyUserTypeRef indicates that this is an object property which is described // by user defined type. IsKeyUserTypeRef bool // Optional indicates that this schema item is option or not. Optional bool }
func (*ExchangeContent) IsObjectHaveProperty ¶
func (c *ExchangeContent) IsObjectHaveProperty(k string) bool
func (*ExchangeContent) MarshalJSON ¶
func (c *ExchangeContent) MarshalJSON() (b []byte, err error)
func (*ExchangeContent) ObjectProperty ¶
func (c *ExchangeContent) ObjectProperty(k string) *ExchangeContent
func (*ExchangeContent) ToUsedUserTypes ¶
func (c *ExchangeContent) ToUsedUserTypes(uut *StringSet)
func (*ExchangeContent) Unshift ¶
func (c *ExchangeContent) Unshift(v *ExchangeContent)
type ExchangeJSightSchema ¶
func NewExchangeJSightSchema ¶
func NewExchangeJSightSchema[T bytes.ByteKeeper]( b T, coreUserTypes *UserSchemas, coreRules map[string]schema.Rule, catalogUserTypes *UserTypes, options ...jschema.Option, ) (*ExchangeJSightSchema, error)
func (*ExchangeJSightSchema) CastToObject ¶ added in v0.2.0
func (e *ExchangeJSightSchema) CastToObject() *ExchangeJSightSchema
func (*ExchangeJSightSchema) Compile ¶
func (e *ExchangeJSightSchema) Compile() (err error)
func (*ExchangeJSightSchema) Example ¶
func (e *ExchangeJSightSchema) Example() ([]byte, error)
func (*ExchangeJSightSchema) MarshalJSON ¶
func (e *ExchangeJSightSchema) MarshalJSON() ([]byte, error)
func (*ExchangeJSightSchema) Notation ¶ added in v0.2.0
func (e *ExchangeJSightSchema) Notation() notation.SchemaNotation
type ExchangePseudoSchema ¶
func NewExchangePseudoSchema ¶
func NewExchangePseudoSchema(n notation.SchemaNotation) *ExchangePseudoSchema
func (ExchangePseudoSchema) MarshalJSON ¶
func (e ExchangePseudoSchema) MarshalJSON() ([]byte, error)
func (ExchangePseudoSchema) Notation ¶
func (e ExchangePseudoSchema) Notation() notation.SchemaNotation
type ExchangeRegexSchema ¶
func NewExchangeRegexSchema ¶ added in v0.2.0
func NewExchangeRegexSchema(regexStr bytes.Bytes) (*ExchangeRegexSchema, error)
func (ExchangeRegexSchema) MarshalJSON ¶
func (e ExchangeRegexSchema) MarshalJSON() ([]byte, error)
func (ExchangeRegexSchema) Notation ¶ added in v0.2.0
func (e ExchangeRegexSchema) Notation() notation.SchemaNotation
type ExchangeSchema ¶
type HTTPInteraction ¶
type HTTPInteraction struct { Id string `json:"id"` Protocol Protocol `json:"protocol"` HttpMethod HTTPMethod `json:"httpMethod"` PathVal Path `json:"path"` PathVariables *PathVariables `json:"pathVariables,omitempty"` Tags []TagName `json:"tags"` Annotation *string `json:"annotation,omitempty"` Description *string `json:"description,omitempty"` Query *Query `json:"query,omitempty"` Request *HTTPRequest `json:"request,omitempty"` Responses []HTTPResponse `json:"responses,omitempty"` }
func (HTTPInteraction) Path ¶
func (h HTTPInteraction) Path() Path
func (*HTTPInteraction) SetPathVariables ¶
func (h *HTTPInteraction) SetPathVariables(p *PathVariables)
type HTTPInteractionID ¶
type HTTPInteractionID struct {
// contains filtered or unexported fields
}
func (HTTPInteractionID) MarshalText ¶
func (h HTTPInteractionID) MarshalText() ([]byte, error)
func (HTTPInteractionID) Method ¶
func (h HTTPInteractionID) Method() HTTPMethod
func (HTTPInteractionID) Path ¶
func (h HTTPInteractionID) Path() Path
func (HTTPInteractionID) Protocol ¶
func (h HTTPInteractionID) Protocol() Protocol
func (HTTPInteractionID) String ¶
func (h HTTPInteractionID) String() string
type HTTPMethod ¶
type HTTPMethod uint8
const ( GET HTTPMethod = iota POST PUT PATCH DELETE OPTIONS )
func NewHTTPMethod ¶
func NewHTTPMethod(de directive.Enumeration) (HTTPMethod, error)
func NewHTTPMethodFromString ¶
func NewHTTPMethodFromString(s string) (HTTPMethod, error)
func (HTTPMethod) MarshalText ¶
func (e HTTPMethod) MarshalText() ([]byte, error)
func (HTTPMethod) String ¶
func (e HTTPMethod) String() string
type HTTPRequest ¶
type HTTPRequest struct { *HTTPRequestHeaders `json:"headers,omitempty"` *HTTPRequestBody `json:"body,omitempty"` Directive directive.Directive `json:"-"` }
type HTTPRequestBody ¶
type HTTPRequestBody struct { Format SerializeFormat `json:"format"` Schema ExchangeSchema `json:"schema"` Directive directive.Directive `json:"-"` }
type HTTPRequestHeaders ¶
type HTTPRequestHeaders struct { Schema *ExchangeJSightSchema `json:"schema"` Directive directive.Directive `json:"-"` }
type HTTPResponse ¶
type HTTPResponse struct { Code string `json:"code"` Annotation string `json:"annotation,omitempty"` Headers *HTTPResponseHeaders `json:"headers,omitempty"` Body *HTTPResponseBody `json:"body"` Directive directive.Directive `json:"-"` }
type HTTPResponseBody ¶
type HTTPResponseBody struct { Format SerializeFormat `json:"format"` Schema ExchangeSchema `json:"schema"` Directive directive.Directive `json:"-"` }
func NewHTTPResponseBody ¶
func NewHTTPResponseBody( b bytes.Bytes, f SerializeFormat, sn notation.SchemaNotation, d directive.Directive, tt *UserSchemas, rr map[string]schema.Rule, catalogUserTypes *UserTypes, ) (HTTPResponseBody, *jerr.JApiError)
type HTTPResponseHeaders ¶
type HTTPResponseHeaders struct { Schema *ExchangeJSightSchema `json:"schema"` Directive directive.Directive `json:"-"` }
type Info ¶
type Info struct { Title string `json:"title,omitempty"` Version string `json:"version,omitempty"` Description *string `json:"description,omitempty"` Directive directive.Directive `json:"-"` }
Info general info about api
type Interaction ¶
type Interaction interface { Path() Path // contains filtered or unexported methods }
type InteractionID ¶
type Interactions ¶
type Interactions struct {
// contains filtered or unexported fields
}
Interactions represent available resource methods. gen:OrderedMap
func (*Interactions) Each ¶
func (m *Interactions) Each(fn eachInteractionsFunc) error
Each iterates and perform given function on each item in the map.
func (*Interactions) EachReverse ¶
func (m *Interactions) EachReverse(fn eachInteractionsFunc) error
EachReverse act almost the same as Each but in reverse order.
func (*Interactions) EachSafe ¶
func (m *Interactions) EachSafe(fn eachSafeInteractionsFunc)
func (*Interactions) Find ¶
func (m *Interactions) Find(fn findInteractionsFunc) (InteractionsItem, bool)
Find finds first matched item from the map.
func (*Interactions) Get ¶
func (m *Interactions) Get(k InteractionID) (Interaction, bool)
Get gets a value by key.
func (*Interactions) GetValue ¶
func (m *Interactions) GetValue(k InteractionID) Interaction
GetValue gets a value by key.
func (*Interactions) Has ¶
func (m *Interactions) Has(k InteractionID) bool
Has checks that specified key is set.
func (*Interactions) Map ¶
func (m *Interactions) Map(fn mapInteractionsFunc) error
Map iterates and changes values in the map.
func (*Interactions) MarshalJSON ¶
func (m *Interactions) MarshalJSON() ([]byte, error)
func (*Interactions) Set ¶
func (m *Interactions) Set(k InteractionID, v Interaction)
Set sets a value with specified key.
func (*Interactions) SetToTop ¶
func (m *Interactions) SetToTop(k InteractionID, v Interaction)
SetToTop do the same as Set, but new key will be placed on top of the order map.
func (*Interactions) Update ¶
func (m *Interactions) Update(k InteractionID, fn func(v Interaction) Interaction)
Update updates a value with specified key.
type InteractionsItem ¶
type InteractionsItem struct { Key InteractionID Value Interaction }
InteractionsItem represent single data from the Interactions.
type JSchemaObject ¶
func (*JSchemaObject) ObjectFirstLevelProperties ¶
func (*JSchemaObject) ObjectProperty ¶
func (s *JSchemaObject) ObjectProperty(key string) (ischema.Node, bool)
func (*JSchemaObject) RootObjectNode ¶
func (s *JSchemaObject) RootObjectNode() (*ischema.ObjectNode, bool)
type JsonRpcInteraction ¶
type JsonRpcInteraction struct { Id string `json:"id"` Protocol Protocol `json:"protocol"` PathVal Path `json:"path"` Method string `json:"method"` Tags []TagName `json:"tags"` Annotation *string `json:"annotation,omitempty"` Description *string `json:"description,omitempty"` Params *jsonRpcParams `json:"params,omitempty"` Result *jsonRpcResult `json:"result,omitempty"` }
func (JsonRpcInteraction) Path ¶
func (j JsonRpcInteraction) Path() Path
type JsonRpcInteractionId ¶
type JsonRpcInteractionId struct {
// contains filtered or unexported fields
}
func (JsonRpcInteractionId) MarshalText ¶
func (j JsonRpcInteractionId) MarshalText() ([]byte, error)
func (JsonRpcInteractionId) Path ¶
func (j JsonRpcInteractionId) Path() Path
func (JsonRpcInteractionId) Protocol ¶
func (j JsonRpcInteractionId) Protocol() Protocol
func (JsonRpcInteractionId) String ¶
func (j JsonRpcInteractionId) String() string
type ObjectBuilder ¶
type ObjectBuilder struct {
// contains filtered or unexported fields
}
func NewObjectBuilder ¶
func NewObjectBuilder() ObjectBuilder
NewObjectBuilder used only for building Path variables in the JSight API library
func (ObjectBuilder) AddProperty ¶
func (ObjectBuilder) Build ¶
func (b ObjectBuilder) Build() *jschema.JSchema
func (ObjectBuilder) Len ¶
func (b ObjectBuilder) Len() int
func (ObjectBuilder) UserTypeNames ¶
func (b ObjectBuilder) UserTypeNames() []string
type PathVariables ¶
type PathVariables struct {
Schema *ExchangeJSightSchema `json:"schema"`
}
type PathVariablesBuilder ¶
type PathVariablesBuilder struct {
// contains filtered or unexported fields
}
func NewPathVariablesBuilder ¶
func NewPathVariablesBuilder(catalogUserTypes *UserTypes) PathVariablesBuilder
func (PathVariablesBuilder) AddProperty ¶
func (PathVariablesBuilder) Build ¶
func (b PathVariablesBuilder) Build() *PathVariables
func (PathVariablesBuilder) Len ¶
func (b PathVariablesBuilder) Len() int
type Query ¶
type Query struct { Example string `json:"example,omitempty"` Format string `json:"format"` Schema *ExchangeJSightSchema `json:"schema"` Directive directive.Directive `json:"-"` }
type Rule ¶
type Rule struct { Key string TokenType RuleTokenType // ScalarValue specified only if "tokenType" specifies "string", "number", // "boolean", "annotation", "null" or "reference". ScalarValue string // Note may contain line breaks. Note string // Children specified only if tokenType: "array" or "object". Children []Rule }
func (Rule) MarshalJSON ¶
type RuleTokenType ¶
type RuleTokenType string
const ( RuleTokenTypeObject RuleTokenType = "object" RuleTokenTypeArray RuleTokenType = "array" RuleTokenTypeString RuleTokenType = "string" RuleTokenTypeNumber RuleTokenType = "number" RuleTokenTypeBoolean RuleTokenType = "boolean" RuleTokenTypeNull RuleTokenType = "null" RuleTokenTypeAnnotation RuleTokenType = "annotation" RuleTokenTypeReference RuleTokenType = "reference" )
type Rules ¶
type Rules struct {
// contains filtered or unexported fields
}
func (*Rules) MarshalJSON ¶
type RulesBuilder ¶
type RulesBuilder struct {
// contains filtered or unexported fields
}
func (*RulesBuilder) Append ¶
func (b *RulesBuilder) Append(r Rule)
func (*RulesBuilder) Rules ¶
func (b *RulesBuilder) Rules() *Rules
func (*RulesBuilder) Set ¶
func (b *RulesBuilder) Set(k string, r Rule)
type SerializeFormat ¶
type SerializeFormat string
const ( SerializeFormatJSON SerializeFormat = "json" SerializeFormatPlainString SerializeFormat = "plainString" SerializeFormatBinary SerializeFormat = "binary" )
func SchemaSerializeFormat ¶
func SchemaSerializeFormat(n notation.SchemaNotation) (SerializeFormat, error)
type Servers ¶
type Servers struct {
// contains filtered or unexported fields
}
Servers represent available servers. gen:OrderedMap
func (*Servers) EachReverse ¶
EachReverse act almost the same as Each but in reverse order.
func (*Servers) Find ¶
func (m *Servers) Find(fn findServersFunc) (ServersItem, bool)
Find finds first matched item from the map.
func (*Servers) MarshalJSON ¶
type ServersItem ¶
ServersItem represent single data from the Servers.
type StringSet ¶
type StringSet struct {
// contains filtered or unexported fields
}
StringSet a set of strings. gen:Set
func NewStringSet ¶
type Tag ¶
type Tag struct { InteractionGroups map[Protocol]TagInteractionGroup Children *Tags Name TagName Title string Description *string }
func (*Tag) MarshalJSON ¶
type TagHTTPInteractionGroup ¶
type TagHTTPInteractionGroup struct { Protocol Protocol `json:"protocol"` Interactions []InteractionID `json:"interactions"` }
type TagInteractionGroup ¶
type TagInteractionGroup interface {
// contains filtered or unexported methods
}
type TagJsonRpcInteractionGroup ¶
type TagJsonRpcInteractionGroup struct { Protocol Protocol `json:"protocol"` Interactions []InteractionID `json:"interactions"` }
type Tags ¶
type Tags struct {
// contains filtered or unexported fields
}
Tags represent available tags. gen:OrderedMap
func (*Tags) EachReverse ¶
EachReverse act almost the same as Each but in reverse order.
func (*Tags) MarshalJSON ¶
type UserRules ¶
type UserRules struct {
// contains filtered or unexported fields
}
UserRules represent available user rules. gen:OrderedMap
func (*UserRules) EachReverse ¶
EachReverse act almost the same as Each but in reverse order.
func (*UserRules) Find ¶
func (m *UserRules) Find(fn findUserRulesFunc) (UserRulesItem, bool)
Find finds first matched item from the map.
func (*UserRules) MarshalJSON ¶
type UserRulesItem ¶
UserRulesItem represent single data from the UserRules.
type UserSchemas ¶
type UserSchemas struct {
// contains filtered or unexported fields
}
UserSchemas represent available user type's schemas. gen:UnsafeOrderedMap
func (*UserSchemas) Each ¶
func (m *UserSchemas) Each(fn eachUserSchemasFunc) error
Each iterates and perform given function on each item in the map.
func (*UserSchemas) EachSafe ¶
func (m *UserSchemas) EachSafe(fn eachSafeUserSchemasFunc)
func (*UserSchemas) Get ¶
func (m *UserSchemas) Get(k string) (schema.Schema, bool)
Get gets a value by key.
func (*UserSchemas) GetValue ¶
func (m *UserSchemas) GetValue(k string) schema.Schema
GetValue gets a value by key.
func (*UserSchemas) Has ¶
func (m *UserSchemas) Has(k string) bool
Has checks that specified key is set.
func (*UserSchemas) Map ¶
func (m *UserSchemas) Map(fn mapUserSchemasFunc) error
Map iterates and changes values in the map.
func (*UserSchemas) MarshalJSON ¶
func (m *UserSchemas) MarshalJSON() ([]byte, error)
type UserSchemasItem ¶
UserSchemasItem represent single data from the UserSchemas.
type UserType ¶
type UserType struct { Annotation string `json:"annotation,omitempty"` Description string `json:"description,omitempty"` Schema ExchangeSchema `json:"schema"` Directive directive.Directive `json:"-"` }
type UserTypes ¶
type UserTypes struct {
// contains filtered or unexported fields
}
UserTypes represent available user types. gen:OrderedMap
func (*UserTypes) EachReverse ¶
EachReverse act almost the same as Each but in reverse order.
func (*UserTypes) Find ¶
func (m *UserTypes) Find(fn findUserTypesFunc) (UserTypesItem, bool)
Find finds first matched item from the map.
func (*UserTypes) MarshalJSON ¶
type UserTypesItem ¶
UserTypesItem represent single data from the UserTypes.
Source Files ¶
- annotation.go
- catalog.go
- exchange_content.go
- exchange_schema.go
- exchange_schema_jsight.go
- exchange_schema_pseudo.go
- exchange_schema_regex.go
- http_interaction.go
- http_interaction_id.go
- http_method.go
- http_request.go
- http_response.go
- http_response_body.go
- info.go
- interaction.go
- interaction_id.go
- interactions.go
- interactions_gen.go
- json_rpc_interaction.go
- json_rpc_interaction_id.go
- object.go
- object_builder.go
- path.go
- path_variables.go
- path_variables_builder.go
- prop.go
- protocol.go
- query.go
- rule.go
- rules.go
- rules_builder.go
- serialize_format.go
- servers.go
- servers_gen.go
- setters.go
- string_set.go
- string_set_gen.go
- tag.go
- tag_http_interaction_group.go
- tag_interaction_group.go
- tag_json_rpc_interaction_group.go
- tag_name.go
- tags.go
- tags_gen.go
- user_rule.go
- user_rules.go
- user_rules_gen.go
- user_schemas.go
- user_schemas_gen.go
- user_type.go
- user_types.go
- user_types_gen.go