auth

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	GetToken() (TokenResponse, error)
	GetUserInfo() (UserInfo, error)
}

type AuthService

type AuthService struct {
	protos.UnimplementedAuthServiceServer
	// contains filtered or unexported fields
}

func NewAuthService

func NewAuthService(auth Auth) *AuthService

func (AuthService) GetToken

func (a AuthService) GetToken(ctx context.Context, empty *emptypb.Empty) (*protos.TokenResponse, error)

func (AuthService) GetUserInfo

func (a AuthService) GetUserInfo(ctx context.Context, empty *emptypb.Empty) (*protos.UserInfo, error)

type DefaultAuth

type DefaultAuth struct {
}

func (DefaultAuth) GetToken

func (d DefaultAuth) GetToken() (TokenResponse, error)

func (DefaultAuth) GetUserInfo

func (d DefaultAuth) GetUserInfo() (UserInfo, error)

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	RptToken     string `json:"rpt_token"`
}

type UserInfo

type UserInfo struct {
	Username string `json:"username"`
	Email    string `json:"email"`
}

Jump to

Keyboard shortcuts

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