api

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2018 License: MIT Imports: 8 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIsNotSlice = errors.New("is not a slice")

Functions

This section is empty.

Types

type API

type API struct {
	Title          string
	Description    string
	Metadata       []Metadata
	ResourceGroups []ResourceGroup
	Annotations    []Annotation
}

func NewAPI

func NewAPI(el *Element) (*API, error)

func (*API) Host added in v0.5.0

func (a *API) Host() string

type Annotation

type Annotation struct {
	Description string
	Classes     []string
	Code        int
	SourceMaps  []SourceMap
}

type Asset

type Asset struct {
	ContentType string
	Body        string
}

type Element

type Element struct {
	// contains filtered or unexported fields
}

func ParseJSON

func ParseJSON(r io.Reader) (*Element, error)

func (*Element) Children

func (b *Element) Children() ([]*Element, error)

func (*Element) ChildrenMap

func (b *Element) ChildrenMap() (map[string]*Element, error)

func (*Element) Exists

func (b *Element) Exists(key string) bool

func (*Element) FlatChildren added in v0.6.7

func (b *Element) FlatChildren() ([]*Element, error)

func (*Element) Index

func (b *Element) Index(i int) *Element

func (*Element) Object added in v0.3.1

func (b *Element) Object() interface{}

func (*Element) Path

func (b *Element) Path(key string) *Element

func (*Element) String

func (b *Element) String() string

func (*Element) Value

func (b *Element) Value() reflect.Value
type Header struct {
	Key   string
	Value string
}

type Href

type Href struct {
	Path       string
	Parameters []Parameter
}

type Metadata

type Metadata struct {
	Key   string
	Value string
}

type Parameter

type Parameter struct {
	Required    bool
	Description string
	Key         string
	Value       string
	Kind        string
	Default     string
	Members     []string
}

type Request

type Request struct {
	Title       string
	Description string
	Method      string
	Body        Asset
	Schema      Asset
	Headers     []Header
	ContentType string
}

type Resource

type Resource struct {
	Title       string
	Description string
	Transitions []*Transition
	Href        Href
}

type ResourceGroup

type ResourceGroup struct {
	Title       string
	Description string
	Resources   []*Resource
}

type Response

type Response struct {
	StatusCode  int
	Description string
	Headers     []Header
	Body        Asset
	Schema      Asset
}

type SourceMap

type SourceMap struct {
	Row int
	Col int
}

type Transaction

type Transaction struct {
	Request  Request
	Response Response
}

type Transition

type Transition struct {
	Title        string
	Description  string
	Href         Href
	Transactions []Transaction

	Permalink string
	Method    string
	URL       string
}

Jump to

Keyboard shortcuts

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