Documentation ¶
Index ¶
- Variables
- func AllowCors() http.ServerResponseFunc
- func CasbinToContext() http.RequestFunc
- func CheckAuthMiddleware(logger log.Logger) endpoint.Middleware
- func CookieToContext() http.RequestFunc
- func CronJobMiddleware(logger log.Logger, cronjobRepository repository.CronjobRepository, ...) endpoint.Middleware
- func GroupIdToContext() http.RequestFunc
- func NamespaceMiddleware(logger log.Logger) endpoint.Middleware
- func NamespaceToContext() http.RequestFunc
- func NewEnforcer(subject string, object interface{}, action string) endpoint.Middleware
- func ProjectMiddleware(logger log.Logger, projectRepository repository.ProjectRepository, ...) endpoint.Middleware
- func RequestIdToContext() http.RequestFunc
- func RequestIdToResponse() http.ServerResponseFunc
- type ASDContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProjectNotExists = errors.New("项目可能不存在") ErrCronJobNotExists = errors.New("定时任务可能不存在") ErrNotPermission = errors.New("没有权限") ErrCheckPermissionFailed = errors.New("校验权限失败") )
View Source
var ErrorASD = errors.New("权限验证失败!")
Functions ¶
func AllowCors ¶
func AllowCors() http.ServerResponseFunc
func CasbinToContext ¶
func CasbinToContext() http.RequestFunc
func CheckAuthMiddleware ¶
func CheckAuthMiddleware(logger log.Logger) endpoint.Middleware
func CookieToContext ¶
func CookieToContext() http.RequestFunc
func CronJobMiddleware ¶
func CronJobMiddleware(logger log.Logger, cronjobRepository repository.CronjobRepository, groupsRepository repository.GroupsRepository) endpoint.Middleware
func GroupIdToContext ¶
func GroupIdToContext() http.RequestFunc
func NamespaceMiddleware ¶
func NamespaceMiddleware(logger log.Logger) endpoint.Middleware
func NamespaceToContext ¶
func NamespaceToContext() http.RequestFunc
func NewEnforcer ¶
func NewEnforcer( subject string, object interface{}, action string, ) endpoint.Middleware
func ProjectMiddleware ¶
func ProjectMiddleware(logger log.Logger, projectRepository repository.ProjectRepository, groupsRepository repository.GroupsRepository) endpoint.Middleware
func RequestIdToContext ¶
func RequestIdToContext() http.RequestFunc
func RequestIdToResponse ¶
func RequestIdToResponse() http.ServerResponseFunc
Types ¶
type ASDContext ¶
type ASDContext string
const ( UserIdContext ASDContext = "userId" EmailContext ASDContext = "email" NamespaceContext ASDContext = "namespace" NameContext ASDContext = "name" RoleIdsContext ASDContext = "roleIds" GroupIdsContext ASDContext = "groupIds" NamespacesContext ASDContext = "namespaces" ProjectContext ASDContext = "project" GroupIdContext ASDContext = "groupId" IsAdmin ASDContext = "isAdmin" CronJobContext ASDContext = "cronJob" StartTime ASDContext = "start-time" )
Click to show internal directories.
Click to hide internal directories.