api

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POST   = Method("POST")
	GET    = Method("GET")
	PUT    = Method("PUT")
	DELETE = Method("DELETE")
	PATCH  = Method("PATCH")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Version   int
	Endpoints []*Endpoint
}

func (*API) ToJSONRPC

func (c *API) ToJSONRPC() (jsonrpc.Handler, error)

func (*API) ToREST

func (c *API) ToREST() (rest.Handler, error)

type Endpoint

type Endpoint struct {
	Name    string      `json:"name"`
	Handler interface{} `json:"-"`
	REST    *REST       `json:"rest,omitempty"`
	Form    *forms.Form `json:"form"`
}

type Method

type Method string

type REST

type REST struct {
	Path   string `json:"path"`
	Method Method `json:"method"`
}

Jump to

Keyboard shortcuts

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