dao

package
v0.0.0-...-a7b91b5 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAO

type DAO interface {
	// Create creates a project instance
	Create(ctx context.Context, project *models.Project) (int64, error)
	// Count returns the total count of projects according to the query
	Count(ctx context.Context, query *q.Query) (total int64, err error)
	// Delete deletes the project instance by id
	Delete(ctx context.Context, id int64) error
	// Get gets project instance by id
	Get(ctx context.Context, id int64) (*models.Project, error)
	// GetByName get project instance by name
	GetByName(ctx context.Context, name string) (*models.Project, error)
	// List lists projects
	List(ctx context.Context, query *q.Query) ([]*models.Project, error)
	// ListRoles the roles of user for the specific project
	ListRoles(ctx context.Context, projectID int64, userID int, groupIDs ...int) ([]int, error)
	// ListAdminRolesOfUser returns the roles of user for the all projects
	ListAdminRolesOfUser(ctx context.Context, user commonmodels.User) ([]models.Member, error)
}

DAO is the data access object interface for project

func New

func New() DAO

New returns an instance of the default DAO

Jump to

Keyboard shortcuts

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