Documentation
¶
Overview ¶
Package server provides HTTP server functionality for sql-http-proxy.
The mutation handler is one unit with the base handler in handler.go: it assembles a baseHandler field by field. See the namespace note there.
The query handler is one unit with the base handler in handler.go: it assembles a baseHandler field by field. See the namespace note there.
server.go is the unit this package is named for: it assembles the router from the configuration, and the API is read as server.NewServeMux without a prefix.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HandlerExecutor ¶ added in v0.1.2
type HandlerExecutor[R any] interface { Execute(ctx context.Context, params map[string]any, opts executor.Options) (*R, error) }
HandlerExecutor is the handler-side interface for query/mutation executors.
type HandlerResultProcessor ¶ added in v0.1.2
type HandlerResultProcessor[R any] interface { // BuildResponse returns (status, output, responseHeader) from the result. BuildResponse(result *R) (status int, output any, headers http.Header) }
HandlerResultProcessor handles result-specific response building.
type MutationHandler ¶
type MutationHandler = baseHandler[executor.MutationResult]
MutationHandler handles HTTP requests for mutations.
func NewMutationHandler ¶
NewMutationHandler creates a new MutationHandler. db can be nil if mock is configured.
type QueryHandler ¶
type QueryHandler = baseHandler[executor.ExecuteResult]
QueryHandler handles HTTP requests for queries.
func NewQueryHandler ¶
NewQueryHandler creates a new QueryHandler. db can be nil if mock is configured.