Documentation ¶
Index ¶
- Variables
- type MysqlUserRepository
- func (r *MysqlUserRepository) ChangeRoleAttr(ctx context.Context, userID int64, attr string, val int64) error
- func (r *MysqlUserRepository) ChangeRoleExp(ctx context.Context, userID int64, exp int64) error
- func (r *MysqlUserRepository) Create(ctx context.Context, user *pb.User) (int64, error)
- func (r *MysqlUserRepository) CreateDevice(ctx context.Context, device *pb.Device) (int64, error)
- func (r *MysqlUserRepository) GetByID(ctx context.Context, id int64) (pb.User, error)
- func (r *MysqlUserRepository) GetByName(ctx context.Context, username string) (pb.User, error)
- func (r *MysqlUserRepository) GetDevice(ctx context.Context, id int64) (pb.Device, error)
- func (r *MysqlUserRepository) GetRole(ctx context.Context, userID int) (pb.Role, error)
- func (r *MysqlUserRepository) List(ctx context.Context) ([]*pb.User, error)
- func (r *MysqlUserRepository) ListDevice(ctx context.Context, userID int64) ([]*pb.Device, error)
- func (r *MysqlUserRepository) Update(ctx context.Context, user *pb.User) error
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewMysqlUserRepository)
Functions ¶
This section is empty.
Types ¶
type MysqlUserRepository ¶
type MysqlUserRepository struct {
// contains filtered or unexported fields
}
func (*MysqlUserRepository) ChangeRoleAttr ¶
func (*MysqlUserRepository) ChangeRoleExp ¶
func (*MysqlUserRepository) CreateDevice ¶ added in v0.2.1
func (*MysqlUserRepository) ListDevice ¶ added in v0.2.1
type UserRepository ¶
type UserRepository interface { GetRole(ctx context.Context, userID int) (pb.Role, error) ChangeRoleExp(ctx context.Context, userID int64, exp int64) error ChangeRoleAttr(ctx context.Context, userID int64, attr string, val int64) error List(ctx context.Context) ([]*pb.User, error) Create(ctx context.Context, user *pb.User) (int64, error) GetByID(ctx context.Context, id int64) (pb.User, error) GetByName(ctx context.Context, username string) (pb.User, error) Update(ctx context.Context, user *pb.User) error ListDevice(ctx context.Context, userID int64) ([]*pb.Device, error) CreateDevice(ctx context.Context, device *pb.Device) (int64, error) GetDevice(ctx context.Context, id int64) (pb.Device, error) }
func CreateUserRepository ¶
func CreateUserRepository(id string) (UserRepository, error)
func NewMysqlUserRepository ¶
Click to show internal directories.
Click to hide internal directories.