userinfo

package
v0.8.16 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccountError = fmt.Errorf("failed to retrieve account data")
)

Functions

This section is empty.

Types

type MockUserInfoRetriever

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

func (*MockUserInfoRetriever) GetUserInfo

func (ui *MockUserInfoRetriever) GetUserInfo(ctx context.Context, userId int32, accountId uint64) (*UserInfo, error)

func (*MockUserInfoRetriever) GetUserInfoWithoutAccountId added in v0.6.0

func (ui *MockUserInfoRetriever) GetUserInfoWithoutAccountId(ctx context.Context, userId int32) (*UserInfo, error)

func (*MockUserInfoRetriever) SetUserInfo

func (ui *MockUserInfoRetriever) SetUserInfo(ctx context.Context, accountId uint64, job string, jobGrade int32) error

type Params added in v0.8.0

type Params struct {
	fx.In

	LC     fx.Lifecycle
	DB     *sql.DB
	Config *config.Config
}

type UIRetriever

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

func (*UIRetriever) GetUserInfo

func (ui *UIRetriever) GetUserInfo(ctx context.Context, userId int32, accountId uint64) (*UserInfo, error)

func (*UIRetriever) GetUserInfoWithoutAccountId added in v0.6.0

func (ui *UIRetriever) GetUserInfoWithoutAccountId(ctx context.Context, userId int32) (*UserInfo, error)

func (*UIRetriever) SetUserInfo

func (ui *UIRetriever) SetUserInfo(ctx context.Context, accountId uint64, job string, jobGrade int32) error

type UserInfo

type UserInfo struct {
	Enabled bool
	AccId   uint64
	UserId  int32

	Job          string
	JobGrade     int32
	OrigJob      string
	OrigJobGrade int32

	Group     string
	SuperUser bool
}

func (*UserInfo) Equal

func (u *UserInfo) Equal(in *UserInfo) bool

type UserInfoRetriever

type UserInfoRetriever interface {
	GetUserInfo(ctx context.Context, userId int32, accountId uint64) (*UserInfo, error)
	GetUserInfoWithoutAccountId(ctx context.Context, userId int32) (*UserInfo, error)
	SetUserInfo(ctx context.Context, accountId uint64, job string, jobGrade int32) error
}

func NewMockUserInfoRetriever

func NewMockUserInfoRetriever(userInfo map[int32]*UserInfo) UserInfoRetriever

func NewUIRetriever

func NewUIRetriever(p Params) UserInfoRetriever

Jump to

Keyboard shortcuts

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