Documentation ¶
Index ¶
- type SessionStore
- func (mock *SessionStore) Create(ctx context.Context, s sessionup.Session) error
- func (mock *SessionStore) CreateCalls() []struct{ ... }
- func (mock *SessionStore) DeleteByID(ctx context.Context, id string) error
- func (mock *SessionStore) DeleteByIDCalls() []struct{ ... }
- func (mock *SessionStore) DeleteByUserKey(ctx context.Context, key string, expID ...string) error
- func (mock *SessionStore) DeleteByUserKeyCalls() []struct{ ... }
- func (mock *SessionStore) FetchByID(ctx context.Context, id string) (sessionup.Session, bool, error)
- func (mock *SessionStore) FetchByIDCalls() []struct{ ... }
- func (mock *SessionStore) FetchByUserKey(ctx context.Context, key string) ([]sessionup.Session, error)
- func (mock *SessionStore) FetchByUserKeyCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionStore ¶
type SessionStore struct { // CreateFunc mocks the Create method. CreateFunc func(ctx context.Context, s sessionup.Session) error // DeleteByIDFunc mocks the DeleteByID method. DeleteByIDFunc func(ctx context.Context, id string) error // DeleteByUserKeyFunc mocks the DeleteByUserKey method. DeleteByUserKeyFunc func(ctx context.Context, key string, expID ...string) error // FetchByIDFunc mocks the FetchByID method. FetchByIDFunc func(ctx context.Context, id string) (sessionup.Session, bool, error) // FetchByUserKeyFunc mocks the FetchByUserKey method. FetchByUserKeyFunc func(ctx context.Context, key string) ([]sessionup.Session, error) // contains filtered or unexported fields }
SessionStore is a mock implementation of sessionup.Store.
func TestSomethingThatUsesStore(t *testing.T) { // make and configure a mocked sessionup.Store mockedStore := &SessionStore{ CreateFunc: func(ctx context.Context, s sessionup.Session) error { panic("mock out the Create method") }, DeleteByIDFunc: func(ctx context.Context, id string) error { panic("mock out the DeleteByID method") }, DeleteByUserKeyFunc: func(ctx context.Context, key string, expID ...string) error { panic("mock out the DeleteByUserKey method") }, FetchByIDFunc: func(ctx context.Context, id string) (sessionup.Session, bool, error) { panic("mock out the FetchByID method") }, FetchByUserKeyFunc: func(ctx context.Context, key string) ([]sessionup.Session, error) { panic("mock out the FetchByUserKey method") }, } // use mockedStore in code that requires sessionup.Store // and then make assertions. }
func (*SessionStore) CreateCalls ¶
func (mock *SessionStore) CreateCalls() []struct { Ctx context.Context S sessionup.Session }
CreateCalls gets all the calls that were made to Create. Check the length with:
len(mockedStore.CreateCalls())
func (*SessionStore) DeleteByID ¶
func (mock *SessionStore) DeleteByID(ctx context.Context, id string) error
DeleteByID calls DeleteByIDFunc.
func (*SessionStore) DeleteByIDCalls ¶
func (mock *SessionStore) DeleteByIDCalls() []struct { Ctx context.Context ID string }
DeleteByIDCalls gets all the calls that were made to DeleteByID. Check the length with:
len(mockedStore.DeleteByIDCalls())
func (*SessionStore) DeleteByUserKey ¶
DeleteByUserKey calls DeleteByUserKeyFunc.
func (*SessionStore) DeleteByUserKeyCalls ¶
func (mock *SessionStore) DeleteByUserKeyCalls() []struct { Ctx context.Context Key string ExpID []string }
DeleteByUserKeyCalls gets all the calls that were made to DeleteByUserKey. Check the length with:
len(mockedStore.DeleteByUserKeyCalls())
func (*SessionStore) FetchByID ¶
func (mock *SessionStore) FetchByID(ctx context.Context, id string) (sessionup.Session, bool, error)
FetchByID calls FetchByIDFunc.
func (*SessionStore) FetchByIDCalls ¶
func (mock *SessionStore) FetchByIDCalls() []struct { Ctx context.Context ID string }
FetchByIDCalls gets all the calls that were made to FetchByID. Check the length with:
len(mockedStore.FetchByIDCalls())
func (*SessionStore) FetchByUserKey ¶
func (mock *SessionStore) FetchByUserKey(ctx context.Context, key string) ([]sessionup.Session, error)
FetchByUserKey calls FetchByUserKeyFunc.
func (*SessionStore) FetchByUserKeyCalls ¶
func (mock *SessionStore) FetchByUserKeyCalls() []struct { Ctx context.Context Key string }
FetchByUserKeyCalls gets all the calls that were made to FetchByUserKey. Check the length with:
len(mockedStore.FetchByUserKeyCalls())