member

package
v0.0.0-...-e417875 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

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

func NewController

func NewController() Controller

NewController ...

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

type User

type User struct {
	UserID   int    `json:"user_id"`
	Username string `json:"username"`
}

User ...

type UserGroup

type UserGroup struct {
	ID          int    `json:"id,omitempty"`
	GroupName   string `json:"group_name,omitempty"`
	GroupType   int    `json:"group_type,omitempty"`
	LdapGroupDN string `json:"ldap_group_dn,omitempty"`
}

UserGroup ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL