model

package
v0.0.0-...-8d6a06f Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Name      string               `yaml:"name"`
	Endpoints map[string]*Endpoint `yaml:"endpoints"`
}

API represents a entire model of API

func APIFromYAML

func APIFromYAML(body []byte) (*API, error)

APIFromYAML creates API object from YAML

func BuildAPIWithEndpoints

func BuildAPIWithEndpoints(apiName string, endpoints []*Endpoint) *API

BuildAPIWithEndpoints craete new build object with the given endpoints

func (*API) ToYAML

func (a *API) ToYAML() (string, error)

ToYAML converts API object to YAML

type Endpoint

type Endpoint struct {
	Path      string `yaml:"-"`
	TargetURL string `yaml:"url"`
}

Endpoint represents API endpoint

Jump to

Keyboard shortcuts

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