Documentation
¶
Index ¶
Constants ¶
const (
StatusRequestContextCanceled = 499
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RestApi ¶
type RestApi struct {
// contains filtered or unexported fields
}
RestApi represents a RESTful API server encapsulating an HTTP server, router, and static page configuration.
func NewRestApi ¶
func NewRestApi(conf config.StaticPagesConfig) *RestApi
NewRestApi initializes and returns a new RestApi instance configured with the provided StaticPagesConfig.
func (*RestApi) Serve ¶
Serve starts the REST API Server on the specified address and returns a humane.Error if any issue occurs during startup.
func (*RestApi) ServeAsync ¶
ServeAsync starts the REST API server asynchronously on the specified address by calling Serve within a goroutine. If the server fails to start, it logs a fatal error with contextual details including error advice and cause.
func (*RestApi) Shutdown ¶
Shutdown gracefully stops the proxy server if it is running, releasing any resources and handling in-progress requests. It returns a humane.Error if the server fails to stop.
func (*RestApi) UploadHandler ¶
UploadHandler handles file upload requests, processes uploaded content, and returns a corresponding HTTP response.