Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultBrokerTenant string = "default"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntityLocator ¶
type EntityLocator interface {
Locate(ctx context.Context, entityType, entityID string) (latitude, longitude float64, err error)
}
func NewEntityLocator ¶
func NewEntityLocator(host, tenant string) (EntityLocator, error)
type EntityLocatorMock ¶
type EntityLocatorMock struct { // LocateFunc mocks the Locate method. LocateFunc func(ctx context.Context, entityType string, entityID string) (float64, float64, error) // contains filtered or unexported fields }
EntityLocatorMock is a mock implementation of EntityLocator.
func TestSomethingThatUsesEntityLocator(t *testing.T) { // make and configure a mocked EntityLocator mockedEntityLocator := &EntityLocatorMock{ LocateFunc: func(ctx context.Context, entityType string, entityID string) (float64, float64, error) { panic("mock out the Locate method") }, } // use mockedEntityLocator in code that requires EntityLocator // and then make assertions. }
func (*EntityLocatorMock) Locate ¶
func (mock *EntityLocatorMock) Locate(ctx context.Context, entityType string, entityID string) (float64, float64, error)
Locate calls LocateFunc.
func (*EntityLocatorMock) LocateCalls ¶
func (mock *EntityLocatorMock) LocateCalls() []struct { Ctx context.Context EntityType string EntityID string }
LocateCalls gets all the calls that were made to Locate. Check the length with:
len(mockedEntityLocator.LocateCalls())
Click to show internal directories.
Click to hide internal directories.