service

package
v0.0.0-...-b34744e Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(repository repo.UsersRepository, service *TokenService) pb.UsersServer

Types

type CustomClaims

type CustomClaims struct {
	User *pb.User
	jwt.StandardClaims
}

type TokenService

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

func NewTokenService

func NewTokenService(secret string) *TokenService

func (*TokenService) Decode

func (s *TokenService) Decode(token string) (*CustomClaims, error)

Decode a token string into a token object

func (*TokenService) Encode

func (s *TokenService) Encode(user *pb.User) (string, error)

Encode a claim into a JWT

type UsersService

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

func (*UsersService) Auth

func (u *UsersService) Auth(ctx context.Context, ser *pb.User) (*pb.Token, error)

func (*UsersService) Create

func (u *UsersService) Create(ctx context.Context, req *pb.User) (*pb.Response, error)

func (*UsersService) Get

func (u *UsersService) Get(ctx context.Context, req *pb.User) (*pb.Response, error)

func (*UsersService) GetAll

func (u *UsersService) GetAll(ctx context.Context, req *pb.GetRequest) (*pb.Response, error)

func (*UsersService) Update

func (u *UsersService) Update(ctx context.Context, req *pb.User) (*pb.Response, error)

func (*UsersService) ValidateToken

func (u *UsersService) ValidateToken(ctx context.Context, req *pb.Token) (*pb.Token, error)

Jump to

Keyboard shortcuts

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