Documentation
¶
Index ¶
Constants ¶
View Source
const ( AwsGatewayLambda = "aws-gateway-v1" AwsGatewayV2Lambda = "aws-gateway-v2" Https = "https" Http = "http" )
Variables ¶
This section is empty.
Functions ¶
func AddFilter ¶ added in v0.1.15
func AddFilter(filter ConnectionLogFilter)
AddFilter allows adding a new logFilter to the filters slice. This can be used to dynamically add filters for log messages to ignore.
Types ¶
type ConnectionLogFilter ¶ added in v0.1.15
ConnectionLogFilter defines a function type that takes a string as input and returns a boolean. It is used to filter connection logs based on specific criteria, where the input string typically represents a log entry or a related identifier.
type ListenAndServeFunc ¶ added in v0.1.9
func AWSGatewayLambdaListener ¶ added in v0.1.9
func AWSGatewayLambdaListener() ListenAndServeFunc
func AWSGatewayV2LambdaListener ¶ added in v0.1.9
func AWSGatewayV2LambdaListener() ListenAndServeFunc
func HTTPListener ¶ added in v0.1.9
func HTTPListener() ListenAndServeFunc
func TLSListener ¶ added in v0.1.9
func TLSListener(readTimeout, writeTimeout, idleTimeout time.Duration, tlsProvider func() *tls.Config) ListenAndServeFunc
type Middleware ¶ added in v0.1.7
Middleware abstraction
type Server ¶
type Server interface {
// Router returns the underlying router instance used by the server.
Router() interface{}
// WithAddress sets the server's address and returns the updated Server instance.
WithAddress(addr string) Server
// WithListener sets a custom listener function for the server and returns the updated Server instance.
WithListener(l ListenAndServeFunc) Server
// WithMiddleware adds middleware to the server and returns the updated Server instance.
// NOTE: Middlware must be added before APIs
WithMiddleware(m ...Middleware) Server
// WithAPIs registers APIs with the server and returns the updated Server instance.
WithAPIs(apis ...API) Server
// Run starts the server and blocks until the context is canceled.
Run(ctx context.Context)
}
Server represents a configurable HTTP server interface. It provides methods to set up the server's address, listener, middleware, APIs, and to run the server.
func New ¶
func New( ver *ServerVersion, ) Server
Click to show internal directories.
Click to hide internal directories.