server

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package server contains the server functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOpenAPISpec added in v0.6.0

func NewOpenAPISpec() (*openapi3.T, error)

NewOpenAPISpec creates a new OpenAPI 3.1.0 specification based on the configured go interfaces and the operation types appended within the individual handlers

func NewRouter added in v0.6.0

func NewRouter() (*route.Router, error)

NewRouter creates a wrapper router so that the echo server and OAS specification can be generated simultaneously

Types

type APIKey added in v0.6.0

type APIKey struct {
	Name string
}

APIKey is a struct that represents an API Key security scheme

func (*APIKey) Scheme added in v0.6.0

func (k *APIKey) Scheme() *openapi3.SecurityScheme

Scheme returns the API Key security scheme

type Basic added in v0.6.0

type Basic struct {
	Username string
	Password string
}

Basic is a struct that represents a Basic Auth security scheme

func (*Basic) Scheme added in v0.6.0

func (b *Basic) Scheme() *openapi3.SecurityScheme

Scheme returns the Basic Auth security scheme

type OAuth2 added in v0.6.0

type OAuth2 struct {
	AuthorizationURL string
	TokenURL         string
	RefreshURL       string
	Scopes           map[string]string
}

OAuth2 is a struct that represents an OAuth2 security scheme

func (*OAuth2) Scheme added in v0.6.0

func (i *OAuth2) Scheme() *openapi3.SecurityScheme

Scheme returns the OAuth2 security scheme

type OpenID added in v0.6.0

type OpenID struct {
	ConnectURL string
}

OpenID is a struct that represents an OpenID Connect security scheme

func (*OpenID) Scheme added in v0.6.0

func (i *OpenID) Scheme() *openapi3.SecurityScheme

Scheme returns the OpenID Connect security scheme

type Server

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

func NewServer

func NewServer(c config.Config, l *zap.SugaredLogger) *Server

NewServer returns a new Server configuration

func (*Server) AddHandler

func (s *Server) AddHandler(r handler)

AddHandler provides the ability to add additional HTTP handlers that process requests. The handler that is provided should have a Routes(*echo.Group) function, which allows the routes to be added to the server.

func (*Server) StartEchoServer

func (s *Server) StartEchoServer(ctx context.Context) error

StartEchoServer creates and starts the echo server with configured middleware and handlers

Jump to

Keyboard shortcuts

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