spec

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiEndpoint added in v0.13.0

type ApiEndpoint struct {
	Name         string `json:"name"`
	Method       string `json:"method"`
	Path         string `json:"path"`
	ResponseType string `json:"responseType"`
	BodyType     string `json:"bodyType"`
}

type ApiRoute added in v0.13.0

type ApiRoute struct {
	Name         string
	Path         string
	Method       string
	ErrorTypes   []pyrin.ErrorType
	ResponseType any
	BodyType     any
}

type FormApiEndpoint added in v0.13.0

type FormApiEndpoint struct {
	Name         string `json:"name"`
	Method       string `json:"method"`
	Path         string `json:"path"`
	ResponseType string `json:"responseType"`
	BodyType     string `json:"bodyType"`
}

type FormApiRoute added in v0.13.0

type FormApiRoute struct {
	Name         string
	Path         string
	Method       string
	ErrorTypes   []pyrin.ErrorType
	ResponseType any
	Spec         pyrin.FormSpec
}

type NormalEndpoint added in v0.13.0

type NormalEndpoint struct {
	Name   string `json:"name"`
	Method string `json:"method"`
	Path   string `json:"path"`
}

type NormalRoute added in v0.13.0

type NormalRoute struct {
	Name   string
	Path   string
	Method string
}

type Route added in v0.8.6

type Route interface {
	// contains filtered or unexported methods
}

type RouteGroup added in v0.8.6

type RouteGroup struct {
	Router *Router
	Prefix string
}

func NewRouteGroup added in v0.8.6

func NewRouteGroup(router *Router, prefix string) *RouteGroup

func (*RouteGroup) Register added in v0.8.6

func (r *RouteGroup) Register(handlers ...pyrin.Handler)

type Router added in v0.8.6

type Router struct {
	Routes []Route
}

func (*Router) AddRoute added in v0.8.6

func (r *Router) AddRoute(route Route)

func (*Router) Group added in v0.8.6

func (r *Router) Group(prefix string) pyrin.Group

type Server

type Server struct {
	ErrorTypes       []string          `json:"errorTypes"`
	Types            []Type            `json:"types"`
	ApiEndpoints     []ApiEndpoint     `json:"apiEndpoints"`
	FormApiEndpoints []FormApiEndpoint `json:"formApiEndpoints"`
	NormalEndpoints  []NormalEndpoint  `json:"normalEndpoints"`
}

func GenerateSpec added in v0.8.6

func GenerateSpec(routes []Route) (*Server, error)

type Type

type Type struct {
	Name   string      `json:"name"`
	Extend string      `json:"extend"`
	Fields []TypeField `json:"fields"`
}

type TypeField

type TypeField struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Omit bool   `json:"omit"`
}

Jump to

Keyboard shortcuts

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