mock

package
v0.0.0-...-523796e Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDatastore

type MockDatastore struct {
	JournalEntries  []types.JournalEntry
	JournalDrafts   []types.JournalEntry
	Usernames       []types.Username
	Reactions       []types.Reaction
	UserFollows     map[types.Username][]types.Username
	UserPreferences map[types.Username]types.Preferences
	PageViewCounts  []ga.PageViewCount
	UserProfile     types.UserProfile
	GetEntriesErr   error
	// contains filtered or unexported fields
}

MockDatastore is a mock implementation of the datstore.Datastore interface for testing.

func (*MockDatastore) AddReaction

func (ds *MockDatastore) AddReaction(entryAuthor types.Username, entryDate types.EntryDate, reaction types.Reaction) error

func (*MockDatastore) Close

func (ds *MockDatastore) Close() error

func (*MockDatastore) DeleteFollow

func (ds *MockDatastore) DeleteFollow(leader, follower types.Username) error

func (*MockDatastore) DeleteReaction

func (ds *MockDatastore) DeleteReaction(entryAuthor types.Username, entryDate types.EntryDate, user types.Username) error

func (*MockDatastore) Following

func (ds *MockDatastore) Following(follower types.Username) ([]types.Username, error)

func (*MockDatastore) GetDraft

func (ds *MockDatastore) GetDraft(username types.Username, date types.EntryDate) (types.JournalEntry, error)

func (*MockDatastore) GetEntries

func (ds *MockDatastore) GetEntries(username types.Username) ([]types.JournalEntry, error)

func (*MockDatastore) GetEntry

func (ds *MockDatastore) GetEntry(username types.Username, date types.EntryDate) (types.JournalEntry, error)

func (*MockDatastore) GetPageViews

func (ds *MockDatastore) GetPageViews(path string) (int, error)

func (*MockDatastore) GetPreferences

func (ds *MockDatastore) GetPreferences(username types.Username) (types.Preferences, error)

func (*MockDatastore) GetReactions

func (ds *MockDatastore) GetReactions(entryAuthor types.Username, entryDate types.EntryDate) ([]types.Reaction, error)

func (*MockDatastore) GetUserProfile

func (ds *MockDatastore) GetUserProfile(username types.Username) (types.UserProfile, error)

func (*MockDatastore) InsertDraft

func (ds *MockDatastore) InsertDraft(username types.Username, j types.JournalEntry) error

func (*MockDatastore) InsertEntry

func (ds *MockDatastore) InsertEntry(username types.Username, j types.JournalEntry) error

func (*MockDatastore) InsertFollow

func (ds *MockDatastore) InsertFollow(leader, follower types.Username) error

func (*MockDatastore) InsertPageViews

func (ds *MockDatastore) InsertPageViews(path string, pageViews int) error

func (*MockDatastore) SetPreferences

func (ds *MockDatastore) SetPreferences(username types.Username, prefs types.Preferences) error

func (*MockDatastore) SetUserProfile

func (ds *MockDatastore) SetUserProfile(username types.Username, p types.UserProfile) error

func (*MockDatastore) Users

func (ds *MockDatastore) Users() ([]types.Username, error)

Jump to

Keyboard shortcuts

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