server

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	validation.Validatable `json:"-"`
	Name                   string           `json:"name"          yaml:"Name"`
	Method                 http.Method      `json:"method"        yaml:"Method"`
	Path                   string           `json:"path"          yaml:"Path"`
	Description            string           `json:"description"   yaml:"Description"`
	Documentation          string           `json:"documentation" yaml:"Documentation"`
	Deprecated             string           `json:"deprecated"    yaml:"Deprecated"`
	Labels                 data.Map[string] `json:"labels"        yaml:"Labels"`
	IsPublic               bool             `json:"is_public"     yaml:"IsPublic"`
	IsStatic               bool             `json:"is_static"     yaml:"IsStatic"`
	Request                data.IModel      `json:"request"       yaml:"Request"`
	Response               data.IModel      `json:"response"      yaml:"Response"`
	Handlers               []HandlerFn      `json:"-"`
}

Endpoint represents the http server endpoint.

func (*Endpoint) Validate

func (e *Endpoint) Validate() error

Validate makes Endpoint validatable by implementing validation.Validatable interface.

type Endpoints

type Endpoints []*Endpoint

Endpoints represents the http server endpoints.

func (Endpoints) Validate added in v1.2.3

func (e Endpoints) Validate() error

Validate makes Endpoints validatable by implementing validation.Validatable interface.

type HandlerFn added in v1.2.4

type HandlerFn func(IContext) error

HandlerFn represents the http server endpoint handler.

type IContext added in v1.2.2

type IContext interface {
	// Validate makes Endpoint validatable by implementing [validation.Validatable] interface.
	Validate() error
}

IContext represents the http server request context.

Jump to

Keyboard shortcuts

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