element

package
v0.0.0-...-62794b5 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedElement = errors.New("unsupported element")

Functions

This section is empty.

Types

type API

type API struct {
	Title          string          `json:"title"`
	Description    string          `json:"description"`
	Metadata       []Metadata      `json:"metadata"`
	ResourceGroups []ResourceGroup `json:"resource_groups"`
	Resources      []Resource      `json:"resources"`
}

func FromJSON

func FromJSON(b []byte) (*API, error)

type Asset

type Asset struct {
	ContentType string `json:"content_type"`
	Body        string `json:"body"`
}
type Header struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Href

type Href struct {
	Path      string         `json:"path"`
	Variables []HrefVariable `json:"variables"`
}

type HrefVariable

type HrefVariable struct {
	Title       string `json:"title"`
	Required    bool   `json:"required"`
	Description string `json:"description"`
	Key         string `json:"key"`
	Value       string `json:"value"`
}

type Metadata

type Metadata struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Request

type Request struct {
	Description string   `json:"description"`
	Method      string   `json:"method"`
	Headers     []Header `json:"headers"`
	Body        Asset    `json:"body"`
	Schema      Asset    `json:"schema"`
}

type Resource

type Resource struct {
	Title       string       `json:"title"`
	Description string       `json:"description"`
	Href        Href         `json:"href"`
	Transitions []Transition `json:"transitions"`
}

type ResourceGroup

type ResourceGroup struct {
	Title       string     `json:"title"`
	Description string     `json:"description"`
	Resources   []Resource `json:"resources"`
}

type Response

type Response struct {
	Description string   `json:"description"`
	StatusCode  int      `json:"status_code"`
	Headers     []Header `json:"headers"`
	Body        Asset    `json:"body"`
	Schema      Asset    `json:"schema"`
}

type Transaction

type Transaction struct {
	Request  Request  `json:"request"`
	Response Response `json:"response"`
}

type Transition

type Transition struct {
	Title        string        `json:"title"`
	Description  string        `json:"description"`
	Method       string        `json:"method"`
	Href         Href          `json:"href"`
	Transactions []Transaction `json:"transactions"`
}

Jump to

Keyboard shortcuts

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