Documentation ¶
Index ¶
- func Process(doc *DiscoveryDocument, wr io.Writer, templatePath string) error
- func ProcessAll(document io.Reader, output io.Writer) (err error)
- type Auth
- type DiscoveryDocument
- type ErrUnknownJsonType
- type Icons
- type Method
- func (r *Method) GetDescription() string
- func (m *Method) GetParameters() map[string]*MethodRequestParameter
- func (r *Method) GetRequestName() string
- func (r *Method) GetRequestType() string
- func (r *Method) GetResponseType() string
- func (m *Method) HasParameters() bool
- func (r *Method) HasRequest() bool
- func (m *Method) IsGet() bool
- func (m *Method) IsPaged(d *DiscoveryDocument) bool
- func (m *Method) IsPost() bool
- type MethodRequestParameter
- type MethodRequestType
- type MethodResponseType
- type OAuthScope
- type Parameter
- type PropertyDefinition
- type Resource
- type Schema
- type SchemaProperty
- type SchemaPropertyItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
Scopes map[string]*OAuthScope `json:"scopes"`
}
type DiscoveryDocument ¶
type DiscoveryDocument struct { Version string `json:"version"` BaseURL string `json:"baseUrl"` ServicePath string `json:"servicePath"` Kind string `json:"kind"` Description string `json:"description"` BasePath string `json:"basePath"` ID string `json:"id"` DocumentationLink string `json:"documentationLink"` Revision string `json:"revision"` DiscoveryVersion string `json:"discoveryVersion"` VersionModule bool `json:"version_module"` Protocol string `json:"protocol"` RootURL string `json:"rootUrl"` OwnerDomain string `json:"ownerDomain"` Name string `json:"name"` BatchPath string `json:"batchPath"` FullyEncodeReservedExpansion bool `json:"fullyEncodeReservedExpansion"` Title string `json:"title"` OwnerName string `json:"ownerName"` Auth map[string]*Auth `json:"auth"` Schemas map[string]*Schema `json:"schemas"` Resources map[string]*Resource `json:"resources"` Parameters map[string]*Parameter `json:"parameters"` }
func (*DiscoveryDocument) IsResponse ¶
func (p *DiscoveryDocument) IsResponse(s *Schema) bool
type ErrUnknownJsonType ¶
type ErrUnknownJsonType struct {
Type string
}
func (*ErrUnknownJsonType) Error ¶
func (e *ErrUnknownJsonType) Error() string
type Method ¶
type Method struct { Path string `json:"path"` ID string `json:"id"` Request *MethodRequestType `json:"request"` Description string `json:"description"` Response *MethodResponseType `json:"response"` ParameterOrder []string `json:"parameterOrder"` HTTPMethod string `json:"httpMethod"` Scopes []string `json:"scopes"` Parameters map[string]*MethodRequestParameter `json:"parameters"` FlatPath string `json:"flatPath"` }
func (*Method) GetDescription ¶
func (*Method) GetParameters ¶
func (m *Method) GetParameters() map[string]*MethodRequestParameter
func (*Method) GetRequestName ¶
func (*Method) GetRequestType ¶
func (*Method) GetResponseType ¶
func (*Method) HasParameters ¶
func (*Method) HasRequest ¶
func (*Method) IsPaged ¶
func (m *Method) IsPaged(d *DiscoveryDocument) bool
type MethodRequestParameter ¶
type MethodRequestParameter struct { Location string `json:"location"` Description string `json:"description"` Required bool `json:"required"` Type string `json:"type"` Pattern string `json:"pattern"` }
func (*MethodRequestParameter) GetType ¶
func (p *MethodRequestParameter) GetType() (string, error)
type MethodRequestType ¶
type MethodRequestType struct {
Ref string `json:"$ref"`
}
type MethodResponseType ¶
type MethodResponseType struct {
Ref string `json:"$ref"`
}
type OAuthScope ¶
type OAuthScope struct {
Description string `json:"description"`
}
func (*OAuthScope) GetName ¶
func (s *OAuthScope) GetName(scopeUrl string) string
type PropertyDefinition ¶
type Resource ¶
func (*Resource) GetCallName ¶
func (*Resource) GetResourceName ¶
func (*Resource) GetServiceName ¶
type Schema ¶
type Schema struct { ID string `json:"id"` Description string `json:"description"` Type string `json:"type"` Properties map[string]*SchemaProperty `json:"properties"` }
func (*Schema) GetDescription ¶
type SchemaProperty ¶
type SchemaProperty struct { PropertyDefinition Description string `json:"description"` EnumDescriptions []string `json:"enumDescriptions,omitempty"` Items *SchemaPropertyItem `json:"items,omitempty"` }
func (*SchemaProperty) GetDescription ¶
func (p *SchemaProperty) GetDescription() string
func (*SchemaProperty) GetJsonTag ¶
func (p *SchemaProperty) GetJsonTag() string
func (*SchemaProperty) GetType ¶
func (p *SchemaProperty) GetType() (string, error)
type SchemaPropertyItem ¶
type SchemaPropertyItem struct { PropertyDefinition Enum []string `json:"enum"` }
Click to show internal directories.
Click to hide internal directories.