Documentation ¶
Index ¶
- func WithBundle(diceBundle *bundle.Bundle)
- func WithDB(db *models.DBClient)
- func WithEtcdClient(client *clientv3.Client)
- func WithI18n(i18n i18n.Translator)
- func WithOrgClient(org org.ClientInterface)
- func WithTokenService(tokenService *tokenpb.TokenServiceServer)
- func WithUCAuth(ucAuth *uc.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) GetOrg(orgID interface{}) (*orgpb.Org, error)
- func (c *Context) GetOrgByDomain(domain, userID string) (*orgpb.Org, error)
- 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 WithEtcdClient ¶
func WithI18n ¶
func WithI18n(i18n i18n.Translator)
func WithOrgClient ¶
func WithOrgClient(org org.ClientInterface)
func WithTokenService ¶
func WithTokenService(tokenService *tokenpb.TokenServiceServer)
func WithUCAuth ¶
func WithUCAuth(ucAuth *uc.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 *uc.UCUserAuth EtcdClient *clientv3.Client TokenService tokenpb.TokenServiceServer // 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) GetOrgByDomain ¶
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.