server

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package server contains the server functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOpenAPISpec

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

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

type APIKey struct {
	Name string
}

APIKey is a struct that represents an API Key security scheme

func (*APIKey) Scheme

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

Scheme returns the API Key security scheme

type Basic

type Basic struct {
	Username string
	Password string
}

Basic is a struct that represents a Basic Auth security scheme

func (*Basic) Scheme

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

Scheme returns the Basic Auth security scheme

type OAuth2

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

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

Scheme returns the OAuth2 security scheme

type OpenID

type OpenID struct {
	ConnectURL string
}

OpenID is a struct that represents an OpenID Connect security scheme

func (*OpenID) Scheme

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) *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