service

package
v0.0.0-...-c662a9e Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package service is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenRevocationFailed = errors.New("token revocation failed")
)

Functions

This section is empty.

Types

type JWTClaims

type JWTClaims struct {
	jwt.RegisteredClaims

	UserID string `json:"user_id"`
}

type MockUserTokenService

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

MockUserTokenService is a mock of UserTokenService interface.

func NewMockUserTokenService

func NewMockUserTokenService(ctrl *gomock.Controller) *MockUserTokenService

NewMockUserTokenService creates a new mock instance.

func (*MockUserTokenService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUserTokenService) GetUser

func (m *MockUserTokenService) GetUser(arg0 context.Context, arg1 string) (*model.User, error)

GetUser mocks base method.

func (*MockUserTokenService) Issue

func (m *MockUserTokenService) Issue(arg0 context.Context, arg1 *model.User) (string, string, error)

Issue mocks base method.

func (*MockUserTokenService) Refresh

func (m *MockUserTokenService) Refresh(arg0 context.Context, arg1 string) (string, string, error)

Refresh mocks base method.

func (*MockUserTokenService) Revoke

func (m *MockUserTokenService) Revoke(arg0 context.Context, arg1 string) error

Revoke mocks base method.

func (*MockUserTokenService) RevokeAll

func (m *MockUserTokenService) RevokeAll(arg0 context.Context, arg1 *model.User, arg2 *sql.Tx) error

RevokeAll mocks base method.

type MockUserTokenServiceMockRecorder

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

MockUserTokenServiceMockRecorder is the mock recorder for MockUserTokenService.

func (*MockUserTokenServiceMockRecorder) GetUser

func (mr *MockUserTokenServiceMockRecorder) GetUser(arg0, arg1 interface{}) *gomock.Call

GetUser indicates an expected call of GetUser.

func (*MockUserTokenServiceMockRecorder) Issue

func (mr *MockUserTokenServiceMockRecorder) Issue(arg0, arg1 interface{}) *gomock.Call

Issue indicates an expected call of Issue.

func (*MockUserTokenServiceMockRecorder) Refresh

func (mr *MockUserTokenServiceMockRecorder) Refresh(arg0, arg1 interface{}) *gomock.Call

Refresh indicates an expected call of Refresh.

func (*MockUserTokenServiceMockRecorder) Revoke

func (mr *MockUserTokenServiceMockRecorder) Revoke(arg0, arg1 interface{}) *gomock.Call

Revoke indicates an expected call of Revoke.

func (*MockUserTokenServiceMockRecorder) RevokeAll

func (mr *MockUserTokenServiceMockRecorder) RevokeAll(arg0, arg1, arg2 interface{}) *gomock.Call

RevokeAll indicates an expected call of RevokeAll.

type UserJWTTokenService

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

func NewJWTTokenService

func NewJWTTokenService(clock clockwork.Clock, db *sql.DB, accessTokenExpiresIn, refreshTokenExpiresIn time.Duration) *UserJWTTokenService

func (*UserJWTTokenService) GetUser

func (s *UserJWTTokenService) GetUser(ctx context.Context, accessToken string) (*model.User, error)

func (*UserJWTTokenService) Issue

func (s *UserJWTTokenService) Issue(ctx context.Context, user *model.User) (string, string, error)

func (*UserJWTTokenService) Refresh

func (s *UserJWTTokenService) Refresh(ctx context.Context, refreshToken string) (string, string, error)

func (*UserJWTTokenService) Revoke

func (s *UserJWTTokenService) Revoke(ctx context.Context, refreshToken string) error

func (*UserJWTTokenService) RevokeAll

func (s *UserJWTTokenService) RevokeAll(ctx context.Context, user *model.User, tx *sql.Tx) error

type UserTokenService

type UserTokenService interface {
	Issue(context.Context, *model.User) (string, string, error)
	Refresh(context.Context, string) (string, string, error)
	Revoke(context.Context, string) error
	RevokeAll(context.Context, *model.User, *sql.Tx) error
	GetUser(context.Context, string) (*model.User, error)
}

Jump to

Keyboard shortcuts

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