sessionservice

package
v0.0.0-...-e6e2e8d Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package sessionservice manages business logic layer of sessions.

Package sessionservice is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockRepo

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

MockRepo is a mock of Repo interface.

func NewMockRepo

func NewMockRepo(ctrl *gomock.Controller) *MockRepo

NewMockRepo creates a new mock instance.

func (*MockRepo) Create

Create mocks base method.

func (*MockRepo) EXPECT

func (m *MockRepo) EXPECT() *MockRepoMockRecorder

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

func (*MockRepo) Get

func (m *MockRepo) Get(ctx context.Context, id uuid.UUID) (domain.Session, error)

Get mocks base method.

type MockRepoMockRecorder

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

MockRepoMockRecorder is the mock recorder for MockRepo.

func (*MockRepoMockRecorder) Create

func (mr *MockRepoMockRecorder) Create(ctx, arg interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockRepoMockRecorder) Get

func (mr *MockRepoMockRecorder) Get(ctx, id interface{}) *gomock.Call

Get indicates an expected call of Get.

type Repo

type Repo interface {
	Create(ctx context.Context, arg domain.CreateSessionParams) (domain.Session, error)
	Get(ctx context.Context, id uuid.UUID) (domain.Session, error)
}

Repo provides data access layer interface needed by session service layer.

type Service

type Service struct {
	TokenMaker tokenpkg.Maker
	// contains filtered or unexported fields
}

Service facilitates session service layer logic.

func New

func New(sr Repo, config configpkg.Config, tm tokenpkg.Maker) (*Service, error)

New returns session service struct to manage session bussines logic.

func (*Service) Create

Create session and access token.

func (*Service) RenewAccessToken

func (s *Service) RenewAccessToken(ctx context.Context, refreshToken string) (string, time.Time, error)

RenewAccessToken verifies refresh token, renews access token and returns it.

Jump to

Keyboard shortcuts

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