biztiphereth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken string

type Paging

type Paging struct {
	PageSize int
	PageNum  int
}

type RefreshToken

type RefreshToken string

type TipherethRepo

type TipherethRepo interface {
	UserActive(context.Context, *User) (bool, error)
	FetchUserByPassword(context.Context, *User) (*User, error)
	AddUser(context.Context, *User) error
	UpdateUser(context.Context, *User) error
	ListUser(context.Context, Paging, []libauth.UserType, []UserStatus) ([]*User, error)
}

TipherethRepo is a User repo.

type TipherethUseCase

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

TipherethUseCase is a User use case.

func NewTipherethUseCase

func NewTipherethUseCase(repo TipherethRepo, auth *libauth.Auth,
	sClient searcher.LibrarianSearcherServiceClient) *TipherethUseCase

NewTipherethUseCase new a User use case.

func (*TipherethUseCase) AddUser

func (t *TipherethUseCase) AddUser(ctx context.Context, user *User) (*User, *errors.Error)

func (*TipherethUseCase) GetToken

func (*TipherethUseCase) ListUser

func (t *TipherethUseCase) ListUser(ctx context.Context,
	paging Paging, types []libauth.UserType, statuses []UserStatus) ([]*User, *errors.Error)

func (*TipherethUseCase) RefreshToken

func (*TipherethUseCase) UpdateUser

func (t *TipherethUseCase) UpdateUser(ctx context.Context, user *User) *errors.Error

type User

type User struct {
	InternalID int64
	UserName   string
	PassWord   string
	Type       libauth.UserType
	Status     UserStatus
}

User is a User model.

type UserStatus

type UserStatus int
const (
	UserStatusUnspecified UserStatus = iota
	UserStatusActive
	UserStatusBlocked
)

Jump to

Keyboard shortcuts

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