service

package
v0.0.0-...-539b324 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func NewAuth

func NewAuth(cfg AuthConfig) Auth

func (Auth) CreateAccessToken

func (a Auth) CreateAccessToken(req param.LoginRequest) (param.LoginResponse, error)

func (Auth) CreateRefreshToken

func (a Auth) CreateRefreshToken(req param.LoginRequest) (param.LoginResponse, error)

func (Auth) ParseToken

func (a Auth) ParseToken(bearerToken string) (*Claims, error)

type AuthConfig

type AuthConfig struct {
	SignKey               string
	AccessExpirationTime  time.Duration
	RefreshExpirationTime time.Duration
	AccessSubject         string
	RefreshSubject        string
}

type Claims

type Claims struct {
	jwt.RegisteredClaims
	Number int64
}

func (Claims) Valid

func (c Claims) Valid() error

type Depository

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

func NewDepository

func NewDepository(r repository.Repository) *Depository

func (*Depository) CheckPass

TODO: should moved to auth service

func (*Depository) CreateAccount

func (*Depository) DeleteAccount

func (s *Depository) DeleteAccount(ctx context.Context, req param.DeleteAccountRequest) error

func (*Depository) TransferAmount

Jump to

Keyboard shortcuts

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