Documentation ¶
Index ¶
- func EnsureDirExists(path string) error
- func Exec(command string) (string, error)
- func HasCustomThumb(mimeType string) bool
- func IsAudio(mimeType string) bool
- func IsImage(mimeType string) bool
- func IsMedia(mimeType string) bool
- func IsPDF(mimeType string) bool
- func IsVideo(mimeType string) bool
- func ReplaceEnvs(s string) string
- func ShellEscape(text string) string
- func TypesWithCustomThumbnails() []string
- func WithTransaction(ctx context.Context, db *sql.DB, f func(tx *sql.Tx) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDirExists ¶
EnsureDirExists makes sure that there exists a directory for storing the given file in the local filesystem.
func HasCustomThumb ¶
Returns true if the server supports thumbnails for the given type.
func ReplaceEnvs ¶
ReplaceEnvs replaces some environment variable references with their contents. Currently supported: $HOME and $HOSTNAME.
func ShellEscape ¶
ShellEscape escapes a string for use in a shell command
func TypesWithCustomThumbnails ¶
func TypesWithCustomThumbnails() []string
TypesWithCustomThumbnails retrurns mime types for which thumbnails can be generated.
func WithTransaction ¶
WithTransaction begin a transaction, calls a funtion and if the function retruns nil, commits the transaction. If the function returns non-nil error, the transaction is rolled back and the error is returned.
Types ¶
This section is empty.