ogen_server

package
v0.0.0-...-7a62f64 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const EnvLogLevel = "LOG_LEVEL"

Variables

This section is empty.

Functions

func ErrorCode

func ErrorCode(err error) (code int)

func Run

func Run(f func(ctx context.Context, log *zap.Logger) error)

Run f until interrupt.

func SmithyErrorHandler

func SmithyErrorHandler(ctx context.Context, w http.ResponseWriter, r *http.Request, err error)

func SwaggerAPIv1Handler

func SwaggerAPIv1Handler(doc []byte) http.Handler

func SwaggerUIHandler

func SwaggerUIHandler() http.Handler

Types

type Metrics

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

Metrics wraps application metrics and providers.

func NewMetrics

func NewMetrics(addr, namespace string) (*Metrics, error)

NewMetrics returns new Metrics.

func (*Metrics) MeterProvider

func (m *Metrics) MeterProvider() metric.MeterProvider

func (*Metrics) Shutdown

func (m *Metrics) Shutdown(ctx context.Context) error

func (*Metrics) Start

func (m *Metrics) Start(ctx context.Context) error

func (*Metrics) Stop

func (m *Metrics) Stop(ctx context.Context) error

func (*Metrics) TracerProvider

func (m *Metrics) TracerProvider() trace.TracerProvider

type OgenServer

type OgenServer struct {
	Rest    *Rest
	Metrics *Metrics
}

func NewOgenServer

func NewOgenServer(r *Rest, m *Metrics) *OgenServer

func (*OgenServer) Start

func (s *OgenServer) Start(ctx context.Context) error

func (*OgenServer) Stop

func (s *OgenServer) Stop(ctx context.Context) error

type OgenServerConfig

type OgenServerConfig struct {
	Address         string
	MetricsAddress  string
	ApplicationName string
}

type Rest

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

func NewRest

func NewRest(srv *http.Server) *Rest

func (*Rest) Start

func (r *Rest) Start(ctx context.Context) error

func (*Rest) Stop

func (r *Rest) Stop(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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