services

package
v0.0.0-...-dc8ef24 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserUnauthorized signals that a user could not be authenticated
	ErrUserUnauthorized = errors.New("unauthorized Request")

	// ErrUserConflicts signals that a new user name conflicts with an existing one
	ErrUserConflicts = errors.New("username already used")
)
View Source
var (
	// ErrCategoryNotFound signals that a category model could not be found
	ErrCategoryNotFound = errors.New("categories not found")

	// ErrCategoryConflicts signals that a category model conflicts with an existing category
	ErrCategoryConflicts = errors.New("categories conflicts")
)
View Source
var (
	// ErrFeedCategoryNotFound signals that a request category for a given feed
	// was not found
	ErrFeedCategoryNotFound = errors.New("cannot find requested category for feed")

	// ErrFeedNotFound signals that a feed could not be found
	ErrFeedNotFound = errors.New("feed not found")

	// ErrFetchingFeed Signals that an error occurred while fetching
	// a RSS or Atom feed
	ErrFetchingFeed = errors.New("could not fetch feed")
)
View Source
var (
	// ErrTagNotFound signals that a tag could not be found
	ErrTagNotFound = errors.New("tag not found")

	// ErrTagConflicts signals that a tag conflicts with an existing tag
	ErrTagConflicts = errors.New("model conflicts")
)
View Source
var (
	// ErrUsernameConflicts signals that a username exists in the tagsRepo
	ErrUsernameConflicts = errors.New("username already exists")

	// ErrUserNotFound signals that a user could not be found
	ErrUserNotFound = errors.New("user not found")
)
View Source
var (
	// ErrEntryNotFound signals that an entry model could not be found
	ErrEntryNotFound = errors.New("entry not found")
)

Functions

This section is empty.

Types

type Auth

type Auth interface {
	// Login a user with username and password
	Login(username, password string) (models.APIKeyPair, error)

	// Register a user with username and password
	Register(username, password string) error

	// Renew access tokens using a refresh token
	Renew(token string) (models.APIKey, error)
}

Auth service interface

type AuthService

type AuthService struct {
	AuthSecret string
	// contains filtered or unexported fields
}

AuthService implements Auth service for end users

func NewAuthService

func NewAuthService(authSecret string, userRepo repo.Users) AuthService

func (AuthService) Login

func (a AuthService) Login(username, password string) (models.APIKeyPair, error)

Login a user

func (AuthService) Register

func (a AuthService) Register(username, password string) error

Register a user

func (AuthService) Renew

func (a AuthService) Renew(token string) (models.APIKey, error)

Renew an API token

type Categories

type Categories interface {
	// New creates a new category. If the category conflicts with an existing category,
	// this errors
	New(userID, name string) (models.Category, error)

	// Category returns a category with ID that belongs to user
	Category(userID, id string) (models.Category, bool)

	// Categories returns a page of categories owned by user
	Categories(userID string, page models.Page) ([]models.Category, string)

	// Feeds returns all feeds associated to a category
	Feeds(userID string, page models.Page) ([]models.Feed, string)

	// Uncategorized returns all feeds associated to a category
	Uncategorized(userID string, page models.Page) ([]models.Feed, string)

	// Update a category with ID that belongs to user
	Update(userID, ctgID, newName string) (models.Category, error)

	// AddFeeds to a category
	AddFeeds(userID, ctgID string, feeds []string)

	// Delete a category with ID that belongs to a user
	Delete(userID, id string) error

	// Mark a category
	Mark(userID, id string, marker models.Marker) error

	// Entries returns all entries associated to a category
	Entries(userID string, page models.Page) ([]models.Entry, string, error)

	// Stats returns statistics on a category items
	Stats(userID, id string) (models.Stats, error)
}

Categories interface defines the Categories service

type CategoriesService

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

CategoriesService implements the Categories interface

func NewCategoriesService

func NewCategoriesService(ctgsRepo repo.Categories, entriesRepo repo.Entries) CategoriesService

func (CategoriesService) AddFeeds

func (c CategoriesService) AddFeeds(userID, ctgID string, feeds []string)

AddFeeds to a category with ctgID

func (CategoriesService) Categories

func (c CategoriesService) Categories(userID string, page models.Page) (categories []models.Category, next string)

Categories returns all categories owned by user

func (CategoriesService) Category

func (c CategoriesService) Category(userID, id string) (models.Category, bool)

Category returns a category with ID that belongs to user

func (CategoriesService) Delete

func (c CategoriesService) Delete(userID, id string) error

Delete a category with ID that belongs to a user

func (CategoriesService) Entries

func (c CategoriesService) Entries(userID string, page models.Page) ([]models.Entry, string, error)

Entries returns all entries associated to a category

func (CategoriesService) Feeds

func (c CategoriesService) Feeds(userID string, page models.Page) (feeds []models.Feed, next string)

Feeds returns all feeds associated to a category

func (CategoriesService) Mark

func (c CategoriesService) Mark(userID, id string, marker models.Marker) error

Mark a category

func (CategoriesService) New

func (c CategoriesService) New(userID, name string) (models.Category, error)

New creates a new category. If the category conflicts with an existing category, this errors

func (CategoriesService) Stats

func (c CategoriesService) Stats(userID, id string) (models.Stats, error)

Stats returns statistics on a category items

func (CategoriesService) Uncategorized

func (c CategoriesService) Uncategorized(userID string, page models.Page) (feeds []models.Feed, next string)

Uncategorized returns all feeds associated to a category

func (CategoriesService) Update

func (c CategoriesService) Update(userID, ctgID, newName string) (models.Category, error)

Update a category with ID that belongs to user

type Entries

type Entries interface {
	// Entry returns an entry with id that belongs to user
	Entry(userID, id string) (models.Entry, error)

	// Entries returns all entries belong to a user with a marker
	Entries(userID string, page models.Page) ([]models.Entry, string)

	// Mark entry with id
	Mark(userID string, id string, marker models.Marker) error

	// MarkAll entries
	MarkAll(userID string, marker models.Marker)

	// Stats returns statistics for all entries
	Stats(userID string) models.Stats
}

Entries interface defines the Entries service

type EntriesService

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

EntriesService implements Entries service

func NewEntriesService

func NewEntriesService(entriesRepo repo.Entries) EntriesService

func (EntriesService) Entries

func (e EntriesService) Entries(userID string, page models.Page) (entries []models.Entry, next string)

Entries returns all entries belong to a user with a marker

func (EntriesService) Entry

func (e EntriesService) Entry(userID, id string) (models.Entry, error)

Entry returns an entry with ID that belongs to user

func (EntriesService) Mark

func (e EntriesService) Mark(userID, id string, marker models.Marker) error

Mark entry with id

func (EntriesService) MarkAll

func (e EntriesService) MarkAll(userID string, marker models.Marker)

MarkAll entries

func (EntriesService) Stats

func (e EntriesService) Stats(userID string) models.Stats

Stats returns statistics for all entries

type Exporter

type Exporter interface {
	Export(userID string) ([]byte, error)
}

Exporter is an interface that wraps the basic export functions.

type FeedService

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

FeedService implementation

func NewFeedsService

func NewFeedsService(feedsRepo repo.Feeds, ctgsRepo repo.Categories, entriesRepo repo.Entries) FeedService

func (FeedService) Delete

func (f FeedService) Delete(userID, id string) error

Delete a feed with id

func (FeedService) Entries

func (f FeedService) Entries(userID string, page models.Page) (entries []models.Entry, next string)

Entries returns all entry items associated to a feed

func (FeedService) Feed

func (f FeedService) Feed(userID, id string) (models.Feed, bool)

Feed returns a feed with id owned by user

func (FeedService) Feeds

func (f FeedService) Feeds(userID string, page models.Page) (feeds []models.Feed, next string)

Feeds returns all feeds owned by user

func (FeedService) Mark

func (f FeedService) Mark(userID, id string, marker models.Marker) error

Mark a feed with id

func (FeedService) New

func (f FeedService) New(title, subscription, ctgID, userID string) (models.Feed, error)

New creates a new Feed

func (FeedService) Stats

func (f FeedService) Stats(userID, id string) (models.Stats, error)

Stats returns statistics of a feed

func (FeedService) Update

func (f FeedService) Update(userID string, feed *models.Feed) error

Update a feed owned by user

type Feeds

type Feeds interface {
	// New creates a new Feed
	New(title, subscription string, ctgID string, userID string) (models.Feed, error)

	// Feeds returns all feeds owned by user
	Feeds(userID string, page models.Page) ([]models.Feed, string)

	// Feed returns a feed with id owned by user
	Feed(userID string, id string) (models.Feed, bool)

	// Update feed owned by user
	Update(userID string, feed *models.Feed) error

	// Delete a feed with id
	Delete(userID string, id string) error

	// Mark a feed with id
	Mark(userID string, id string, marker models.Marker) error

	// Entries returns all entry items associated to a feed
	Entries(userID string, page models.Page) ([]models.Entry, string)

	// Stats returns statistics of a feed
	Stats(userID string, id string) (models.Stats, error)
}

Feeds defines the Feeds service interface

type Importer

type Importer interface {
	Import([]byte, string) error
}

Importer is an interface that wraps the basic import functions.

type MockAuth

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

MockAuth is a mock of Auth interface.

func NewMockAuth

func NewMockAuth(ctrl *gomock.Controller) *MockAuth

NewMockAuth creates a new mock instance.

func (*MockAuth) EXPECT

func (m *MockAuth) EXPECT() *MockAuthMockRecorder

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

func (*MockAuth) Login

func (m *MockAuth) Login(username, password string) (models.APIKeyPair, error)

Login mocks base method.

func (*MockAuth) Register

func (m *MockAuth) Register(username, password string) error

Register mocks base method.

func (*MockAuth) Renew

func (m *MockAuth) Renew(token string) (models.APIKey, error)

Renew mocks base method.

type MockAuthMockRecorder

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

MockAuthMockRecorder is the mock recorder for MockAuth.

func (*MockAuthMockRecorder) Login

func (mr *MockAuthMockRecorder) Login(username, password interface{}) *gomock.Call

Login indicates an expected call of Login.

func (*MockAuthMockRecorder) Register

func (mr *MockAuthMockRecorder) Register(username, password interface{}) *gomock.Call

Register indicates an expected call of Register.

func (*MockAuthMockRecorder) Renew

func (mr *MockAuthMockRecorder) Renew(token interface{}) *gomock.Call

Renew indicates an expected call of Renew.

type MockCategories

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

MockCategories is a mock of Categories interface.

func NewMockCategories

func NewMockCategories(ctrl *gomock.Controller) *MockCategories

NewMockCategories creates a new mock instance.

func (*MockCategories) AddFeeds

func (m *MockCategories) AddFeeds(userID, ctgID string, feeds []string)

AddFeeds mocks base method.

func (*MockCategories) Categories

func (m *MockCategories) Categories(userID string, page models.Page) ([]models.Category, string)

Categories mocks base method.

func (*MockCategories) Category

func (m *MockCategories) Category(userID, id string) (models.Category, bool)

Category mocks base method.

func (*MockCategories) Delete

func (m *MockCategories) Delete(userID, id string) error

Delete mocks base method.

func (*MockCategories) EXPECT

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

func (*MockCategories) Entries

func (m *MockCategories) Entries(userID string, page models.Page) ([]models.Entry, string, error)

Entries mocks base method.

func (*MockCategories) Feeds

func (m *MockCategories) Feeds(userID string, page models.Page) ([]models.Feed, string)

Feeds mocks base method.

func (*MockCategories) Mark

func (m *MockCategories) Mark(userID, id string, marker models.Marker) error

Mark mocks base method.

func (*MockCategories) New

func (m *MockCategories) New(userID, name string) (models.Category, error)

New mocks base method.

func (*MockCategories) Stats

func (m *MockCategories) Stats(userID, id string) (models.Stats, error)

Stats mocks base method.

func (*MockCategories) Uncategorized

func (m *MockCategories) Uncategorized(userID string, page models.Page) ([]models.Feed, string)

Uncategorized mocks base method.

func (*MockCategories) Update

func (m *MockCategories) Update(userID, ctgID, newName string) (models.Category, error)

Update mocks base method.

type MockCategoriesMockRecorder

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

MockCategoriesMockRecorder is the mock recorder for MockCategories.

func (*MockCategoriesMockRecorder) AddFeeds

func (mr *MockCategoriesMockRecorder) AddFeeds(userID, ctgID, feeds interface{}) *gomock.Call

AddFeeds indicates an expected call of AddFeeds.

func (*MockCategoriesMockRecorder) Categories

func (mr *MockCategoriesMockRecorder) Categories(userID, page interface{}) *gomock.Call

Categories indicates an expected call of Categories.

func (*MockCategoriesMockRecorder) Category

func (mr *MockCategoriesMockRecorder) Category(userID, id interface{}) *gomock.Call

Category indicates an expected call of Category.

func (*MockCategoriesMockRecorder) Delete

func (mr *MockCategoriesMockRecorder) Delete(userID, id interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockCategoriesMockRecorder) Entries

func (mr *MockCategoriesMockRecorder) Entries(userID, page interface{}) *gomock.Call

Entries indicates an expected call of Entries.

func (*MockCategoriesMockRecorder) Feeds

func (mr *MockCategoriesMockRecorder) Feeds(userID, page interface{}) *gomock.Call

Feeds indicates an expected call of Feeds.

func (*MockCategoriesMockRecorder) Mark

func (mr *MockCategoriesMockRecorder) Mark(userID, id, marker interface{}) *gomock.Call

Mark indicates an expected call of Mark.

func (*MockCategoriesMockRecorder) New

func (mr *MockCategoriesMockRecorder) New(userID, name interface{}) *gomock.Call

New indicates an expected call of New.

func (*MockCategoriesMockRecorder) Stats

func (mr *MockCategoriesMockRecorder) Stats(userID, id interface{}) *gomock.Call

Stats indicates an expected call of Stats.

func (*MockCategoriesMockRecorder) Uncategorized

func (mr *MockCategoriesMockRecorder) Uncategorized(userID, page interface{}) *gomock.Call

Uncategorized indicates an expected call of Uncategorized.

func (*MockCategoriesMockRecorder) Update

func (mr *MockCategoriesMockRecorder) Update(userID, ctgID, newName interface{}) *gomock.Call

Update indicates an expected call of Update.

type MockEntries

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

MockEntries is a mock of Entries interface.

func NewMockEntries

func NewMockEntries(ctrl *gomock.Controller) *MockEntries

NewMockEntries creates a new mock instance.

func (*MockEntries) EXPECT

func (m *MockEntries) EXPECT() *MockEntriesMockRecorder

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

func (*MockEntries) Entries

func (m *MockEntries) Entries(userID string, page models.Page) ([]models.Entry, string)

Entries mocks base method.

func (*MockEntries) Entry

func (m *MockEntries) Entry(userID, id string) (models.Entry, error)

Entry mocks base method.

func (*MockEntries) Mark

func (m *MockEntries) Mark(userID, id string, marker models.Marker) error

Mark mocks base method.

func (*MockEntries) MarkAll

func (m *MockEntries) MarkAll(userID string, marker models.Marker)

MarkAll mocks base method.

func (*MockEntries) Stats

func (m *MockEntries) Stats(userID string) models.Stats

Stats mocks base method.

type MockEntriesMockRecorder

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

MockEntriesMockRecorder is the mock recorder for MockEntries.

func (*MockEntriesMockRecorder) Entries

func (mr *MockEntriesMockRecorder) Entries(userID, page interface{}) *gomock.Call

Entries indicates an expected call of Entries.

func (*MockEntriesMockRecorder) Entry

func (mr *MockEntriesMockRecorder) Entry(userID, id interface{}) *gomock.Call

Entry indicates an expected call of Entry.

func (*MockEntriesMockRecorder) Mark

func (mr *MockEntriesMockRecorder) Mark(userID, id, marker interface{}) *gomock.Call

Mark indicates an expected call of Mark.

func (*MockEntriesMockRecorder) MarkAll

func (mr *MockEntriesMockRecorder) MarkAll(userID, marker interface{}) *gomock.Call

MarkAll indicates an expected call of MarkAll.

func (*MockEntriesMockRecorder) Stats

func (mr *MockEntriesMockRecorder) Stats(userID interface{}) *gomock.Call

Stats indicates an expected call of Stats.

type MockExporter

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

MockExporter is a mock of Exporter interface.

func NewMockExporter

func NewMockExporter(ctrl *gomock.Controller) *MockExporter

NewMockExporter creates a new mock instance.

func (*MockExporter) EXPECT

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

func (*MockExporter) Export

func (m *MockExporter) Export(userID string) ([]byte, error)

Export mocks base method.

type MockExporterMockRecorder

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

MockExporterMockRecorder is the mock recorder for MockExporter.

func (*MockExporterMockRecorder) Export

func (mr *MockExporterMockRecorder) Export(userID interface{}) *gomock.Call

Export indicates an expected call of Export.

type MockFeeds

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

MockFeeds is a mock of Feeds interface.

func NewMockFeeds

func NewMockFeeds(ctrl *gomock.Controller) *MockFeeds

NewMockFeeds creates a new mock instance.

func (*MockFeeds) Delete

func (m *MockFeeds) Delete(userID, id string) error

Delete mocks base method.

func (*MockFeeds) EXPECT

func (m *MockFeeds) EXPECT() *MockFeedsMockRecorder

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

func (*MockFeeds) Entries

func (m *MockFeeds) Entries(userID string, page models.Page) ([]models.Entry, string)

Entries mocks base method.

func (*MockFeeds) Feed

func (m *MockFeeds) Feed(userID, id string) (models.Feed, bool)

Feed mocks base method.

func (*MockFeeds) Feeds

func (m *MockFeeds) Feeds(userID string, page models.Page) ([]models.Feed, string)

Feeds mocks base method.

func (*MockFeeds) Mark

func (m *MockFeeds) Mark(userID, id string, marker models.Marker) error

Mark mocks base method.

func (*MockFeeds) New

func (m *MockFeeds) New(title, subscription, ctgID, userID string) (models.Feed, error)

New mocks base method.

func (*MockFeeds) Stats

func (m *MockFeeds) Stats(userID, id string) (models.Stats, error)

Stats mocks base method.

func (*MockFeeds) Update

func (m *MockFeeds) Update(userID string, feed *models.Feed) error

Update mocks base method.

type MockFeedsMockRecorder

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

MockFeedsMockRecorder is the mock recorder for MockFeeds.

func (*MockFeedsMockRecorder) Delete

func (mr *MockFeedsMockRecorder) Delete(userID, id interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockFeedsMockRecorder) Entries

func (mr *MockFeedsMockRecorder) Entries(userID, page interface{}) *gomock.Call

Entries indicates an expected call of Entries.

func (*MockFeedsMockRecorder) Feed

func (mr *MockFeedsMockRecorder) Feed(userID, id interface{}) *gomock.Call

Feed indicates an expected call of Feed.

func (*MockFeedsMockRecorder) Feeds

func (mr *MockFeedsMockRecorder) Feeds(userID, page interface{}) *gomock.Call

Feeds indicates an expected call of Feeds.

func (*MockFeedsMockRecorder) Mark

func (mr *MockFeedsMockRecorder) Mark(userID, id, marker interface{}) *gomock.Call

Mark indicates an expected call of Mark.

func (*MockFeedsMockRecorder) New

func (mr *MockFeedsMockRecorder) New(title, subscription, ctgID, userID interface{}) *gomock.Call

New indicates an expected call of New.

func (*MockFeedsMockRecorder) Stats

func (mr *MockFeedsMockRecorder) Stats(userID, id interface{}) *gomock.Call

Stats indicates an expected call of Stats.

func (*MockFeedsMockRecorder) Update

func (mr *MockFeedsMockRecorder) Update(userID, feed interface{}) *gomock.Call

Update indicates an expected call of Update.

type MockImporter

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

MockImporter is a mock of Importer interface.

func NewMockImporter

func NewMockImporter(ctrl *gomock.Controller) *MockImporter

NewMockImporter creates a new mock instance.

func (*MockImporter) EXPECT

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

func (*MockImporter) Import

func (m *MockImporter) Import(arg0 []byte, arg1 string) error

Import mocks base method.

type MockImporterMockRecorder

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

MockImporterMockRecorder is the mock recorder for MockImporter.

func (*MockImporterMockRecorder) Import

func (mr *MockImporterMockRecorder) Import(arg0, arg1 interface{}) *gomock.Call

Import indicates an expected call of Import.

type MockTags

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

MockTags is a mock of Tags interface.

func NewMockTags

func NewMockTags(ctrl *gomock.Controller) *MockTags

NewMockTags creates a new mock instance.

func (*MockTags) Apply

func (m *MockTags) Apply(userID, id string, entries []string) error

Apply mocks base method.

func (*MockTags) Delete

func (m *MockTags) Delete(userID, id string) error

Delete mocks base method.

func (*MockTags) EXPECT

func (m *MockTags) EXPECT() *MockTagsMockRecorder

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

func (*MockTags) Entries

func (m *MockTags) Entries(userID string, page models.Page) ([]models.Entry, string)

Entries mocks base method.

func (*MockTags) List

func (m *MockTags) List(userID string, page models.Page) ([]models.Tag, string)

List mocks base method.

func (*MockTags) New

func (m *MockTags) New(userID, name string) (models.Tag, error)

New mocks base method.

func (*MockTags) Tag

func (m *MockTags) Tag(userID, id string) (models.Tag, bool)

Tag mocks base method.

func (*MockTags) Update

func (m *MockTags) Update(userID, id, newName string) (models.Tag, error)

Update mocks base method.

type MockTagsMockRecorder

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

MockTagsMockRecorder is the mock recorder for MockTags.

func (*MockTagsMockRecorder) Apply

func (mr *MockTagsMockRecorder) Apply(userID, id, entries interface{}) *gomock.Call

Apply indicates an expected call of Apply.

func (*MockTagsMockRecorder) Delete

func (mr *MockTagsMockRecorder) Delete(userID, id interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockTagsMockRecorder) Entries

func (mr *MockTagsMockRecorder) Entries(userID, page interface{}) *gomock.Call

Entries indicates an expected call of Entries.

func (*MockTagsMockRecorder) List

func (mr *MockTagsMockRecorder) List(userID, page interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockTagsMockRecorder) New

func (mr *MockTagsMockRecorder) New(userID, name interface{}) *gomock.Call

New indicates an expected call of New.

func (*MockTagsMockRecorder) Tag

func (mr *MockTagsMockRecorder) Tag(userID, id interface{}) *gomock.Call

Tag indicates an expected call of Tag.

func (*MockTagsMockRecorder) Update

func (mr *MockTagsMockRecorder) Update(userID, id, newName interface{}) *gomock.Call

Update indicates an expected call of Update.

type MockUsers

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

MockUsers is a mock of Users interface.

func NewMockUsers

func NewMockUsers(ctrl *gomock.Controller) *MockUsers

NewMockUsers creates a new mock instance.

func (*MockUsers) DeleteUser

func (m *MockUsers) DeleteUser(id string) error

DeleteUser mocks base method.

func (*MockUsers) EXPECT

func (m *MockUsers) EXPECT() *MockUsersMockRecorder

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

func (*MockUsers) NewUser

func (m *MockUsers) NewUser(username, password string) (models.User, error)

NewUser mocks base method.

func (*MockUsers) User

func (m *MockUsers) User(id string) (models.User, bool)

User mocks base method.

func (*MockUsers) Users

func (m *MockUsers) Users(page models.Page) ([]models.User, string)

Users mocks base method.

type MockUsersMockRecorder

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

MockUsersMockRecorder is the mock recorder for MockUsers.

func (*MockUsersMockRecorder) DeleteUser

func (mr *MockUsersMockRecorder) DeleteUser(id interface{}) *gomock.Call

DeleteUser indicates an expected call of DeleteUser.

func (*MockUsersMockRecorder) NewUser

func (mr *MockUsersMockRecorder) NewUser(username, password interface{}) *gomock.Call

NewUser indicates an expected call of NewUser.

func (*MockUsersMockRecorder) User

func (mr *MockUsersMockRecorder) User(id interface{}) *gomock.Call

User indicates an expected call of User.

func (*MockUsersMockRecorder) Users

func (mr *MockUsersMockRecorder) Users(page interface{}) *gomock.Call

Users indicates an expected call of Users.

type OPMLExporter

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

An OPMLExporter represents an exporter for the OPML 2.0 format define by http://dev.opml.org/spec2.html.

func NewOPMLExporter

func NewOPMLExporter(ctgsRepo repo.Categories) OPMLExporter

func (OPMLExporter) Export

func (e OPMLExporter) Export(userID string) ([]byte, error)

Export categories and feeds to data in OPML 2.0 format.

type OPMLImporter

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

An OPMLImporter represents an importer for the OPML 2.0 format define by http://dev.opml.org/spec2.html.

func NewOPMLImporter

func NewOPMLImporter(ctgsRepo repo.Categories, feedsRepo repo.Feeds) OPMLImporter

func (OPMLImporter) Import

func (i OPMLImporter) Import(data []byte, userID string) error

Import data that must be in a OPML 2.0 format.

type Tags

type Tags interface {
	// New creates a new tag
	New(userID, name string) (models.Tag, error)

	// List returns all tags owned by user
	List(userID string, page models.Page) ([]models.Tag, string)

	// Delete a tag id
	Delete(userID, id string) error

	// Update a tag with id
	Update(userID, id, newName string) (models.Tag, error)

	// Apply associates a tag with an entry
	Apply(userID, id string, entries []string) error

	// Tag returns a tag with id
	Tag(userID, id string) (models.Tag, bool)

	// Entries returns all entries associated with a tag with id
	Entries(userID string, page models.Page) ([]models.Entry, string)
}

Tags defines the Tags service interface

type TagsService

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

TagsService implementation

func NewTagsService

func NewTagsService(tagsRepo repo.Tags, entriesRepo repo.Entries) TagsService

func (TagsService) Apply

func (t TagsService) Apply(userID, id string, entries []string) error

Apply associates a tag with an entry

func (TagsService) Delete

func (t TagsService) Delete(userID, id string) error

Delete a tag id

func (TagsService) Entries

func (t TagsService) Entries(userID string, page models.Page) (entries []models.Entry, next string)

Entries returns all entries associated with a tag with id

func (TagsService) List

func (t TagsService) List(userID string, page models.Page) (tags []models.Tag, next string)

List returns all tags owned by user

func (TagsService) New

func (t TagsService) New(userID, name string) (models.Tag, error)

New creates a new tag

func (TagsService) Tag

func (t TagsService) Tag(userID, id string) (models.Tag, bool)

Tag returns a tag with id

func (TagsService) Update

func (t TagsService) Update(userID, id, newName string) (models.Tag, error)

Update a tag with id

type Users

type Users interface {
	// NewUser creates a new user with user name and password
	NewUser(username, password string) (models.User, error)

	// DeleteUser with id
	DeleteUser(id string) error

	// User with id
	User(id string) (models.User, bool)

	// Users gets a list of users
	Users(page models.Page) ([]models.User, string)
}

Users interface defines the Users services

type UsersService

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

UsersService implement the Users interface

func NewUsersService

func NewUsersService(usersRepo repo.Users) UsersService

func (UsersService) DeleteUser

func (a UsersService) DeleteUser(id string) error

DeleteUser deletes a user with userID

func (UsersService) NewUser

func (a UsersService) NewUser(username, password string) (models.User, error)

NewUser creates a new user

func (UsersService) User

func (a UsersService) User(id string) (models.User, bool)

User gets a user with id

func (UsersService) Users

func (a UsersService) Users(page models.Page) (users []models.User, next string)

Users returns all users

Jump to

Keyboard shortcuts

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