Documentation ¶
Overview ¶
Package feiralivre is a generated GoMock package.
Index ¶
- Constants
- func ParseQueryParamsToArgs(qp QueryParams) (args []interface{})
- func ParseQueryParamsToQuery(qp QueryParams) string
- type MockRepository
- func (m *MockRepository) Create(arg0 entity.FeiraLivre) (*entity.FeiraLivre, error)
- func (m *MockRepository) CreateOrUpdate(feiraLive entity.FeiraLivre) (*entity.FeiraLivre, error)
- func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
- func (m *MockRepository) GetByID(arg0 int) (*entity.FeiraLivre, error)
- func (m *MockRepository) GetByQueryParams(arg0 QueryParams) ([]entity.FeiraLivre, error)
- func (m *MockRepository) Remove(arg0 int) error
- func (m *MockRepository) SyncPK() error
- func (m *MockRepository) Update(arg0 int, arg1 entity.FeiraLivre) (*entity.FeiraLivre, error)
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) Create(arg0 interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) CreateOrUpdate(feiraLive interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) GetByID(arg0 interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) GetByQueryParams(arg0 interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) Remove(arg0 interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) SyncPK() *gomock.Call
- func (mr *MockRepositoryMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
- type Pagination
- type QueryParams
- type Repository
Constants ¶
const ( // QueryByID is the query used to get one feiralivre by id QueryByID = `` /* 342-byte string literal not displayed */ // QueryCreate is the query used to create a feiralivre QueryCreate = `` /* 350-byte string literal not displayed */ // QueryCreateOrUpdate is the query used to create or update a feiralivre QueryCreateOrUpdate = `` /* 845-byte string literal not displayed */ // QueryUpdate is the query used to update a feiralivre QueryUpdate = `` /* 439-byte string literal not displayed */ // QueryRemove is the query used to remove a feiralivre QueryRemove = ` DELETE FROM feira_livre WHERE id = $1;` // QuerySyncPK is the query used to sync the feiralivre pk QuerySyncPK = `SELECT SETVAL((SELECT PG_GET_SERIAL_SEQUENCE('"feira_livre"', 'id')), (SELECT (MAX("id") + 1) FROM "feira_livre"), FALSE);` )
Variables ¶
This section is empty.
Functions ¶
func ParseQueryParamsToArgs ¶
func ParseQueryParamsToArgs(qp QueryParams) (args []interface{})
ParseQueryParamsToArgs creates a slice containing the values for the queryparams
func ParseQueryParamsToQuery ¶
func ParseQueryParamsToQuery(qp QueryParams) string
ParseQueryParamsToQuery creates a sql query based on queryparams
Types ¶
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface.
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance.
func (*MockRepository) Create ¶
func (m *MockRepository) Create(arg0 entity.FeiraLivre) (*entity.FeiraLivre, error)
Create mocks base method.
func (*MockRepository) CreateOrUpdate ¶
func (m *MockRepository) CreateOrUpdate(feiraLive entity.FeiraLivre) (*entity.FeiraLivre, error)
CreateOrUpdate mocks base method.
func (*MockRepository) EXPECT ¶
func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRepository) GetByID ¶
func (m *MockRepository) GetByID(arg0 int) (*entity.FeiraLivre, error)
GetByID mocks base method.
func (*MockRepository) GetByQueryParams ¶
func (m *MockRepository) GetByQueryParams(arg0 QueryParams) ([]entity.FeiraLivre, error)
GetByQueryParams mocks base method.
func (*MockRepository) Remove ¶
func (m *MockRepository) Remove(arg0 int) error
Remove mocks base method.
func (*MockRepository) Update ¶
func (m *MockRepository) Update(arg0 int, arg1 entity.FeiraLivre) (*entity.FeiraLivre, error)
Update mocks base method.
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository.
func (*MockRepositoryMockRecorder) Create ¶
func (mr *MockRepositoryMockRecorder) Create(arg0 interface{}) *gomock.Call
Create indicates an expected call of Create.
func (*MockRepositoryMockRecorder) CreateOrUpdate ¶
func (mr *MockRepositoryMockRecorder) CreateOrUpdate(feiraLive interface{}) *gomock.Call
CreateOrUpdate indicates an expected call of CreateOrUpdate.
func (*MockRepositoryMockRecorder) GetByID ¶
func (mr *MockRepositoryMockRecorder) GetByID(arg0 interface{}) *gomock.Call
GetByID indicates an expected call of GetByID.
func (*MockRepositoryMockRecorder) GetByQueryParams ¶
func (mr *MockRepositoryMockRecorder) GetByQueryParams(arg0 interface{}) *gomock.Call
GetByQueryParams indicates an expected call of GetByQueryParams.
func (*MockRepositoryMockRecorder) Remove ¶
func (mr *MockRepositoryMockRecorder) Remove(arg0 interface{}) *gomock.Call
Remove indicates an expected call of Remove.
func (*MockRepositoryMockRecorder) SyncPK ¶
func (mr *MockRepositoryMockRecorder) SyncPK() *gomock.Call
SyncPK indicates an expected call of SyncPK.
func (*MockRepositoryMockRecorder) Update ¶
func (mr *MockRepositoryMockRecorder) Update(arg0, arg1 interface{}) *gomock.Call
Update indicates an expected call of Update.
type Pagination ¶
Pagination contains the fields that could be used to paginate the query result
type QueryParams ¶
type QueryParams struct { Distrito string `query:"distrito"` Regiao5 string `query:"regiao5"` NomeFeira string `query:"nome_feira"` Bairro string `query:"bairro"` Pagination }
QueryParams contains the fields that could be used to query a feiralivre
type Repository ¶
type Repository interface { GetByID(int) (*entity.FeiraLivre, error) GetByQueryParams(QueryParams) ([]entity.FeiraLivre, error) Create(entity.FeiraLivre) (*entity.FeiraLivre, error) CreateOrUpdate(feiraLive entity.FeiraLivre) (*entity.FeiraLivre, error) Update(int, entity.FeiraLivre) (*entity.FeiraLivre, error) Remove(int) error SyncPK() error }
Repository represents how a feiralivre repository should be implemented
func NewPostgresRepository ¶
func NewPostgresRepository(db *sql.DB) Repository
NewPostgresRepository creates a postgres repository for feiralivre