utils

package
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CBytes

func CBytes(bytes []byte) string

CBytes takes a byte string and casts it to a comma separated string representation of that byte string

func DownloadIMGAsBase64

func DownloadIMGAsBase64(url string) (base64img string, err error)

DownloadIMGAsBase64 will download an image from an url. It returns a base64 encoded image.

func IMGFileToBase64

func IMGFileToBase64(path string) string

IMGFileToBase64 reads an image from a file at given path, i.e., /home/user/test.jpeg. This image is returned as base64 encoded string.

func UniqueSlice

func UniqueSlice(input []string) []string

UniqueSlice removes duplicates and ensures that a slice only comprises unique elements

Types

type RecipeConfig

type RecipeConfig interface {
	GetInt64(key string) int64
	GetString(key string) string
	GetBool(key string) bool
	SetDefault(key string, val interface{})
	BindEnv(key string)
	Debug()
}

RecipeConfig allows the recipe application to retrieve configuration data

var Config RecipeConfig

Config allows this application to access its configuration

func NewViperConfig

func NewViperConfig(name string, paths []string) RecipeConfig

NewViperConfig creates a configuration based on the viper framework

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL