jwt

package
v0.0.0-...-7208f07 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewOptions, NewImpl)

ProviderSet is a provider set for wire

Functions

This section is empty.

Types

type IJwt

type IJwt interface {
	NewToken(info *user.Profile) (string, error)

	ValidateToken(signedToken string) (claims *TokenClaims, err error)
}

IJwt declare a jwt factory functions

func NewImpl

func NewImpl(o *Options, logger *zap.Logger) (IJwt, error)

NewImpl return IJwt

type MockIJwt

type MockIJwt struct {
	mock.Mock
}

MockIJwt is an autogenerated mock type for the IJwt type

func NewMockIJwt

func NewMockIJwt(t mockConstructorTestingTNewMockIJwt) *MockIJwt

NewMockIJwt creates a new instance of MockIJwt. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockIJwt) NewToken

func (_m *MockIJwt) NewToken(info *user.Profile) (string, error)

NewToken provides a mock function with given fields: info

func (*MockIJwt) ValidateToken

func (_m *MockIJwt) ValidateToken(signedToken string) (*TokenClaims, error)

ValidateToken provides a mock function with given fields: signedToken

type Options

type Options struct {
	Project   string
	Signature string
}

Options declare jwt configuration

func NewOptions

func NewOptions(v *viper.Viper) (*Options, error)

NewOptions serve caller to create Options

type TokenClaims

type TokenClaims struct {
	ID uint64 `json:"id"`
	jwt.StandardClaims
}

TokenClaims declare custom claims

Jump to

Keyboard shortcuts

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