recipe

package
v0.0.0-...-0cabaaa Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Sequential bool        `yaml:"sequential"`
	Responses  []*Response `yaml:"responses"`
	// contains filtered or unexported fields
}

func (*Handler) Handler

func (m *Handler) Handler(fp string) (http.Handler, error)

type Recipe

type Recipe struct {
	Routes  map[string]*Route `yaml:"routes"`
	Default *Handler          `yaml:"default"`
}

func New

func New(filename string) (*Recipe, error)

type Response

type Response struct {
	Code int    `yaml:"code"`
	Data string `yaml:"data"`
	File string `yaml:"file"`
	// contains filtered or unexported fields
}

type Route

type Route struct {
	Get, Post, Put, Patch, Delete, Options *Handler
}

func (Route) Methods

func (r Route) Methods() map[string]*Handler

Jump to

Keyboard shortcuts

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