server

package
v0.0.0-...-838d3e3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNotFoundFunc

func GetNotFoundFunc() func(w http.ResponseWriter, r *http.Request)

GetNotFoundFunc is used to override the default 404 response which is a text only reply so that we can respond with the required JSON body.

func GetRequestErrorFunc

func GetRequestErrorFunc() func(w http.ResponseWriter, r *http.Request, err error)

GetRequestErrorFunc override default validation errors to allow for O-RAN specific struct

func GetResponseErrorFunc

func GetResponseErrorFunc() func(w http.ResponseWriter, r *http.Request, err error)

GetResponseErrorFunc override default internal server error to allow for O-RAN specific struct

func GracefulShutdown

func GracefulShutdown(srv *http.Server) error

GracefulShutdown allow graceful shutdown with timeout

func RunServer

func RunServer(ctx context.Context, address string, hwMgrAdaptor *adaptors.HwMgrAdaptorController) error

RunServer starts the API server and blocks until it terminates or context is canceled.

Types

type Middleware

type Middleware = func(http.Handler) http.Handler

func GetLogDurationFunc

func GetLogDurationFunc() Middleware

GetLogDurationFunc log time taken to complete a request.

func GetOpenAPIValidationFunc

func GetOpenAPIValidationFunc(swagger *openapi3.T) Middleware

GetOpenAPIValidationFunc to validate all incoming requests as specified in the spec

Directories

Path Synopsis
api
generated
Package generated provides primitives to interact with the openapi HTTP API.
Package generated provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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