Documentation
¶
Index ¶
- Variables
- func BootstrapLogger(level slog.Level, format LoggingFormat, colorize bool) *slog.Logger
- func CorsMiddleware(origin string) alice.Constructor
- func LoggingMiddleware(logger *slog.Logger) alice.Constructor
- func RequestIdMiddleware() alice.Constructor
- func RootMiddleware(logger *slog.Logger, origin string) alice.Chain
- type LoggingFormat
- type RequestLoggerContextKey
- type SampleHandler
- type Server
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var RequestIDHeader = "X-Request-ID"
Functions ¶
func BootstrapLogger ¶
func CorsMiddleware ¶
func CorsMiddleware(origin string) alice.Constructor
func LoggingMiddleware ¶
func LoggingMiddleware(logger *slog.Logger) alice.Constructor
func RequestIdMiddleware ¶
func RequestIdMiddleware() alice.Constructor
Types ¶
type LoggingFormat ¶
type LoggingFormat string
const ( JSONFormat LoggingFormat = "json" TextFormat LoggingFormat = "text" )
type RequestLoggerContextKey ¶
type RequestLoggerContextKey string
const RequestLoggerKey RequestLoggerContextKey = "logger"
type SampleHandler ¶
type SampleHandler struct{}
func (*SampleHandler) SampleMethod ¶
func (h *SampleHandler) SampleMethod(ctx context.Context, req *connect.Request[v1.SampleRequest]) (*connect.Response[v1.SampleResponse], error)
type Server ¶
type Server struct { Addr string // contains filtered or unexported fields }
func NewServer ¶
func NewServer(cfg ServerConfig) *Server
func (*Server) MountHandlers ¶
func (s *Server) MountHandlers()
Click to show internal directories.
Click to hide internal directories.