Documentation ¶
Index ¶
- Variables
- type CreateCmd
- type FakeSessionBuilder
- type MockService
- func (_m *MockService) Create(ctx context.Context, input *CreateCmd) (*Session, error)
- func (_m *MockService) DeleteAllForUser(ctx context.Context, userID uuid.UUID) error
- func (_m *MockService) GetByAccessToken(ctx context.Context, access secret.Text) (*Session, error)
- func (_m *MockService) GetByRefreshToken(ctx context.Context, refresh secret.Text) (*Session, error)
- func (_m *MockService) RemoveByAccessToken(ctx context.Context, access secret.Text) error
- func (_m *MockService) RemoveByRefreshToken(ctx context.Context, refresh secret.Text) error
- type Service
- type Session
- func (s *Session) AccessCreatedAt() time.Time
- func (s *Session) AccessExpiresAt() time.Time
- func (s *Session) AccessToken() secret.Text
- func (s *Session) ClientID() string
- func (s *Session) RefreshCreatedAt() time.Time
- func (s *Session) RefreshExpiresAt() time.Time
- func (s *Session) RefreshToken() secret.Text
- func (s *Session) Scope() string
- func (s *Session) UserID() uuid.UUID
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidExpirationDate = fmt.Errorf("invalid expiration date")
var ExampleAliceSession = Session{ // contains filtered or unexported fields }
Functions ¶
This section is empty.
Types ¶
type CreateCmd ¶
type FakeSessionBuilder ¶
type FakeSessionBuilder struct {
// contains filtered or unexported fields
}
func NewFakeSession ¶
func NewFakeSession(t testing.TB) *FakeSessionBuilder
func (*FakeSessionBuilder) Build ¶
func (f *FakeSessionBuilder) Build() *Session
func (*FakeSessionBuilder) CreatedBy ¶
func (f *FakeSessionBuilder) CreatedBy(user *users.User) *FakeSessionBuilder
func (*FakeSessionBuilder) WithClient ¶
func (f *FakeSessionBuilder) WithClient(client *oauthclients.Client) *FakeSessionBuilder
type MockService ¶
MockService is an autogenerated mock type for the Service type
func NewMockService ¶
func NewMockService(t interface { mock.TestingT Cleanup(func()) }) *MockService
NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockService) DeleteAllForUser ¶
DeleteAllForUser provides a mock function with given fields: ctx, userID
func (*MockService) GetByAccessToken ¶
GetByAccessToken provides a mock function with given fields: ctx, access
func (*MockService) GetByRefreshToken ¶
func (_m *MockService) GetByRefreshToken(ctx context.Context, refresh secret.Text) (*Session, error)
GetByRefreshToken provides a mock function with given fields: ctx, refresh
func (*MockService) RemoveByAccessToken ¶
RemoveByAccessToken provides a mock function with given fields: ctx, access
func (*MockService) RemoveByRefreshToken ¶
RemoveByRefreshToken provides a mock function with given fields: ctx, refresh
type Service ¶
type Service interface { Create(ctx context.Context, input *CreateCmd) (*Session, error) RemoveByAccessToken(ctx context.Context, access secret.Text) error RemoveByRefreshToken(ctx context.Context, refresh secret.Text) error GetByAccessToken(ctx context.Context, access secret.Text) (*Session, error) GetByRefreshToken(ctx context.Context, refresh secret.Text) (*Session, error) DeleteAllForUser(ctx context.Context, userID uuid.UUID) error }
type Session ¶
type Session struct {
// contains filtered or unexported fields
}