Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDuplicateProjectMember = errors.ConflictError(nil).WithMessage("The project member specified already exist")
ErrDuplicateProjectMember ...
View Source
var ErrInvalidRole = errors.BadRequestError(nil).WithMessage("Failed to update project member, role is not in 1,2,3")
ErrInvalidRole ...
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { // Get gets the project member with ID Get(ctx context.Context, projectNameOrID interface{}, memberID int) (*models.Member, error) // Create add project member to project Create(ctx context.Context, projectNameOrID interface{}, req Request) (int, error) // Delete member from project Delete(ctx context.Context, projectNameOrID interface{}, memberID int) error // List lists all project members with condition List(ctx context.Context, projectNameOrID interface{}, entityName string, query *q.Query) ([]*models.Member, error) // UpdateRole update the project member role UpdateRole(ctx context.Context, projectNameOrID interface{}, memberID int, role int) error // Count get the total amount of project members Count(ctx context.Context, projectNameOrID interface{}, query *q.Query) (int, error) // IsProjectAdmin judges if the user is a project admin of any project IsProjectAdmin(ctx context.Context, member commonmodels.User) (bool, error) }
Controller defines the operation related to project member
type Request ¶
type Request struct { ProjectID int64 `json:"project_id"` Role int `json:"role_id,omitempty"` MemberUser User `json:"member_user,omitempty"` MemberGroup UserGroup `json:"member_group,omitempty"` }
Request - Project Member Request
Click to show internal directories.
Click to hide internal directories.