Documentation ¶
Index ¶
- func FindInSlice(slice []string, val string) (int, bool)
- func GenerateRandomToken(length int) string
- func GenerateSHA1(reader io.Reader) string
- func ObjectIDIntersect(a []primitive.ObjectID, b []primitive.ObjectID) bool
- func ParseConfig(config string) infrastructure.Config
- func ParseGatewayEnv() infrastructure.Config
- func ParseNodeEnv() infrastructure.Config
- func ParsePrimitiveID(hex string) primitive.ObjectID
- func PathExists(path string) bool
- func ReadContent(reader io.Reader) ([]byte, error)
- func ReadFile(path string) (*os.File, error)
- func ReadFileAndContent(path string) (*os.File, []byte, error)
- func ReadJSONFile(config string) (*json.Decoder, *os.File)
- func RemoveID(s []primitive.ObjectID, r primitive.ObjectID) []primitive.ObjectID
- func Thumbnail(file *os.File, thumbSize uint) (io.Reader, *th.Source)
- func UniqueStrings(slice []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindInSlice ¶
FindInSlice iterates over the slice and returns the position of the element if found
func GenerateRandomToken ¶
GenerateRandomToken generates a token of the specified length
func GenerateSHA1 ¶
GenerateSHA1 generates a sha1 hash for the specified reader
func ObjectIDIntersect ¶
ObjectIDIntersect checks whether slice a contains any element of slice b vice versa
func ParseConfig ¶
func ParseConfig(config string) infrastructure.Config
ParseConfig parses the config file into the config object
func ParseGatewayEnv ¶
func ParseGatewayEnv() infrastructure.Config
ParseGatewayEnv parses the Gateway configuration from the environment
func ParseNodeEnv ¶
func ParseNodeEnv() infrastructure.Config
ParseNodeEnv parses the config file into the config object
func ParsePrimitiveID ¶
ParsePrimitiveID parses a given string hex to a primitive object id
func PathExists ¶
PathExists checks if a given path is available on the filesystem
func ReadContent ¶
ReadContent reads the content from a reader into a byte array
func ReadFileAndContent ¶
ReadFileAndContent reads a given file and reads its content into a byte array
func ReadJSONFile ¶
ReadJSONFile tries to open a specified config file
func UniqueStrings ¶
UniqueStrings removes all duplicates from a string slice and returns the result
Types ¶
This section is empty.