Documentation ¶
Index ¶
- func CtxCopy(ctx context.Context, dst io.Writer, src io.Reader) (written int64, err error)
- func CtxCopyN(ctx context.Context, dst io.Writer, src io.Reader, n int64) (written int64, err error)
- func EnsureFolder(path string) error
- func IsIgnoredFile(file string) bool
- func IsRegularFile(path string) (bool, error)
- func IsTruthy(str string) bool
- func Mapify(m interface{}) map[string]interface{}
- func PathExists(path string) (bool, error)
- func SanitizeConnectionName(conn string) string
- func SanitizeMimeType(mime string) string
- func SanitizePath(path string) string
- func StringInSlice(list []string, a string) bool
- func TouchFile(name string) (err error)
- type CtxReader
- type CtxWriter
- type HttpRange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureFolder ¶
EnsureFolder creates a folder if it doesn't exist already
func IsIgnoredFile ¶ added in v0.2.1
IsIgnoredFile returns true if the file should be ignored and not added to the repository Ignored files include OS metadata files etc
func IsRegularFile ¶
IsRegularFile returns true if the path is a file
func IsTruthy ¶
IsTruthy returns true if a string represent a "true" value, such as "true", "1", etc
func Mapify ¶
func Mapify(m interface{}) map[string]interface{}
Mapify converts a struct to a map[string]interface{} If fields are structs, they're converted to their textual representation
func PathExists ¶
PathExists returns true if the path exists on disk
func SanitizeConnectionName ¶
SanitizeConnectionName returns a sanitized name for a connection or an empty string
func SanitizeMimeType ¶ added in v0.3.0
SanitizeMimeType sanitizes a mime type
func SanitizePath ¶ added in v0.2.0
SanitizePath removes certain problematic characters from path names
func StringInSlice ¶
StringInSlice checks if a string is contained inside a slice of strings
Types ¶
type CtxReader ¶ added in v0.5.0
func ReaderFuncWithContext ¶ added in v0.4.1
ReaderFuncWithContext returns a stream reader that supports a context