212ac2f0d5
* Refactor of cameradar library * Old unit tests updated & improved. New unit tests inc * Update documentation & issue template * Update dependencies * Update TravisCI build script to reflect argument change * Remove outdated contributing guide * Update README with more examples and remove part on library * Add second camera to Travis build script & improve error detection * Fix typo in travis script & add missing image to readme * Remember that travis uses bash syntax not fish * Use relative paths for images in the README
26 lines
642 B
Go
26 lines
642 B
Go
package cameradar
|
|
|
|
import (
|
|
curl "github.com/ullaakut/go-curl"
|
|
)
|
|
|
|
// Curler is an interface that implements the CURL interface of the go-curl library
|
|
// Used for mocking
|
|
type Curler interface {
|
|
Setopt(opt int, param interface{}) error
|
|
Perform() error
|
|
Getinfo(info curl.CurlInfo) (interface{}, error)
|
|
Duphandle() Curler
|
|
}
|
|
|
|
// Curl is a libcurl wrapper used to make the Curler interface work even though
|
|
// golang currently does not support covariance (see https://github.com/golang/go/issues/7512)
|
|
type Curl struct {
|
|
*curl.CURL
|
|
}
|
|
|
|
// Duphandle wraps curl.Duphandle
|
|
func (c *Curl) Duphandle() Curler {
|
|
return &Curl{c.CURL.Duphandle()}
|
|
}
|