Documentation ¶
Index ¶
- Constants
- func ConvertUserInfo(userInfo *UserInfo) *permission.User
- type Client
- func (c *Client) AddEnvRolePermission(productName, envName string, permissionUUIDs []string, roleID int, ...) (int, error)
- func (c *Client) AddProductTeam(productName string, teamID int, userIDs []int, log *zap.SugaredLogger) (int, error)
- func (c *Client) ContributorRoleExist(productName string, log *zap.SugaredLogger) bool
- func (c *Client) CreateContributorRole(product string, log *zap.SugaredLogger) error
- func (c *Client) CreateUserEnvPermission(p *UserEnvPermission) error
- func (c *Client) DeleteEnvRolePermission(productName, envName string, log *zap.SugaredLogger) (int, error)
- func (c *Client) DeleteProductTeam(productName string, log *zap.SugaredLogger) error
- func (c *Client) DeleteUserEnvPermission(productName, username string, userID int, log *zap.SugaredLogger) error
- func (c *Client) DeleteUserRole(roleID int64, roleType, userID int, productName string, log *zap.SugaredLogger) error
- func (c *Client) GetContributorRoleID(productName string, log *zap.SugaredLogger) int64
- func (c *Client) GetJiraInfo() (*JiraInfo, error)
- func (c *Client) GetOrganization(orgID int) (*Organization, error)
- func (c *Client) GetTeam(teamID int) (*Team, error)
- func (c *Client) GetUserEnvPermission(userID int, log *zap.SugaredLogger) ([]*UserEnv, error)
- func (c *Client) GetUserPermissionUUIDMap(productName, permissionUUID string, userID int, log *zap.SugaredLogger) (map[string]bool, error)
- func (c *Client) GetUserPermissionUUIDs(roleID int64, productName string, log *zap.SugaredLogger) ([]string, error)
- func (c *Client) GetUserProject(userID int, log *zap.SugaredLogger) (map[string][]int64, error)
- func (c *Client) HasOperatePermission(productName, permissionUUID string, userID int, isSuperUser bool, ...) bool
- func (c *Client) ListCodeHosts() ([]*CodeHost, error)
- func (c *Client) ListEnvRolePermission(productName, envName string, roleID int64, log *zap.SugaredLogger) ([]*EnvRolePermission, error)
- func (c *Client) ListFeatures() ([]string, error)
- func (c *Client) ListPermissionUsers(productName string, roleID int64, roleType int, log *zap.SugaredLogger) ([]int, error)
- func (c *Client) ListProductPermissionUsers(productName, permissionID string, log *zap.SugaredLogger) ([]string, error)
- func (c *Client) ListRoleEnvs(productName, envName string, roleID int64, log *zap.SugaredLogger) ([]*RoleEnv, error)
- func (c *Client) ListRolePermissions(roleID int64, roleType int, productName string, log *zap.SugaredLogger) ([]*RolePermission, error)
- func (c *Client) ListRoleProjects(roleID int64, log *zap.SugaredLogger) ([]*RoleProduct, error)
- func (c *Client) ListRoles(productName string, log *zap.SugaredLogger) (*Role, error)
- func (c *Client) ListTeams(orgID int, log *zap.SugaredLogger) ([]*Team, error)
- func (c *Client) ListUserEnvPermission(productName string, userID int, log *zap.SugaredLogger) ([]*UserEnv, error)
- func (c *Client) ListUserRoles(userID, roleType int, log *zap.SugaredLogger) ([]*UserRole, error)
- func (c *Client) SignatureCheck(username, token string) error
- func (c *Client) UpdateUserRole(roleID int64, roleType int, productName string, userIDList []int, ...) error
- type CodeHost
- type EnvRolePermission
- type JiraInfo
- type Organization
- type ResponseMessage
- type Role
- type RoleEnv
- type RolePermission
- type RolePermissionReq
- type RoleProduct
- type Team
- type UpdateUserRoleReq
- type User
- type UserEnv
- type UserEnvPermission
- type UserInfo
- type UserRole
Constants ¶
View Source
const ( GitLabProvider = "gitlab" GitHubProvider = "github" GerritProvider = "gerrit" )
View Source
const ( ProjectType = 2 AllUsersRoleName = "all-users" )
roleType
View Source
const (
DefaultOrganization = iota + 1
)
View Source
const (
ProjectOwner = 3
)
Variables ¶
This section is empty.
Functions ¶
func ConvertUserInfo ¶
func ConvertUserInfo(userInfo *UserInfo) *permission.User
Types ¶
type Client ¶
type Client struct { *httpclient.Client // contains filtered or unexported fields }
func (*Client) AddEnvRolePermission ¶
func (*Client) AddProductTeam ¶
func (*Client) ContributorRoleExist ¶
func (c *Client) ContributorRoleExist(productName string, log *zap.SugaredLogger) bool
func (*Client) CreateContributorRole ¶
func (c *Client) CreateContributorRole(product string, log *zap.SugaredLogger) error
func (*Client) CreateUserEnvPermission ¶
func (c *Client) CreateUserEnvPermission(p *UserEnvPermission) error
func (*Client) DeleteEnvRolePermission ¶
func (*Client) DeleteProductTeam ¶
func (c *Client) DeleteProductTeam(productName string, log *zap.SugaredLogger) error
func (*Client) DeleteUserEnvPermission ¶
func (*Client) DeleteUserRole ¶
func (*Client) GetContributorRoleID ¶
func (c *Client) GetContributorRoleID(productName string, log *zap.SugaredLogger) int64
func (*Client) GetJiraInfo ¶
func (*Client) GetOrganization ¶
func (c *Client) GetOrganization(orgID int) (*Organization, error)
func (*Client) GetUserEnvPermission ¶
func (*Client) GetUserPermissionUUIDMap ¶
func (*Client) GetUserPermissionUUIDs ¶
func (*Client) GetUserProject ¶
func (*Client) HasOperatePermission ¶
func (*Client) ListCodeHosts ¶
func (*Client) ListEnvRolePermission ¶
func (c *Client) ListEnvRolePermission(productName, envName string, roleID int64, log *zap.SugaredLogger) ([]*EnvRolePermission, error)
func (*Client) ListFeatures ¶
func (*Client) ListPermissionUsers ¶
func (*Client) ListProductPermissionUsers ¶
func (c *Client) ListProductPermissionUsers(productName, permissionID string, log *zap.SugaredLogger) ([]string, error)
ListProductPermissionUsers productName和permissionId为空时只返回所有管理员用户,不为空则返回所有管理员用户和有该权限的普通用户
func (*Client) ListRoleEnvs ¶
func (*Client) ListRolePermissions ¶
func (c *Client) ListRolePermissions(roleID int64, roleType int, productName string, log *zap.SugaredLogger) ([]*RolePermission, error)
func (*Client) ListRoleProjects ¶
func (c *Client) ListRoleProjects(roleID int64, log *zap.SugaredLogger) ([]*RoleProduct, error)
func (*Client) ListUserEnvPermission ¶
func (*Client) ListUserRoles ¶
func (*Client) SignatureCheck ¶
func (*Client) UpdateUserRole ¶
type CodeHost ¶
type CodeHost struct { ID int `json:"id"` OrgID int `json:"orgId"` Address string `json:"address"` Type string `json:"type"` AccessToken string `json:"accessToken"` Namespace string `json:"namespace"` Region string `json:"region"` AccessKey string `json:"applicationId"` SecretKey string `json:"clientSecret"` Username string `json:"username"` Password string `json:"password"` }
type EnvRolePermission ¶
type JiraInfo ¶
type JiraInfo struct { ID int64 `json:"id"` Host string `json:"host"` User string `json:"user"` AccessToken string `json:"accessToken"` OrganizationID int `json:"organizationId"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
func GetJiraInfo ¶
type Organization ¶
type ResponseMessage ¶
type RolePermission ¶
type RolePermissionReq ¶
type RoleProduct ¶
type UpdateUserRoleReq ¶
type UserEnvPermission ¶
type UserInfo ¶
type UserInfo struct { ID int `json:"id"` Name string `json:"name"` Email string `json:"email"` Password string `json:"password"` Phone string `json:"phone"` IsAdmin bool `json:"isAdmin"` IsSuperUser bool `json:"isSuperUser"` IsTeamLeader bool `json:"isTeamLeader"` OrganizationID int `json:"organization_id"` Directory string `json:"directory"` LastLoginAt int64 `json:"lastLogin"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
func GetUserDetailByToken ¶ added in v1.3.0
Click to show internal directories.
Click to hide internal directories.