rest

package
v0.0.0-...-b856168 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package rest is a generated GoMock package.

Index

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

NewHandler creates a new handler The stores cannot be nil

func (*Handler) Add

func (h *Handler) Add(r *mux.Router)

Add will wire up the endpoints to the handler methods

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

func (*Handler) SignIn

func (h *Handler) SignIn(w http.ResponseWriter, r *http.Request)

SignIn will sign a existing user in Currently just returns the userID for the user, no real authentication TODO: Use vault auth

func (*Handler) Signup

func (h *Handler) Signup(w http.ResponseWriter, r *http.Request)

Signup is the handler that will create a new user

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

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

func (*MockMediumSourcePicker) Pick

func (m *MockMediumSourcePicker) Pick(arg0 context.Context, arg1 string, arg2 int) ([]store.Source, error)

Pick mocks base method

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

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

func (m *MockUserStorer) CreateNewUser(arg0 context.Context, arg1 string) (string, error)

CreateNewUser mocks base method

func (*MockUserStorer) EXPECT

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

func (*MockUserStorer) GetUser

func (m *MockUserStorer) GetUser(arg0 context.Context, arg1 string) (string, error)

GetUser mocks base method

func (*MockUserStorer) IsUser

func (m *MockUserStorer) IsUser(arg0 context.Context, arg1 string) (bool, error)

IsUser mocks base method

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

type UserStorer

type UserStorer interface {
	CreateNewUser(ctx context.Context, email string) (string, error)
	GetUser(ctx context.Context, email string) (string, error)
	IsUser(ctx context.Context, userID string) (bool, error)
}

UserStorer interface that will be used to retrieve user details

Jump to

Keyboard shortcuts

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