Documentation ¶
Index ¶
- func StaticFilePatternReplaceMiddleware(oldnew ...string) func(c *gin.Context)
- type PluginRoute
- type PluginRouterGroup
- type Server
- func (s *Server) Handler(ctx context.Context) http.Handler
- func (s *Server) ListenAndServe() error
- func (s *Server) RegisterPluginRoutes(group PluginRouterGroup) 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)
- func (s *Server) WithGroupAuth(groupAuthProvider func(*http.Request) (string, []string, error))
- 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 PluginRoute ¶ added in v1.20.0
type PluginRoute struct { Secured bool Maintenance bool Path string Method string Infos []fizz.OperationOption Handlers []gin.HandlerFunc }
type PluginRouterGroup ¶ added in v1.20.0
type PluginRouterGroup struct { Path string Name string Description string Routes []PluginRoute }
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) RegisterPluginRoutes ¶ added in v1.20.0
func (s *Server) RegisterPluginRoutes(group PluginRouterGroup) error
RegisterPluginRoutes allows plugins to register custom routes
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
func (*Server) WithGroupAuth ¶ added in v1.19.0
WithAuthGroup configures the Server's auth group middleware it receives an groupAuthProvider function capable of extracting the caller's groups and identity from an *http.Request the groupAuthProvider function also has discretion to deny authorization for a request by returning an error