Documentation ¶
Index ¶
- Constants
- Variables
- func ColorToHex(c color.Color) string
- func ConvertPrices(rawPrices map[string]string) map[string]ApproximatePrice
- func FindBackgroundColor(img image.Image) color.Color
- func HTTPGetBytes(url string) ([]byte, error)
- func HTTPGetString(url string) (string, error)
- func HTTPGetToTempfile(url string) (*os.File, error)
- func HTTPPostForm(url string, data url.Values) (*http.Response, error)
- func HTTPReadResponse(resp *http.Response) ([]byte, error)
- func HTTPReadResponseString(resp *http.Response) (string, error)
- func ProjectRootPath(elem ...string) string
- func RandString(n int) string
- func RunMinioTest(fn func(*MinioConnection))
- func SetHTTPTestMode()
- func StringSliceCleanup(s []string) []string
- func StringSliceUnique(col []string) []string
- func StringSlicesDiff(slice1, slice2 []string) []string
- func TransformImage(img image.Image, transform Transform, bgColor color.Color) image.Image
- func UpdateRates() error
- type ApproximatePrice
- type Currency
- type MinioConnection
- type Transform
Constants ¶
View Source
const DefaultCurrency = "USD"
Variables ¶
View Source
var CurrentRates = map[string]*Currency{ "USD": &Currency{Symbol: "$"}, "GBP": &Currency{Symbol: "£"}, "EUR": &Currency{Symbol: "€"}, }
View Source
var (
ErrNotSuccessful = errors.New("HTTP Get request was not successful")
)
Functions ¶
func ColorToHex ¶
func ConvertPrices ¶
func ConvertPrices(rawPrices map[string]string) map[string]ApproximatePrice
func HTTPGetBytes ¶
func HTTPGetString ¶
func ProjectRootPath ¶
func RandString ¶
RandString generates a random string Source: https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-golang
func RunMinioTest ¶
func RunMinioTest(fn func(*MinioConnection))
RunMinioTest creates a minio test bucket and ensures the bucket is removed, even if the test panics.
func SetHTTPTestMode ¶
func SetHTTPTestMode()
func StringSliceCleanup ¶
StringSliceCleanup returns a string slice with empty strings removed.
func StringSliceUnique ¶
func StringSlicesDiff ¶
StringSlicesDiff compares two string slices and returns the difference.
func TransformImage ¶
func UpdateRates ¶
func UpdateRates() error
Types ¶
type ApproximatePrice ¶
type MinioConnection ¶
func NewMinioConnection ¶
func NewMinioConnection() *MinioConnection
func NewMinioTestConnection ¶
func NewMinioTestConnection() *MinioConnection
func (*MinioConnection) Clean ¶
func (conn *MinioConnection) Clean()
Clean removes all files from a bucket and deletes the bucket.
func (*MinioConnection) PutObject ¶
func (conn *MinioConnection) PutObject(objectName string, reader io.Reader, contentType string) error
PutObject creates an object in a bucket.
func (*MinioConnection) RemoveObject ¶
func (conn *MinioConnection) RemoveObject(objectName string) error
RemoveObject removes an object from a bucket.
func (*MinioConnection) TestConfig ¶
func (conn *MinioConnection) TestConfig()
TestConfig checks if the minio settings are valid
Click to show internal directories.
Click to hide internal directories.