Documentation ¶
Index ¶
- Variables
- type Point
- type WaterQuality
- type WaterQualityDTO
- type WaterQualityService
- type WaterQualityServiceMock
- func (mock *WaterQualityServiceMock) Broker() string
- func (mock *WaterQualityServiceMock) BrokerCalls() []struct{}
- func (mock *WaterQualityServiceMock) GetAll(ctx context.Context) []domain.WaterQuality
- func (mock *WaterQualityServiceMock) GetAllCalls() []struct{ ... }
- func (mock *WaterQualityServiceMock) GetAllNearPointWithinTimespan(ctx context.Context, pt Point, distance int, from time.Time, to time.Time) ([]domain.WaterQuality, error)
- func (mock *WaterQualityServiceMock) GetAllNearPointWithinTimespanCalls() []struct{ ... }
- func (mock *WaterQualityServiceMock) GetByID(ctx context.Context, id string, from time.Time, to time.Time) (*domain.WaterQualityTemporal, error)
- func (mock *WaterQualityServiceMock) GetByIDCalls() []struct{ ... }
- func (mock *WaterQualityServiceMock) Refresh(ctx context.Context) (int, error)
- func (mock *WaterQualityServiceMock) RefreshCalls() []struct{ ... }
- func (mock *WaterQualityServiceMock) Shutdown(ctx context.Context)
- func (mock *WaterQualityServiceMock) ShutdownCalls() []struct{ ... }
- func (mock *WaterQualityServiceMock) Start(ctx context.Context)
- func (mock *WaterQualityServiceMock) StartCalls() []struct{ ... }
- func (mock *WaterQualityServiceMock) Tenant() string
- func (mock *WaterQualityServiceMock) TenantCalls() []struct{}
- type WaterQualityTemporalDTO
Constants ¶
This section is empty.
Variables ¶
var ErrWQNotFound error = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type WaterQuality ¶
type WaterQualityDTO ¶
type WaterQualityService ¶
type WaterQualityService interface { Start(ctx context.Context) Refresh(ctx context.Context) (int, error) Shutdown(ctx context.Context) Tenant() string Broker() string GetAll(ctx context.Context) []domain.WaterQuality GetAllNearPointWithinTimespan(ctx context.Context, pt Point, distance int, from, to time.Time) ([]domain.WaterQuality, error) GetByID(ctx context.Context, id string, from, to time.Time) (*domain.WaterQualityTemporal, error) }
func NewWaterQualityService ¶
func NewWaterQualityService(ctx context.Context, url, tenant string) WaterQualityService
type WaterQualityServiceMock ¶
type WaterQualityServiceMock struct { // BrokerFunc mocks the Broker method. BrokerFunc func() string // GetAllFunc mocks the GetAll method. GetAllFunc func(ctx context.Context) []domain.WaterQuality // GetAllNearPointWithinTimespanFunc mocks the GetAllNearPointWithinTimespan method. GetAllNearPointWithinTimespanFunc func(ctx context.Context, pt Point, distance int, from time.Time, to time.Time) ([]domain.WaterQuality, error) // GetByIDFunc mocks the GetByID method. GetByIDFunc func(ctx context.Context, id string, from time.Time, to time.Time) (*domain.WaterQualityTemporal, error) // RefreshFunc mocks the Refresh method. RefreshFunc func(ctx context.Context) (int, error) // ShutdownFunc mocks the Shutdown method. ShutdownFunc func(ctx context.Context) // StartFunc mocks the Start method. StartFunc func(ctx context.Context) // TenantFunc mocks the Tenant method. TenantFunc func() string // contains filtered or unexported fields }
WaterQualityServiceMock is a mock implementation of WaterQualityService.
func TestSomethingThatUsesWaterQualityService(t *testing.T) { // make and configure a mocked WaterQualityService mockedWaterQualityService := &WaterQualityServiceMock{ BrokerFunc: func() string { panic("mock out the Broker method") }, GetAllFunc: func(ctx context.Context) []domain.WaterQuality { panic("mock out the GetAll method") }, GetAllNearPointWithinTimespanFunc: func(ctx context.Context, pt Point, distance int, from time.Time, to time.Time) ([]domain.WaterQuality, error) { panic("mock out the GetAllNearPointWithinTimespan method") }, GetByIDFunc: func(ctx context.Context, id string, from time.Time, to time.Time) (*domain.WaterQualityTemporal, error) { panic("mock out the GetByID method") }, RefreshFunc: func(ctx context.Context) (int, error) { panic("mock out the Refresh method") }, ShutdownFunc: func(ctx context.Context) { panic("mock out the Shutdown method") }, StartFunc: func(ctx context.Context) { panic("mock out the Start method") }, TenantFunc: func() string { panic("mock out the Tenant method") }, } // use mockedWaterQualityService in code that requires WaterQualityService // and then make assertions. }
func (*WaterQualityServiceMock) Broker ¶
func (mock *WaterQualityServiceMock) Broker() string
Broker calls BrokerFunc.
func (*WaterQualityServiceMock) BrokerCalls ¶
func (mock *WaterQualityServiceMock) BrokerCalls() []struct { }
BrokerCalls gets all the calls that were made to Broker. Check the length with:
len(mockedWaterQualityService.BrokerCalls())
func (*WaterQualityServiceMock) GetAll ¶
func (mock *WaterQualityServiceMock) GetAll(ctx context.Context) []domain.WaterQuality
GetAll calls GetAllFunc.
func (*WaterQualityServiceMock) GetAllCalls ¶
func (mock *WaterQualityServiceMock) GetAllCalls() []struct { Ctx context.Context }
GetAllCalls gets all the calls that were made to GetAll. Check the length with:
len(mockedWaterQualityService.GetAllCalls())
func (*WaterQualityServiceMock) GetAllNearPointWithinTimespan ¶
func (mock *WaterQualityServiceMock) GetAllNearPointWithinTimespan(ctx context.Context, pt Point, distance int, from time.Time, to time.Time) ([]domain.WaterQuality, error)
GetAllNearPointWithinTimespan calls GetAllNearPointWithinTimespanFunc.
func (*WaterQualityServiceMock) GetAllNearPointWithinTimespanCalls ¶
func (mock *WaterQualityServiceMock) GetAllNearPointWithinTimespanCalls() []struct { Ctx context.Context Pt Point Distance int From time.Time To time.Time }
GetAllNearPointWithinTimespanCalls gets all the calls that were made to GetAllNearPointWithinTimespan. Check the length with:
len(mockedWaterQualityService.GetAllNearPointWithinTimespanCalls())
func (*WaterQualityServiceMock) GetByID ¶
func (mock *WaterQualityServiceMock) GetByID(ctx context.Context, id string, from time.Time, to time.Time) (*domain.WaterQualityTemporal, error)
GetByID calls GetByIDFunc.
func (*WaterQualityServiceMock) GetByIDCalls ¶
func (mock *WaterQualityServiceMock) GetByIDCalls() []struct { Ctx context.Context ID string From time.Time To time.Time }
GetByIDCalls gets all the calls that were made to GetByID. Check the length with:
len(mockedWaterQualityService.GetByIDCalls())
func (*WaterQualityServiceMock) Refresh ¶
func (mock *WaterQualityServiceMock) Refresh(ctx context.Context) (int, error)
Refresh calls RefreshFunc.
func (*WaterQualityServiceMock) RefreshCalls ¶
func (mock *WaterQualityServiceMock) RefreshCalls() []struct { Ctx context.Context }
RefreshCalls gets all the calls that were made to Refresh. Check the length with:
len(mockedWaterQualityService.RefreshCalls())
func (*WaterQualityServiceMock) Shutdown ¶
func (mock *WaterQualityServiceMock) Shutdown(ctx context.Context)
Shutdown calls ShutdownFunc.
func (*WaterQualityServiceMock) ShutdownCalls ¶
func (mock *WaterQualityServiceMock) ShutdownCalls() []struct { Ctx context.Context }
ShutdownCalls gets all the calls that were made to Shutdown. Check the length with:
len(mockedWaterQualityService.ShutdownCalls())
func (*WaterQualityServiceMock) Start ¶
func (mock *WaterQualityServiceMock) Start(ctx context.Context)
Start calls StartFunc.
func (*WaterQualityServiceMock) StartCalls ¶
func (mock *WaterQualityServiceMock) StartCalls() []struct { Ctx context.Context }
StartCalls gets all the calls that were made to Start. Check the length with:
len(mockedWaterQualityService.StartCalls())
func (*WaterQualityServiceMock) Tenant ¶
func (mock *WaterQualityServiceMock) Tenant() string
Tenant calls TenantFunc.
func (*WaterQualityServiceMock) TenantCalls ¶
func (mock *WaterQualityServiceMock) TenantCalls() []struct { }
TenantCalls gets all the calls that were made to Tenant. Check the length with:
len(mockedWaterQualityService.TenantCalls())