dao

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGroupNameDup = errors.ConflictError(nil).WithMessage("duplicated user group name")

ErrGroupNameDup ...

Functions

This section is empty.

Types

type DAO

type DAO interface {
	// Add add user group
	Add(ctx context.Context, userGroup model.UserGroup) (int, error)
	// Count query user group count
	Count(ctx context.Context, query *q.Query) (int64, error)
	// Query query user group
	Query(ctx context.Context, query *q.Query) ([]*model.UserGroup, error)
	// Get get user group by id
	Get(ctx context.Context, id int) (*model.UserGroup, error)
	// Delete delete user group by id
	Delete(ctx context.Context, id int) error
	// UpdateName update user group name
	UpdateName(ctx context.Context, id int, groupName string) error
	// ReadOrCreate create a user group or read existing one from db
	ReadOrCreate(ctx context.Context, g *model.UserGroup, keyAttribute string, combinedKeyAttributes ...string) (bool, int64, error)
}

DAO the dao for user group

func New

func New() DAO

New create user group DAO

Jump to

Keyboard shortcuts

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