biztiphereth

package
v0.0.4-4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToLibAuthUserType added in v0.0.2

func ToLibAuthUserType(u pb.UserType) libauth.UserType

func ToLibAuthUserTypeList added in v0.0.2

func ToLibAuthUserTypeList(tl []pb.UserType) []libauth.UserType

func ToPBAccountPlatform added in v0.0.2

func ToPBAccountPlatform(p AccountPlatform) librarian.AccountPlatform

func ToPBUser added in v0.0.2

func ToPBUser(u User) pb.User

func ToPBUserList added in v0.0.2

func ToPBUserList(ul []*User) []*pb.User

func ToPBUserStatus added in v0.0.3

func ToPBUserStatus(s UserStatus) pb.UserStatus

func ToPBUserType added in v0.0.2

func ToPBUserType(u libauth.UserType) pb.UserType

Types

type AccessToken

type AccessToken string

type Account added in v0.0.2

type Account struct {
	InternalID        int64
	Platform          AccountPlatform
	PlatformAccountID string
	Name              string
	ProfileURL        string
	AvatarURL         string
}

type AccountPlatform added in v0.0.2

type AccountPlatform int
const (
	AccountPlatformUnspecified AccountPlatform = iota
	AccountPlatformSteam
)

func ToBizAccountPlatform added in v0.0.2

func ToBizAccountPlatform(p librarian.AccountPlatform) AccountPlatform

type Paging

type Paging struct {
	PageSize int
	PageNum  int
}

type PullAccountInfo added in v0.0.2

type PullAccountInfo struct {
	InternalID        int64
	Platform          AccountPlatform
	PlatformAccountID string
}

type RefreshToken

type RefreshToken string

type Tiphereth added in v0.0.2

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

func (*Tiphereth) AddUser added in v0.0.2

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

func (*Tiphereth) GetToken added in v0.0.2

func (t *Tiphereth) GetToken(ctx context.Context, user *User) (AccessToken, RefreshToken, *errors.Error)

func (*Tiphereth) LinkAccount added in v0.0.2

func (t *Tiphereth) LinkAccount(ctx context.Context, a Account) (*Account, *errors.Error)

func (*Tiphereth) ListUser added in v0.0.2

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

func (*Tiphereth) RefreshToken added in v0.0.2

func (t *Tiphereth) RefreshToken(ctx context.Context) (AccessToken, RefreshToken, *errors.Error)

func (*Tiphereth) UpdateUser added in v0.0.2

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

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)
	CreateAccount(context.Context, Account) error
	UpdateAccount(context.Context, Account) error
}

type User

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

type UserStatus

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

func ToBizUserStatus added in v0.0.2

func ToBizUserStatus(s pb.UserStatus) UserStatus

func ToBizUserStatusList added in v0.0.2

func ToBizUserStatusList(sl []pb.UserStatus) []UserStatus

Jump to

Keyboard shortcuts

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