validation

package
v1.13.15 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

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

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 ErrorBody added in v1.2.4

type ErrorBody struct {
	Error string `json:"error,omitempty"`
}

func NewErrorBody added in v1.2.4

func NewErrorBody() *ErrorBody

func (*ErrorBody) SetErrorBody added in v1.2.4

func (e *ErrorBody) SetErrorBody(err error)

type Server added in v1.2.0

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

Server provides OpenAPI Validation and implements ext_proc GRPC service.

func NewServer added in v1.2.0

func NewServer() *Server

NewServer() creates new validation Server.

func (*Server) Process added in v1.2.0

func (*Server) Start added in v1.2.0

func (s *Server) Start(port string) error

Start starts the GRPC Server

func (*Server) UpdateServices added in v1.2.0

func (s *Server) UpdateServices(services []*Service)

UpdateServices adds or updates Services to the validation 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)

type ValidationUpdater added in v1.2.0

type ValidationUpdater interface {
	UpdateServices(services []*Service)
}

ValidationUpdater adds and updates Services to the validation service

Jump to

Keyboard shortcuts

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