Documentation ¶
Index ¶
- Variables
- type CreateCmd
- type DavSession
- type DeleteCmd
- type FakeSessionBuilder
- func (f *FakeSessionBuilder) Build() *DavSession
- func (f *FakeSessionBuilder) CreatedAt(at time.Time) *FakeSessionBuilder
- func (f *FakeSessionBuilder) CreatedBy(user *users.User) *FakeSessionBuilder
- func (f *FakeSessionBuilder) WithName(name string) *FakeSessionBuilder
- func (f *FakeSessionBuilder) WithPassword(password string) *FakeSessionBuilder
- func (f *FakeSessionBuilder) WithSpace(space *spaces.Space) *FakeSessionBuilder
- func (f *FakeSessionBuilder) WithUsername(username string) *FakeSessionBuilder
- type MockService
- func (_m *MockService) Authenticate(ctx context.Context, username string, password secret.Text) (*DavSession, error)
- func (_m *MockService) Create(ctx context.Context, cmd *CreateCmd) (*DavSession, string, error)
- func (_m *MockService) Delete(ctx context.Context, cmd *DeleteCmd) error
- func (_m *MockService) DeleteAll(ctx context.Context, userID uuid.UUID) error
- func (_m *MockService) GetAllForUser(ctx context.Context, userID uuid.UUID, paginateCmd *sqlstorage.PaginateCmd) ([]DavSession, error)
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidCredentials = errors.New("invalid credentials") ErrUserIDNotMatching = errors.New("user ids are not matching") ErrInvalidSpaceID = errors.New("invalid spaceID") )
View Source
var DavSessionRegexp = regexp.MustCompile("^[0-9a-zA-Z- ]+$")
View Source
var ExampleAliceSession = DavSession{ // contains filtered or unexported fields }
View Source
var ExampleAliceSession2 = DavSession{ // contains filtered or unexported fields }
Functions ¶
This section is empty.
Types ¶
type DavSession ¶
type DavSession struct {
// contains filtered or unexported fields
}
func (*DavSession) CreatedAt ¶
func (u *DavSession) CreatedAt() time.Time
func (*DavSession) ID ¶
func (u *DavSession) ID() uuid.UUID
func (DavSession) Name ¶
func (u DavSession) Name() string
func (*DavSession) SpaceID ¶
func (u *DavSession) SpaceID() uuid.UUID
func (*DavSession) UserID ¶
func (u *DavSession) UserID() uuid.UUID
func (*DavSession) Username ¶
func (u *DavSession) Username() string
type FakeSessionBuilder ¶
type FakeSessionBuilder struct {
// contains filtered or unexported fields
}
func NewFakeSession ¶
func NewFakeSession(t *testing.T) *FakeSessionBuilder
func (*FakeSessionBuilder) Build ¶
func (f *FakeSessionBuilder) Build() *DavSession
func (*FakeSessionBuilder) CreatedAt ¶
func (f *FakeSessionBuilder) CreatedAt(at time.Time) *FakeSessionBuilder
func (*FakeSessionBuilder) CreatedBy ¶
func (f *FakeSessionBuilder) CreatedBy(user *users.User) *FakeSessionBuilder
func (*FakeSessionBuilder) WithName ¶
func (f *FakeSessionBuilder) WithName(name string) *FakeSessionBuilder
func (*FakeSessionBuilder) WithPassword ¶
func (f *FakeSessionBuilder) WithPassword(password string) *FakeSessionBuilder
func (*FakeSessionBuilder) WithSpace ¶
func (f *FakeSessionBuilder) WithSpace(space *spaces.Space) *FakeSessionBuilder
func (*FakeSessionBuilder) WithUsername ¶
func (f *FakeSessionBuilder) WithUsername(username string) *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) Authenticate ¶
func (_m *MockService) Authenticate(ctx context.Context, username string, password secret.Text) (*DavSession, error)
Authenticate provides a mock function with given fields: ctx, username, password
func (*MockService) Create ¶
func (_m *MockService) Create(ctx context.Context, cmd *CreateCmd) (*DavSession, string, error)
Create provides a mock function with given fields: ctx, cmd
func (*MockService) Delete ¶
func (_m *MockService) Delete(ctx context.Context, cmd *DeleteCmd) error
Delete provides a mock function with given fields: ctx, cmd
func (*MockService) GetAllForUser ¶
func (_m *MockService) GetAllForUser(ctx context.Context, userID uuid.UUID, paginateCmd *sqlstorage.PaginateCmd) ([]DavSession, error)
GetAllForUser provides a mock function with given fields: ctx, userID, paginateCmd
type Service ¶
type Service interface { GetAllForUser(ctx context.Context, userID uuid.UUID, paginateCmd *sqlstorage.PaginateCmd) ([]DavSession, error) Create(ctx context.Context, cmd *CreateCmd) (*DavSession, string, error) Authenticate(ctx context.Context, username string, password secret.Text) (*DavSession, error) Delete(ctx context.Context, cmd *DeleteCmd) error DeleteAll(ctx context.Context, userID uuid.UUID) error }
Click to show internal directories.
Click to hide internal directories.