Documentation ¶
Index ¶
- func StaticFilePatternReplaceMiddleware(oldnew ...string) func(c *gin.Context)
- type Server
- func (s *Server) Handler(ctx context.Context) http.Handler
- func (s *Server) ListenAndServe() error
- func (s *Server) SetDashboardAPIPathPrefix(dashboardAPIPathPrefix string)
- func (s *Server) SetDashboardPathPrefix(dashboardPathPrefix string)
- func (s *Server) SetDashboardSentryDSN(dashboardSentryDSN string)
- func (s *Server) SetEditorPathPrefix(editorPathPrefix string)
- func (s *Server) SetMaxBodyBytes(max int64)
- func (s *Server) WithAuth(authProvider func(*http.Request) (string, error))
- func (s *Server) WithCustomMiddlewares(customMiddlewares ...gin.HandlerFunc)
- type StatsIn
- type StatsOut
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StaticFilePatternReplaceMiddleware ¶ added in v1.2.1
StaticFilePatternReplaceMiddleware is a middleware that modifies the response body with a given replace pattern Used inside utask to change response body of static files at flight, to customize path prefixes.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps the http handler that exposes a REST API to control the task orchestration engine
func (*Server) ListenAndServe ¶
ListenAndServe launches an http server and stays blocked until the server is shut down by a system signal
func (*Server) SetDashboardAPIPathPrefix ¶ added in v1.2.1
SetDashboardAPIPathPrefix configures a custom path prefix that UI should use when calling utask API. Required when utask API is exposed behind a ProxyPass and UI need to know the absolute URI to call.
func (*Server) SetDashboardPathPrefix ¶ added in v1.2.1
SetDashboardPathPrefix configures the custom path prefix for dashboard static files hosting. It doesn't change the path used by utask API to serve the files, it's only used inside UI files in order that dashboard can be aware of a ProxyPass configuration.
func (*Server) SetDashboardSentryDSN ¶ added in v1.5.0
SetDashboardSentryDSN configures a Sentry DSN URI to send UI exceptions and failures to.
func (*Server) SetEditorPathPrefix ¶ added in v1.2.1
SetEditorPathPrefix configures a custom path prefix for editor static files hosting. It doesn't change the path used by utask API to serve the files, it's only used inside UI files in order that editor can be aware of a ProxyPass configuration.
func (*Server) SetMaxBodyBytes ¶ added in v1.5.1
SetMaxBodyBytes
func (*Server) WithAuth ¶
WithAuth configures the Server's auth middleware it receives an authProvider function capable of extracting a caller's identity from an *http.Request the authProvider function also has discretion to deny authorization for a request by returning an error
func (*Server) WithCustomMiddlewares ¶ added in v1.8.3
func (s *Server) WithCustomMiddlewares(customMiddlewares ...gin.HandlerFunc)
WithCustomMiddlewares sets an array of customized gin middlewares. It helps for init plugins to include these customized middlewares in the api server