seed: Index | Files

package api

import ""

Package api provides a structure for designing an API for your app.


Package Files


type Design Uses

type Design struct {
    Endpoints []Endpoint

Design is an API design for your app.

func New Uses

func New() Design

New returns a new API design.

func (Design) AddTo Uses

func (d Design) AddTo(app *seed.App)

AddTo app.

func (*Design) Endpoint Uses

func (d *Design) Endpoint(route string, handler interface{}) error

Endpoint creates a new endpoint for your API. This will panic if the handler is invalid.

type Endpoint Uses

type Endpoint struct {
    Route   string
    Handler interface{}

Endpoint is an API endpoint with a route and handler.

Package api imports 8 packages (graph). Updated 2020-01-22. Refresh now. Tools for package owners.