Documentation ¶
Index ¶
- type Downloader
- type DownloaderMock
- func (mock *DownloaderMock) Download(c cache.Cache, l provider.Provider, tiles ...tile.Tile) ([]tile.Tile, error)
- func (mock *DownloaderMock) DownloadCalls() []struct{ ... }
- func (mock *DownloaderMock) Merge(side int, centerTile tile.Tile, tiles ...tile.Tile) ([]byte, error)
- func (mock *DownloaderMock) MergeCalls() []struct{ ... }
- type MapDownloader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Downloader ¶
type Downloader interface { Download(c cache.Cache, l provider.Provider, tiles ...tile.Tile) ([]tile.Tile, error) Merge(side int, centerTile tile.Tile, tiles ...tile.Tile) ([]byte, error) }
Downloader implements basic downloader interface
type DownloaderMock ¶
type DownloaderMock struct { // DownloadFunc mocks the Download method. DownloadFunc func(c cache.Cache, l provider.Provider, tiles ...tile.Tile) ([]tile.Tile, error) // MergeFunc mocks the Merge method. MergeFunc func(side int, centerTile tile.Tile, tiles ...tile.Tile) ([]byte, error) // contains filtered or unexported fields }
DownloaderMock is a mock implementation of Downloader.
func TestSomethingThatUsesDownloader(t *testing.T) { // make and configure a mocked Downloader mockedDownloader := &DownloaderMock{ DownloadFunc: func(c cache.Cache, l provider.Provider, tiles ...tile.Tile) ([]tile.Tile, error) { panic("mock out the Download method") }, MergeFunc: func(side int, centerTile tile.Tile, tiles ...tile.Tile) ([]byte, error) { panic("mock out the Merge method") }, } // use mockedDownloader in code that requires Downloader // and then make assertions. }
func (*DownloaderMock) Download ¶
func (mock *DownloaderMock) Download(c cache.Cache, l provider.Provider, tiles ...tile.Tile) ([]tile.Tile, error)
Download calls DownloadFunc.
func (*DownloaderMock) DownloadCalls ¶
func (mock *DownloaderMock) DownloadCalls() []struct { C cache.Cache L provider.Provider Tiles []tile.Tile }
DownloadCalls gets all the calls that were made to Download. Check the length with:
len(mockedDownloader.DownloadCalls())
func (*DownloaderMock) Merge ¶
func (mock *DownloaderMock) Merge(side int, centerTile tile.Tile, tiles ...tile.Tile) ([]byte, error)
Merge calls MergeFunc.
func (*DownloaderMock) MergeCalls ¶
func (mock *DownloaderMock) MergeCalls() []struct { Side int CenterTile tile.Tile Tiles []tile.Tile }
MergeCalls gets all the calls that were made to Merge. Check the length with:
len(mockedDownloader.MergeCalls())
type MapDownloader ¶
type MapDownloader struct {
// contains filtered or unexported fields
}
MapDownloader implements interface Downloader
func NewMapDownloader ¶
func NewMapDownloader(client *http.Client) *MapDownloader
NewMapDownloader create new MapDownloader with specified httpClient
Click to show internal directories.
Click to hide internal directories.