metadata

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 4 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"`

	Path string `yaml:"path"`

	// Relations is map of field name and api name
	Relations map[string]string `yaml:"relations"`

	// Form is `list` or `object`.
	Form string `yaml:"form"`

	// CustomFields is map of field name and custom field name
	CustomFields map[string]string `yaml:"custom-fields"`
}

func (*API) BuildPath

func (api *API) BuildPath(meta Metadata) string

func (*API) SetDefaultValues

func (api *API) SetDefaultValues()

type Info

type Info struct {
	ServiceID string `yaml:"service-id"`
	BasePath  string `yaml:"base-path"`
}

func (*Info) SetDefaultValues

func (info *Info) SetDefaultValues()

type Metadata

type Metadata struct {
	Info *Info  `yaml:"info"`
	APIs []*API `yaml:"apis"`
}

func LoadFromFile

func LoadFromFile(path string) (Metadata, error)

func (*Metadata) SetDefaultValues

func (meta *Metadata) SetDefaultValues()

Jump to

Keyboard shortcuts

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