api

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: AGPL-3.0 Imports: 5 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

View Source
var APIDocForm = &forms.Form{}

Functions

This section is empty.

Types

type API

type API struct {
	Name        string      `json:"name"`
	Version     int         `json:"version"`
	Description string      `json:"description"`
	Endpoints   []*Endpoint `json:"endpoints"`
}

func (*API) ToJSONRPC

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

func (*API) ToREST

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

type APIDocParams

type APIDocParams struct {
}

type Endpoint

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

type Method

type Method string

type REST

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

type ReturnType

type ReturnType struct {
	Validators []forms.Validator
}

func (*ReturnType) MarshalJSON

func (r *ReturnType) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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