document

package
v0.0.0-...-2ac5184 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package document is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(store Store) *API

func (*API) GetAllHandler

func (api *API) GetAllHandler(w http.ResponseWriter, r *http.Request)

func (*API) GetOneHandler

func (api *API) GetOneHandler(w http.ResponseWriter, r *http.Request)

func (*API) InsertHandler

func (api *API) InsertHandler(w http.ResponseWriter, r *http.Request)

func (*API) UpdateHandler

func (api *API) UpdateHandler(w http.ResponseWriter, r *http.Request)

type Document

type Document struct {
	ID        int64     `db:"id"`
	Title     string    `db:"title"`
	Body      string    `db:"body"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type MockStore

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

MockStore is a mock of Store interface.

func NewMockStore

func NewMockStore(ctrl *gomock.Controller) *MockStore

NewMockStore creates a new mock instance.

func (*MockStore) EXPECT

func (m *MockStore) EXPECT() *MockStoreMockRecorder

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

func (*MockStore) GetAll

func (m *MockStore) GetAll(arg0 context.Context) ([]*Document, error)

GetAll mocks base method.

func (*MockStore) GetOne

func (m *MockStore) GetOne(arg0 context.Context, arg1 int64) (*Document, error)

GetOne mocks base method.

func (*MockStore) Insert

func (m *MockStore) Insert(arg0 context.Context, arg1 *Document) (int64, error)

Insert mocks base method.

func (*MockStore) Update

func (m *MockStore) Update(arg0 context.Context, arg1 int64, arg2, arg3 string) error

Update mocks base method.

type MockStoreMockRecorder

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

MockStoreMockRecorder is the mock recorder for MockStore.

func (*MockStoreMockRecorder) GetAll

func (mr *MockStoreMockRecorder) GetAll(arg0 interface{}) *gomock.Call

GetAll indicates an expected call of GetAll.

func (*MockStoreMockRecorder) GetOne

func (mr *MockStoreMockRecorder) GetOne(arg0, arg1 interface{}) *gomock.Call

GetOne indicates an expected call of GetOne.

func (*MockStoreMockRecorder) Insert

func (mr *MockStoreMockRecorder) Insert(arg0, arg1 interface{}) *gomock.Call

Insert indicates an expected call of Insert.

func (*MockStoreMockRecorder) Update

func (mr *MockStoreMockRecorder) Update(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

Update indicates an expected call of Update.

type SQLStore

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

func NewSQLStore

func NewSQLStore(db *sqlx.DB) *SQLStore

func (*SQLStore) GetAll

func (s *SQLStore) GetAll(ctx context.Context) ([]*Document, error)

func (*SQLStore) GetOne

func (s *SQLStore) GetOne(ctx context.Context, id int64) (*Document, error)

func (*SQLStore) Insert

func (s *SQLStore) Insert(ctx context.Context, d *Document) (int64, error)

func (*SQLStore) Update

func (s *SQLStore) Update(ctx context.Context, id int64, field string, value string) error

type Store

type Store interface {
	Insert(context.Context, *Document) (int64, error)
	GetAll(context.Context) ([]*Document, error)
	GetOne(context.Context, int64) (*Document, error)
	Update(context.Context, int64, string, string) error
}

Jump to

Keyboard shortcuts

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