Documentation ¶
Index ¶
- func WithBundle(diceBundle *bundle.Bundle)
- func WithDB(db *models.DBClient)
- func WithUCAuth(ucAuth *ucauth.UCUserAuth)
- func WrapHandler(handlerFunc ContextHandlerFunc) echo.HandlerFunc
- func WrapHandlerWithRepoCheck(handlerFunc ContextHandlerFunc) echo.HandlerFunc
- func WrapMiddlewareHandler(handlerFunc ContextHandlerFunc) echo.MiddlewareFunc
- type ApiData
- type Context
- func (c *Context) Abort(err error)
- func (c *Context) AbortWithData(code int, data interface{})
- func (c *Context) AbortWithStatus(code int, err ...error)
- func (c *Context) AbortWithString(code int, msg string)
- func (c *Context) BasicAuth() (username, password string, ok bool)
- func (c *Context) BindJSON(obj interface{}) error
- func (c *Context) CheckBranchOperatePermission(user *models.User, branch string) error
- func (c *Context) CheckPermission(permission models.Permission) error
- func (c *Context) CheckPermissionWithRole(permission models.Permission, resourceRoleList []string) error
- func (c *Context) Data(statusCode int, contentType string, buf []byte)
- func (c *Context) File(path string)
- func (c *Context) GetHeader(key string) string
- func (c *Context) GetQueryBool(key string, defaults ...bool) bool
- func (c *Context) GetQueryInt32(key string, defaults ...int) int
- func (c *Context) GetRequestBody() io.ReadCloser
- func (c *Context) GetWriter() io.Writer
- func (c *Context) Header(key string, value string)
- func (c *Context) Host() string
- func (c *Context) HttpRequest() *http.Request
- func (c *Context) MustGet(key string) interface{}
- func (c *Context) Next()
- func (c *Context) Param(key string) string
- func (c *Context) ParamInt32(key string, defaults ...int) int
- func (c *Context) Query(key string) string
- func (c *Context) Set(key string, value interface{})
- func (c *Context) Status(status int)
- func (c *Context) Success(data interface{}, userIDs ...[]string)
- type ContextHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithBundle ¶
func WithUCAuth ¶
func WithUCAuth(ucAuth *ucauth.UCUserAuth)
func WrapHandler ¶
func WrapHandler(handlerFunc ContextHandlerFunc) echo.HandlerFunc
func WrapHandlerWithRepoCheck ¶
func WrapHandlerWithRepoCheck(handlerFunc ContextHandlerFunc) echo.HandlerFunc
func WrapMiddlewareHandler ¶
func WrapMiddlewareHandler(handlerFunc ContextHandlerFunc) echo.MiddlewareFunc
Types ¶
type Context ¶
type Context struct { EchoContext echo.Context Repository *gitmodule.Repository User *models.User Service *models.Service DBClient *models.DBClient Bundle *bundle.Bundle UCAuth *ucauth.UCUserAuth // contains filtered or unexported fields }
func (*Context) AbortWithData ¶
func (*Context) AbortWithStatus ¶
func (*Context) AbortWithString ¶
func (*Context) CheckBranchOperatePermission ¶
func (*Context) CheckPermission ¶
func (c *Context) CheckPermission(permission models.Permission) error
func (*Context) CheckPermissionWithRole ¶
func (c *Context) CheckPermissionWithRole(permission models.Permission, resourceRoleList []string) error
func (*Context) GetRequestBody ¶
func (c *Context) GetRequestBody() io.ReadCloser
func (*Context) HttpRequest ¶
type ContextHandlerFunc ¶
type ContextHandlerFunc func(*Context)
Click to show internal directories.
Click to hide internal directories.