discovery

package
v0.0.0-...-9b87225 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDiscoveriesFromDirectory

func LoadDiscoveriesFromDirectory(dir string) (docs map[string]*Discovery, err error)

Types

type Discovery

type Discovery struct {
	Kind             string
	DiscoveryVersion string
	Id               string
	Name             string
	Version          string
	Revision         string
	Title            string
	Description      string
	Icons            struct {
		X16 string
		X32 string
	}
	DocumentationLink string
	Labels            []string
	Protocol          string // must be "rest"
	BaseUrl           string
	BasePath          string
	RootUrl           string
	ServicePath       string
	BatchPath         string // must be "batch"
	Parameters        map[string]Parameter
	Auth              struct {
		Oauth2 struct {
			Scopes map[string]struct {
				Description string
			}
		}
	}
	Features  []string
	Schemas   map[string]Parameter
	Methods   map[string]Method
	Resources map[string]Resource
}

func LoadDiscovery

func LoadDiscovery(r io.Reader) (doc *Discovery, err error)

type JsonSchema

type JsonSchema interface{}

type Method

type Method struct {
	Id             string
	Path           string
	FlatPath       string
	HttpMethod     string
	Parameters     map[string]Parameter
	ParameterOrder []string
	Request        struct {
		Ref string `json:"$ref"`
	}
	Response struct {
		Ref string `json:"$ref"`
	}
	Scopes                []string
	SupportsMediaDownload bool
	SupportsMediaUpload   bool
	MediaUpload           struct {
		Accept    []string
		MaxSize   string
		Protocols struct {
			Simple struct {
				Multipart bool // must be true
				Path      string
			}
			Resumable struct {
				Multipart bool // must be true
				Path      string
			}
		}
	}
	SupportsSubscription bool
}

type Parameter

type Parameter struct {
	Id                   string
	Type                 string
	Ref                  string `json:"$ref"`
	Description          string
	Default              string
	Required             bool
	Format               string
	Pattern              string
	Minimum              string
	Maximum              string
	Enum                 []string
	EnumDescriptions     []string
	Repeated             bool
	Location             string
	Properties           map[string]JsonSchema
	AdditionalProperties JsonSchema
	Items                JsonSchema
	Annotations          struct {
		Required []string
	}
}

type Resource

type Resource struct {
	Methods   map[string]Method
	Resources map[string]Resource
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL