data

package
v0.0.0-...-a7b145a Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusActive  = "active"
	StatusDisable = "disable"
	StatusDelete  = "delete"
)

Variables

ProviderSet provided NewData and NewEnt.

Functions

func NewBindRepo

func NewBindRepo(ctx context.Context, ec *ent.Client, cache cache.CacheInterface) biz.BindRepo

NewBindRepo creates a new data which is a biz.BindRepo.

func NewCache

NewCache creates a new cache.

func NewEnt

func NewEnt(ctx context.Context, c *conf.Bootstrap) (*ent.Client, error)

NewEnt create an ent client.

func NewPolicyRepo

func NewPolicyRepo(ctx context.Context, ec *ent.Client, cache cache.CacheInterface) biz.PolicyRepo

NewPolicyRepo creates a new data which is a biz.PolicyRepo.

func NewRoleRepo

func NewRoleRepo(ctx context.Context, ec *ent.Client, cache cache.CacheInterface) biz.RoleRepo

NewRoleRepo creates a new data which is a biz.RoleRepo.

func NewTenantRepo

func NewTenantRepo(ctx context.Context, ec *ent.Client, cache cache.CacheInterface) biz.TenantRepo

NewTenantRepo creates a new data which is a biz.TenantRepo.

func NewUserRepo

func NewUserRepo(ctx context.Context, ec *ent.Client, cache cache.CacheInterface) biz.UserRepo

NewUserRepo creates a new data which is a biz.UserRepo.

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data handle db connection and implemented biz.EchoRepo.

func (*Data) CreateUser

func (r *Data) CreateUser(ctx context.Context, user *biz.User) (*biz.User, error)

CreateUser creates a new user.

func (*Data) Passwd

func (r *Data) Passwd(ctx context.Context, username string) (string, error)

func (*Data) Roles

func (r *Data) Roles(ctx context.Context, username string) ([]*biz.Role, error)

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

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