Documentation ¶
Overview ¶
Package rest is a generated GoMock package.
Index ¶
- type Handler
- func (h *Handler) Add(r *mux.Router)
- func (h *Handler) AddMediumSource(w http.ResponseWriter, r *http.Request)
- func (h *Handler) DeleteMediumSource(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetMediumSource(w http.ResponseWriter, r *http.Request)
- func (h *Handler) PickSources(w http.ResponseWriter, r *http.Request)
- func (h *Handler) SignIn(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Signup(w http.ResponseWriter, r *http.Request)
- type MediumSourcePicker
- type MediumSourceStorer
- type MockMediumSourcePicker
- type MockMediumSourcePickerMockRecorder
- type MockMediumSourceStorer
- func (m *MockMediumSourceStorer) AddSource(arg0 context.Context, arg1, arg2 string) error
- func (m *MockMediumSourceStorer) DeleteSource(arg0 context.Context, arg1, arg2 string) error
- func (m *MockMediumSourceStorer) EXPECT() *MockMediumSourceStorerMockRecorder
- func (m *MockMediumSourceStorer) GetSources(arg0 context.Context, arg1 string, arg2 int) ([]store.Source, error)
- type MockMediumSourceStorerMockRecorder
- func (mr *MockMediumSourceStorerMockRecorder) AddSource(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockMediumSourceStorerMockRecorder) DeleteSource(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockMediumSourceStorerMockRecorder) GetSources(arg0, arg1, arg2 interface{}) *gomock.Call
- type MockUserStorer
- func (m *MockUserStorer) CreateNewUser(arg0 context.Context, arg1 string) (string, error)
- func (m *MockUserStorer) EXPECT() *MockUserStorerMockRecorder
- func (m *MockUserStorer) GetUser(arg0 context.Context, arg1 string) (string, error)
- func (m *MockUserStorer) IsUser(arg0 context.Context, arg1 string) (bool, error)
- type MockUserStorerMockRecorder
- type UserStorer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler type for the REST service's endpoints
func NewHandler ¶
func NewHandler(s UserStorer, m MediumSourceStorer, p MediumSourcePicker) *Handler
NewHandler creates a new handler The stores cannot be nil
func (*Handler) AddMediumSource ¶
func (h *Handler) AddMediumSource(w http.ResponseWriter, r *http.Request)
AddMediumSource will add a new medium source for the userID
func (*Handler) DeleteMediumSource ¶
func (h *Handler) DeleteMediumSource(w http.ResponseWriter, r *http.Request)
DeleteMediumSource deletes the source for the specified userID with sourceID
func (*Handler) GetMediumSource ¶
func (h *Handler) GetMediumSource(w http.ResponseWriter, r *http.Request)
GetMediumSource retrieves all the medium sources for the specified userID The response is paginated and if nextPage in the response is non-nil then keep performing the request with query p=value of nextPage
func (*Handler) PickSources ¶
func (h *Handler) PickSources(w http.ResponseWriter, r *http.Request)
PickSources will return a list of sources that have recently updated and haven't been read in a while
type MediumSourcePicker ¶
type MediumSourcePicker interface {
Pick(ctx context.Context, userID string, count int) ([]store.Source, error)
}
MediumSourcePicker interface to select the sources that are ready to be read
type MediumSourceStorer ¶
type MediumSourceStorer interface { AddSource(ctx context.Context, userID string, source string) error GetSources(ctx context.Context, userID string, page int) ([]store.Source, error) DeleteSource(ctx context.Context, userID string, sourceID string) error }
MediumSourceStorer interface to retrieve medium sources
type MockMediumSourcePicker ¶
type MockMediumSourcePicker struct {
// contains filtered or unexported fields
}
MockMediumSourcePicker is a mock of MediumSourcePicker interface
func NewMockMediumSourcePicker ¶
func NewMockMediumSourcePicker(ctrl *gomock.Controller) *MockMediumSourcePicker
NewMockMediumSourcePicker creates a new mock instance
func (*MockMediumSourcePicker) EXPECT ¶
func (m *MockMediumSourcePicker) EXPECT() *MockMediumSourcePickerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockMediumSourcePickerMockRecorder ¶
type MockMediumSourcePickerMockRecorder struct {
// contains filtered or unexported fields
}
MockMediumSourcePickerMockRecorder is the mock recorder for MockMediumSourcePicker
func (*MockMediumSourcePickerMockRecorder) Pick ¶
func (mr *MockMediumSourcePickerMockRecorder) Pick(arg0, arg1, arg2 interface{}) *gomock.Call
Pick indicates an expected call of Pick
type MockMediumSourceStorer ¶
type MockMediumSourceStorer struct {
// contains filtered or unexported fields
}
MockMediumSourceStorer is a mock of MediumSourceStorer interface
func NewMockMediumSourceStorer ¶
func NewMockMediumSourceStorer(ctrl *gomock.Controller) *MockMediumSourceStorer
NewMockMediumSourceStorer creates a new mock instance
func (*MockMediumSourceStorer) AddSource ¶
func (m *MockMediumSourceStorer) AddSource(arg0 context.Context, arg1, arg2 string) error
AddSource mocks base method
func (*MockMediumSourceStorer) DeleteSource ¶
func (m *MockMediumSourceStorer) DeleteSource(arg0 context.Context, arg1, arg2 string) error
DeleteSource mocks base method
func (*MockMediumSourceStorer) EXPECT ¶
func (m *MockMediumSourceStorer) EXPECT() *MockMediumSourceStorerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockMediumSourceStorer) GetSources ¶
func (m *MockMediumSourceStorer) GetSources(arg0 context.Context, arg1 string, arg2 int) ([]store.Source, error)
GetSources mocks base method
type MockMediumSourceStorerMockRecorder ¶
type MockMediumSourceStorerMockRecorder struct {
// contains filtered or unexported fields
}
MockMediumSourceStorerMockRecorder is the mock recorder for MockMediumSourceStorer
func (*MockMediumSourceStorerMockRecorder) AddSource ¶
func (mr *MockMediumSourceStorerMockRecorder) AddSource(arg0, arg1, arg2 interface{}) *gomock.Call
AddSource indicates an expected call of AddSource
func (*MockMediumSourceStorerMockRecorder) DeleteSource ¶
func (mr *MockMediumSourceStorerMockRecorder) DeleteSource(arg0, arg1, arg2 interface{}) *gomock.Call
DeleteSource indicates an expected call of DeleteSource
func (*MockMediumSourceStorerMockRecorder) GetSources ¶
func (mr *MockMediumSourceStorerMockRecorder) GetSources(arg0, arg1, arg2 interface{}) *gomock.Call
GetSources indicates an expected call of GetSources
type MockUserStorer ¶
type MockUserStorer struct {
// contains filtered or unexported fields
}
MockUserStorer is a mock of UserStorer interface
func NewMockUserStorer ¶
func NewMockUserStorer(ctrl *gomock.Controller) *MockUserStorer
NewMockUserStorer creates a new mock instance
func (*MockUserStorer) CreateNewUser ¶
CreateNewUser mocks base method
func (*MockUserStorer) EXPECT ¶
func (m *MockUserStorer) EXPECT() *MockUserStorerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockUserStorerMockRecorder ¶
type MockUserStorerMockRecorder struct {
// contains filtered or unexported fields
}
MockUserStorerMockRecorder is the mock recorder for MockUserStorer
func (*MockUserStorerMockRecorder) CreateNewUser ¶
func (mr *MockUserStorerMockRecorder) CreateNewUser(arg0, arg1 interface{}) *gomock.Call
CreateNewUser indicates an expected call of CreateNewUser
func (*MockUserStorerMockRecorder) GetUser ¶
func (mr *MockUserStorerMockRecorder) GetUser(arg0, arg1 interface{}) *gomock.Call
GetUser indicates an expected call of GetUser
func (*MockUserStorerMockRecorder) IsUser ¶
func (mr *MockUserStorerMockRecorder) IsUser(arg0, arg1 interface{}) *gomock.Call
IsUser indicates an expected call of IsUser