validation

package
v0.0.0-beta.1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderServiceID   = "X-Kusk-Service-ID"
	HeaderOperationID = "X-Kusk-Operation-ID"
)

Variables

This section is empty.

Functions

func GenerateOperationID

func GenerateOperationID(method, path string) string

GenerateOperationID generates a unique, deterministic ID for a given API route, safe to be used in a HTTP header value.

func GenerateServiceID

func GenerateServiceID(hostname string, port uint32) string

GenerateServiceID generates a unique, deterministic ID for a given API service, safe to be used in a HTTP header value.

Types

type Error

type Error struct {
	Errors []string `json:"errors"`
}

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy() *Proxy

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Proxy) UpdateServices

func (p *Proxy) UpdateServices(services []*Service)

type Service

type Service struct {
	ID string

	Host string
	Port uint32

	Spec       *openapi3.T
	Opts       *options.Options
	Router     routers.Router
	Operations map[string]*operation
}

func NewService

func NewService(id string, host string, port uint32, s *openapi3.T, opts *options.Options) (*Service, error)

Jump to

Keyboard shortcuts

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