userinfo

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockUserInfoRetriever

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

func NewMockUserInfoRetriever

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

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 UIRetriever

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

func NewUIRetriever

func NewUIRetriever(ctx context.Context, db *sql.DB, superUserGroups []string) *UIRetriever

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 {
	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
}

Jump to

Keyboard shortcuts

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