Documentation ¶
Index ¶
- func AddOrgPermissionsToRoles(req *AddOrgPermissionsToRolesRequest) error
- func AddOrgRoleToUsers(req *AddOrgRoleToUsersRequest) error
- func AddRolesToUser(namespace string, orgID string, userID string, roleID ...string) error
- func AddUsersToCurrentOrganizationWithRoles(req *AddUsersToCurrentOrganizationWithRolesRequest) error
- func AddUsersToOrg(namespace string, orgID string, userIDs ...string) error
- func ClearOrgPermissionsFromRoles(req *ClearOrgPermissionsFromRolesRequest) error
- func ClearOrgUsers(namespace string, orgID string) error
- func ClearRolePerm(namespace string, orgID string, roleID string) error
- func ClearUserRole(namespace string, orgID string, userID string) error
- func ConvenientCreateOrg(req *CreateOrganizationConvenientRequest) error
- func ConvenientCreatePerm(req *CreatePermissionConvenientRequest) error
- func ConvenientCreateRole(req *CreateRoleConvenientRequest) error
- func ConvenientCreateUser(req *CreateUserConvenientRequest) (string, error)
- func CreateOrg(name string) (string, error)
- func CreateOrgRolesAndPermissionsConvenient(req *CreateOrgRolesAndPermissionsConvenientRequest) (string, error)
- func CreatePerm(namespace string, action string, desc string, resource string) error
- func CreatePermissions(req *CreatePermissionsRequest) ([]string, error)
- func CreateRole(namespace string, name string) error
- func CreateRolesAndPermissionsConvenient(req *CreateRolesAndPermissionsConvenientRequest) error
- func CreateRolesAndPermissionsNoRelationConvenient(req *CreateRolesAndPermissionsNoRelationConvenientRequest) ([]string, []string, error)
- func CreateUser(userName string, password string, expiredTime string) error
- func CreateUserAndAddRoles(req *CreateUserAndAddRolesRequest) (string, error)
- func DeleteNamespaceOrg(namespace string, id string) error
- func DeleteNamespaceUser(namespace string, userID string) error
- func DeleteOrg(id string) error
- func DeleteOrgRoleFromUsers(req *DeleteOrgRoleFromUsersQuery) error
- func DeleteOrgUsers(namespace string, orgID string, userIDs ...string) error
- func DeletePerm(namespace string, permID ...string) error
- func DeletePermissions(req *DeletePermissionsQuery) error
- func DeleteRole(namespace string, roleID string) error
- func DeleteRolePerm(namespace string, orgID string, roleID string, permID ...string) error
- func DeleteRoles(namespace string, ids string) error
- func DeleteUser(userID string) error
- func DeleteUserRole(namespace string, orgID string, userID string, roleID ...string) error
- func Destroy()
- func GetToken(userName string, pwd string, expireSec int64) (string, error)
- func Init(baseUrl string, timeoutSec time.Duration)
- func RoleAddPerm(namespace string, orgID string, roleID string, permID ...string) error
- func SetUserOrg(namespace string, userID string, orgID string) error
- func UpdateOrg(id string, name string) error
- func UpdatePerm(namespace string, id string, desc string, action string, resource string) error
- func UpdateRole(namespace string, id string, name string) error
- func UpdateRolePerms(namespace string, orgID string, roleID string, permID ...string) error
- func UpdateUser(id string, userName string, password string, expiredTime string) error
- func UpdateUserRole(namespace string, orgID string, userID string, roleID ...string) error
- type APIKeyInfo
- type AddOrgPermissionsToRoleRequest
- type AddOrgPermissionsToRolesRequest
- type AddOrgPermissionsToRolesResponse
- type AddOrgRoleToUsersRequest
- type AddOrgRolesToUserRequest
- type AddUsersToCurrentOrganizationWithRolesRequest
- type AddUsersToCurrentOrganizationWithRolesResponse
- type AddUsersToOrganizationRequest
- type CheckAPIKeyRequest
- type CheckAPIKeyResponse
- type CheckAccessTokenRequest
- type CheckAccessTokenResponse
- type ClearOrgPermissionsFromRoleRequest
- type ClearOrgPermissionsFromRolesRequest
- type ClearOrgPermissionsFromRolesResponse
- type ClearOrgRolesFromUserRequest
- type ClearUsersFromOrganizationQuery
- type CreateAPIKeyRequest
- type CreateAPIKeyResponse
- type CreateOrgRolesAndPermissionsConvenientRequest
- type CreateOrgRolesAndPermissionsConvenientResponse
- type CreateOrganizationConvenientRequest
- type CreateOrganizationRequest
- type CreateOrganizationResponse
- type CreatePermissionConvenientRequest
- type CreatePermissionRequest
- type CreatePermissionRequestNoNamespace
- type CreatePermissionsRequest
- type CreatePermissionsResponse
- type CreateRoleConvenientRequest
- type CreateRolePermissionsConvenientRequest
- type CreateRoleRequest
- type CreateRoleRequestNoNamespace
- type CreateRolesAndPermissionsConvenientRequest
- type CreateRolesAndPermissionsConvenientResponse
- type CreateRolesAndPermissionsNoRelationConvenientRequest
- type CreateRolesAndPermissionsNoRelationConvenientResponse
- type CreateUserAndAddRolesRequest
- type CreateUserAndAddRolesResponse
- type CreateUserConvenientRequest
- type CreateUserConvenientResponse
- type CreateUserRequest
- type DeleteAPIKeyQuery
- type DeleteOrgPermissionsFromRoleQuery
- type DeleteOrgRoleFromUsersQuery
- type DeleteOrgRolesFromUserQuery
- type DeleteOrganizationInNamespaceQuery
- type DeletePermissionQuery
- type DeletePermissionsQuery
- type DeleteRoleQuery
- type DeleteUserInNamespaceQuery
- type DeleteUsersFromOrganizationQuery
- type GetAPIKeysQuery
- type GetAPIKeysResponse
- type GetAccessTokenRequest
- type GetAccessTokenResponse
- type GetOrgPermissionsWithRolesQuery
- type GetOrgPermissionsWithRolesResponse
- type GetOrgRolesWithPermissionsQuery
- type GetOrgRolesWithPermissionsResponse
- type GetOrgRolesWithUsersQuery
- type GetOrgRolesWithUsersResponse
- type GetOrgUsersWithRolesQuery
- type GetOrgUsersWithRolesResponse
- type GetOrganizationsQuery
- type GetOrganizationsResponse
- type GetOrganizationsWithUsersQuery
- type GetOrganizationsWithUsersResponse
- type GetPermissionsByResourcesAndActionsRequest
- type GetPermissionsByResourcesAndActionsResponse
- type GetPermissionsQuery
- type GetPermissionsResponse
- type GetRolesQuery
- type GetRolesResponse
- type GetUserCurrentOrganizationQuery
- type GetUserCurrentOrganizationResponse
- type GetUsersInOrganizationQuery
- type GetUsersInOrganizationResponse
- type GetUsersQuery
- type GetUsersResponse
- type GetUsersWithOrganizationsQuery
- type GetUsersWithOrganizationsResponse
- type OrganizationInfo
- type OrganizationInfoWithUsers
- type PermissionInfo
- type PermissionInfoWithRoles
- type ResourceAndActionRequest
- type RoleIDAndPermissionIDsRequest
- type RoleInfo
- type RoleInfoWithPermissions
- type RoleInfoWithUsers
- type SetUserCurrentOrganizationRequest
- type UpdateOrgPermissionsOfRoleRequest
- type UpdateOrgRolesOfUserRequest
- type UpdateOrganizationRequest
- type UpdatePermissionRequest
- type UpdateRoleRequest
- type UpdateUserRequest
- type UserInfo
- type UserInfoWithOrganizations
- type UserInfoWithRoles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOrgPermissionsToRoles ¶
func AddOrgPermissionsToRoles(req *AddOrgPermissionsToRolesRequest) error
func AddOrgRoleToUsers ¶
func AddOrgRoleToUsers(req *AddOrgRoleToUsersRequest) error
func AddRolesToUser ¶
func AddUsersToCurrentOrganizationWithRoles ¶
func AddUsersToCurrentOrganizationWithRoles(req *AddUsersToCurrentOrganizationWithRolesRequest) error
func ClearOrgPermissionsFromRoles ¶
func ClearOrgPermissionsFromRoles(req *ClearOrgPermissionsFromRolesRequest) error
func ClearOrgUsers ¶
func ConvenientCreateOrg ¶
func ConvenientCreateOrg(req *CreateOrganizationConvenientRequest) error
func ConvenientCreatePerm ¶
func ConvenientCreatePerm(req *CreatePermissionConvenientRequest) error
func ConvenientCreateRole ¶
func ConvenientCreateRole(req *CreateRoleConvenientRequest) error
func ConvenientCreateUser ¶
func ConvenientCreateUser(req *CreateUserConvenientRequest) (string, error)
func CreateOrgRolesAndPermissionsConvenient ¶
func CreateOrgRolesAndPermissionsConvenient(req *CreateOrgRolesAndPermissionsConvenientRequest) (string, error)
func CreatePerm ¶
func CreatePermissions ¶
func CreatePermissions(req *CreatePermissionsRequest) ([]string, error)
func CreateRole ¶
func CreateRolesAndPermissionsConvenient ¶
func CreateRolesAndPermissionsConvenient(req *CreateRolesAndPermissionsConvenientRequest) error
func CreateRolesAndPermissionsNoRelationConvenient ¶
func CreateRolesAndPermissionsNoRelationConvenient(req *CreateRolesAndPermissionsNoRelationConvenientRequest) ([]string, []string, error)
func CreateUserAndAddRoles ¶
func CreateUserAndAddRoles(req *CreateUserAndAddRolesRequest) (string, error)
func DeleteNamespaceOrg ¶
func DeleteNamespaceUser ¶
func DeleteOrgRoleFromUsers ¶
func DeleteOrgRoleFromUsers(req *DeleteOrgRoleFromUsersQuery) error
func DeletePerm ¶
func DeletePermissions ¶
func DeletePermissions(req *DeletePermissionsQuery) error
func DeleteRole ¶
func DeleteRolePerm ¶
func DeleteRoles ¶
func DeleteUser ¶
func DeleteUserRole ¶
func RoleAddPerm ¶
func UpdatePerm ¶
func UpdateRolePerms ¶
func UpdateUser ¶
Types ¶
type APIKeyInfo ¶
type AddOrgPermissionsToRolesRequest ¶
type AddOrgPermissionsToRolesRequest struct { Namespace string `json:"namespace" binding:"required"` OrgID string `json:"orgId" binding:"required"` RoleIDsAndPermissionIDs []RoleIDAndPermissionIDsRequest `json:"roleIDsAndPermissionIDs" binding:"required"` }
type AddOrgPermissionsToRolesResponse ¶
type AddOrgPermissionsToRolesResponse struct {
// contains filtered or unexported fields
}
type AddUsersToCurrentOrganizationWithRolesRequest ¶
type AddUsersToCurrentOrganizationWithRolesRequest struct { AddUsersToOrganizationRequest RoleIDs string `json:"roleIds" binding:"required"` }
type AddUsersToCurrentOrganizationWithRolesResponse ¶
type AddUsersToCurrentOrganizationWithRolesResponse struct {
// contains filtered or unexported fields
}
type CheckAPIKeyRequest ¶
type CheckAPIKeyResponse ¶
type CheckAPIKeyResponse struct { OrgInfo OrganizationInfo `json:"orgInfo" binding:"required"` UserInfo UserInfoWithRoles `json:"userInfo" binding:"required"` // contains filtered or unexported fields }
type CheckAccessTokenRequest ¶
type CheckAccessTokenResponse ¶
type CheckAccessTokenResponse struct { UserInfo *UserInfoWithRoles `json:"userInfo"` // contains filtered or unexported fields }
type ClearOrgPermissionsFromRolesResponse ¶
type ClearOrgPermissionsFromRolesResponse struct {
// contains filtered or unexported fields
}
type CreateAPIKeyRequest ¶
type CreateAPIKeyResponse ¶
type CreateOrgRolesAndPermissionsConvenientRequest ¶
type CreateOrgRolesAndPermissionsConvenientRequest struct { CreateOrganizationRequest Namespace string `json:"namespace" binding:"required"` CreateRolesAndPermissions []CreateRolePermissionsConvenientRequest `json:"createRolesAndPermissions" binding:"required"` }
type CreateOrgRolesAndPermissionsConvenientResponse ¶
type CreateOrgRolesAndPermissionsConvenientResponse struct { ID string `json:"id"` // contains filtered or unexported fields }
type CreateOrganizationConvenientRequest ¶
type CreateOrganizationConvenientRequest struct { CreateOrganizationRequest Namespace string `json:"namespace" binding:"required"` CreateUsers []CreateUserRequest `json:"createUsers" binding:"required"` CreateRolesAndPermissions []CreateRolePermissionsConvenientRequest `json:"createRolesAndPermissions" binding:"required"` }
type CreateOrganizationRequest ¶
type CreateOrganizationRequest struct {
Name string `json:"name" binding:"required"`
}
type CreateOrganizationResponse ¶
type CreateOrganizationResponse struct { ID string `json:"id"` // contains filtered or unexported fields }
type CreatePermissionConvenientRequest ¶
type CreatePermissionConvenientRequest struct { CreatePermissionRequest AddToOrgID string `json:"addToOrgId" binding:"required"` AddToRoleIDs []string `json:"addToRoleIds" binding:"required"` }
type CreatePermissionRequest ¶
type CreatePermissionRequest struct { Namespace string `json:"namespace" binding:"required"` CreatePermissionRequestNoNamespace }
type CreatePermissionsRequest ¶
type CreatePermissionsRequest struct { Namespace string `json:"namespace" binding:"required"` Permissions []CreatePermissionRequestNoNamespace `json:"permissions" binding:"required"` }
type CreatePermissionsResponse ¶
type CreatePermissionsResponse struct { IDs []string `json:"ids"` // contains filtered or unexported fields }
type CreateRoleConvenientRequest ¶
type CreateRoleConvenientRequest struct { CreateRoleRequest Permissions []CreatePermissionRequestNoNamespace `json:"permissions" binding:"required"` AddToOrgID string `json:"addToOrgId" binding:"required"` AddToUserIDs []string `json:"addToUserIds" binding:"required"` }
type CreateRolePermissionsConvenientRequest ¶
type CreateRolePermissionsConvenientRequest struct { CreateRoleRequestNoNamespace Permissions []CreatePermissionRequestNoNamespace `json:"permissions" binding:"required"` }
type CreateRoleRequest ¶
type CreateRoleRequest struct { Namespace string `json:"namespace" binding:"required"` CreateRoleRequestNoNamespace }
type CreateRoleRequestNoNamespace ¶
type CreateRoleRequestNoNamespace struct {
Name string `json:"name" binding:"required"`
}
type CreateRolesAndPermissionsConvenientRequest ¶
type CreateRolesAndPermissionsConvenientRequest struct { Namespace string `json:"namespace" binding:"required"` AddToOrgID string `json:"addToOrgId" binding:"required"` CreateRolesAndPermissions []CreateRolePermissionsConvenientRequest `json:"createRolesAndPermissions" binding:"required"` }
type CreateRolesAndPermissionsConvenientResponse ¶
type CreateRolesAndPermissionsConvenientResponse struct {
// contains filtered or unexported fields
}
type CreateRolesAndPermissionsNoRelationConvenientRequest ¶
type CreateRolesAndPermissionsNoRelationConvenientRequest struct { Namespace string `json:"namespace" binding:"required"` Roles []CreateRoleRequestNoNamespace `json:"roles" binding:"required"` Permissions []CreatePermissionRequestNoNamespace `json:"permissions" binding:"required"` }
type CreateUserAndAddRolesRequest ¶
type CreateUserAndAddRolesRequest struct { CreateUserRequest Namespace string `json:"namespace" binding:"required"` OrgID string `json:"firstOrgId" binding:"required"` RoleIDs string `json:"roleIds" binding:"required"` }
type CreateUserAndAddRolesResponse ¶
type CreateUserAndAddRolesResponse struct { ID string `json:"id"` // contains filtered or unexported fields }
type CreateUserConvenientRequest ¶
type CreateUserConvenientRequest struct { CreateUserRequest Namespace string `json:"namespace" binding:"required"` FirstOrgID string `json:"firstOrgId" binding:"required"` CreateRolesAndPermissions []CreateRolePermissionsConvenientRequest `json:"createRolesAndPermissions" binding:"required"` }
type CreateUserConvenientResponse ¶
type CreateUserConvenientResponse struct { ID string `json:"id"` // contains filtered or unexported fields }
type CreateUserRequest ¶
type DeleteAPIKeyQuery ¶
type DeletePermissionQuery ¶
type DeletePermissionQuery struct {
Namespace string `form:"namespace" binding:"required"`
}
type DeletePermissionsQuery ¶
type DeleteRoleQuery ¶
type DeleteRoleQuery struct {
Namespace string `form:"namespace" binding:"required"`
}
type GetAPIKeysQuery ¶
type GetAPIKeysResponse ¶
type GetAPIKeysResponse struct { Infos []APIKeyInfo `json:"infos" binding:"required"` // contains filtered or unexported fields }
type GetAccessTokenRequest ¶
type GetAccessTokenResponse ¶
type GetAccessTokenResponse struct { AccessToken string `json:"accessToken"` // contains filtered or unexported fields }
type GetOrgPermissionsWithRolesQuery ¶
type GetOrgPermissionsWithRolesQuery struct { OrgID string `form:"orgId" binding:"required"` GetPermissionsQuery }
type GetOrgPermissionsWithRolesResponse ¶
type GetOrgPermissionsWithRolesResponse struct { PageNo int `json:"pageNo"` TotalCount int64 `json:"totalCount"` Infos []PermissionInfoWithRoles `json:"infos"` // contains filtered or unexported fields }
type GetOrgRolesWithPermissionsQuery ¶
type GetOrgRolesWithPermissionsQuery struct { OrgID string `form:"orgId" binding:"required"` GetRolesQuery }
type GetOrgRolesWithPermissionsResponse ¶
type GetOrgRolesWithPermissionsResponse struct { PageNo int `json:"pageNo"` TotalCount int64 `json:"totalCount"` Infos []RoleInfoWithPermissions `json:"infos"` // contains filtered or unexported fields }
type GetOrgRolesWithUsersQuery ¶
type GetOrgRolesWithUsersQuery struct { OrgID string `form:"orgId" binding:"required"` GetRolesQuery }
type GetOrgRolesWithUsersResponse ¶
type GetOrgRolesWithUsersResponse struct { PageNo int `json:"pageNo"` TotalCount int64 `json:"totalCount"` Infos []RoleInfoWithUsers `json:"infos"` // contains filtered or unexported fields }
type GetOrgUsersWithRolesQuery ¶
type GetOrgUsersWithRolesQuery struct { Namespace string `form:"namespace" binding:"required"` OrgID string `form:"orgId" binding:"required"` GetUsersQuery }
type GetOrgUsersWithRolesResponse ¶
type GetOrgUsersWithRolesResponse struct { PageNo int `json:"pageNo"` TotalCount int64 `json:"totalCount"` Infos []UserInfoWithRoles `json:"infos"` // contains filtered or unexported fields }
type GetOrganizationsQuery ¶
type GetOrganizationsResponse ¶
type GetOrganizationsResponse struct { PageNo int `json:"pageNo"` TotalCount int64 `json:"totalCount"` Infos []OrganizationInfo `json:"infos"` // contains filtered or unexported fields }
type GetOrganizationsWithUsersQuery ¶
type GetOrganizationsWithUsersQuery struct { Namespace string `form:"namespace" binding:"required"` GetOrganizationsQuery }
type GetOrganizationsWithUsersResponse ¶
type GetOrganizationsWithUsersResponse struct { PageNo int `json:"pageNo"` TotalCount int64 `json:"totalCount"` Infos []OrganizationInfoWithUsers `json:"infos"` // contains filtered or unexported fields }
type GetPermissionsByResourcesAndActionsRequest ¶
type GetPermissionsByResourcesAndActionsRequest struct { Namespace string `json:"namespace" binding:"required"` ResourcesAndActions []ResourceAndActionRequest `json:"resourcesAndActions" binding:"required"` }
type GetPermissionsByResourcesAndActionsResponse ¶
type GetPermissionsByResourcesAndActionsResponse struct { Infos []PermissionInfo `json:"infos"` // contains filtered or unexported fields }
type GetPermissionsQuery ¶
type GetPermissionsResponse ¶
type GetPermissionsResponse struct { PageNo int `json:"pageNo"` TotalCount int64 `json:"totalCount"` Infos []PermissionInfo `json:"infos"` // contains filtered or unexported fields }
type GetRolesQuery ¶
type GetRolesResponse ¶
type GetUserCurrentOrganizationResponse ¶
type GetUserCurrentOrganizationResponse struct { OrgInfo *OrganizationInfo // contains filtered or unexported fields }
type GetUsersQuery ¶
type GetUsersResponse ¶
type GetUsersWithOrganizationsQuery ¶
type GetUsersWithOrganizationsQuery struct { Namespace string `form:"namespace" binding:"required"` GetUsersQuery }
type GetUsersWithOrganizationsResponse ¶
type GetUsersWithOrganizationsResponse struct { PageNo int `json:"pageNo"` TotalCount int64 `json:"totalCount"` Infos []UserInfoWithOrganizations `json:"infos"` // contains filtered or unexported fields }
type OrganizationInfo ¶
func GetOrgByID ¶
func GetOrgByID(id string) (*OrganizationInfo, error)
func GetUserCurOrg ¶
func GetUserCurOrg(namespace string, userID string) (*OrganizationInfo, error)
type OrganizationInfoWithUsers ¶
type OrganizationInfoWithUsers struct { ID string `json:"id"` Name string `json:"name"` UserInfos []UserInfo `json:"userInfos"` }
func GetOrgWithUsers ¶
type PermissionInfo ¶
type PermissionInfo struct { ID string `json:"id"` Resource string `json:"resource"` Action string `json:"action"` Describe string `json:"describe"` }
func GetPermissionsByResourcesAndActions ¶
func GetPermissionsByResourcesAndActions(req *GetPermissionsByResourcesAndActionsRequest) ([]PermissionInfo, error)
type PermissionInfoWithRoles ¶
type RoleInfoWithPermissions ¶
type RoleInfoWithPermissions struct { ID string `json:"id"` Name string `json:"name"` OrgInfo *OrganizationInfo `json:"orgInfo"` PermissionInfos []PermissionInfo `json:"permissionInfos"` }
type RoleInfoWithUsers ¶
type RoleInfoWithUsers struct { ID string `json:"id"` Name string `json:"name"` OrgInfo *OrganizationInfo `json:"orgInfo"` UserInfos []UserInfo `json:"userInfos"` }
type UpdatePermissionRequest ¶
type UpdateRoleRequest ¶
type UpdateUserRequest ¶
type UserInfo ¶
func GetUserByID ¶
func GetUsersInOrganization ¶
func GetUsersInOrganization(namespace string, req *GetUsersInOrganizationQuery) ([]UserInfo, int64, error)
type UserInfoWithOrganizations ¶
type UserInfoWithOrganizations struct { ID string `json:"id"` UserName string `json:"userName"` OrgInfos []OrganizationInfo `json:"orgInfos"` }
func GetUserJoinedOrg ¶
type UserInfoWithRoles ¶
type UserInfoWithRoles struct { ID string `json:"id"` UserName string `json:"userName"` OrgInfo *OrganizationInfo `json:"orgInfo"` RoleInfos []RoleInfo `json:"roleInfos"` }
func CheckToken ¶
Click to show internal directories.
Click to hide internal directories.