Documentation
¶
Index ¶
- func Backup(db *sql.DB, backupFile string)
- func CleanupDirectory(path string)
- func Copy(source, destination string) error
- func DoesFileExists(name string) bool
- func FindInSlice(slice []string, val string) (int, bool)
- func GenerateAccessToken() (string, error)
- func GenerateClientIDFromRequest(req *http.Request) string
- func GeneratePhrase() string
- func GenerateRandomDisplayColor() int
- func GetAveragePerformance(key string) float64
- func GetCacheDurationSecondsForPath(filePath string) int
- func GetIPAddressFromRequest(req *http.Request) string
- func GetIndexFromFilePath(path string) string
- func GetRelativePathFromAbsolutePath(path string) string
- func IsUserAgentABot(userAgent string) bool
- func IsUserAgentAPlayer(userAgent string) bool
- func IsValidURL(urlToTest string) bool
- func Move(source, destination string) error
- func ReadRestURLParameter(r *http.Request, parameterName string) (string, error)
- func RenderPageContentMarkdown(raw string) string
- func RenderSimpleMarkdown(raw string) string
- func RestEndpoint(pattern string, handler http.HandlerFunc) (string, http.HandlerFunc)
- func Restore(backupFile string, databaseFile string) error
- func StartPerformanceMonitor(key string)
- func ValidatedFfmpegPath(ffmpegPath string) string
- func VerifyFFMpegPath(path string) error
- type NullTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupDirectory ¶
func CleanupDirectory(path string)
CleanupDirectory removes the directory and makes it fresh again. Throws fatal error on failure.
func DoesFileExists ¶
DoesFileExists checks if the file exists.
func FindInSlice ¶
FindInSlice will return the index if a string is located in a slice of strings.
func GenerateAccessToken ¶
GenerateAccessToken will generate and return an access token.
func GenerateClientIDFromRequest ¶
GenerateClientIDFromRequest generates a client id from the provided request.
func GeneratePhrase ¶
func GeneratePhrase() string
GeneratePhrase will generate and return a random string consisting of our word list.
func GenerateRandomDisplayColor ¶
func GenerateRandomDisplayColor() int
GenerateRandomDisplayColor will return a random _hue_ to be used when displaying a user. The UI should determine the right saturation and lightness in order to make it look right.
func GetAveragePerformance ¶
GetAveragePerformance will return the average durations for the event.
func GetCacheDurationSecondsForPath ¶
GetCacheDurationSecondsForPath will return the number of seconds to cache an item.
func GetIPAddressFromRequest ¶
GetIPAddressFromRequest returns the IP address from a http request.
func GetIndexFromFilePath ¶
GetIndexFromFilePath is a utility that will return the index/key/variant name in a full path.
func GetRelativePathFromAbsolutePath ¶
GetRelativePathFromAbsolutePath gets the relative path from the provided absolute path.
func IsUserAgentABot ¶
IsUserAgentABot returns if a web client user-agent is seen as a bot.
func IsUserAgentAPlayer ¶
IsUserAgentAPlayer returns if a web client user-agent is seen as a media player.
func IsValidURL ¶
IsValidURL will return if a URL string is a valid URL or not.
func ReadRestURLParameter ¶
ReadRestURLParameter will return the parameter from the request of the requested name.
func RenderPageContentMarkdown ¶
RenderPageContentMarkdown will return HTML specifically handled for the user-specified page content.
func RenderSimpleMarkdown ¶
RenderSimpleMarkdown will return HTML without sanitization or specific formatting rules.
func RestEndpoint ¶
func RestEndpoint(pattern string, handler http.HandlerFunc) (string, http.HandlerFunc)
RestEndpoint wraps a handler to use the rest endpoint helper.
func StartPerformanceMonitor ¶
func StartPerformanceMonitor(key string)
StartPerformanceMonitor will keep track of the start time of this event.
func ValidatedFfmpegPath ¶
ValidatedFfmpegPath will take a proposed path to ffmpeg and return a validated path.
func VerifyFFMpegPath ¶
VerifyFFMpegPath verifies that the path exists, is a file, and is executable.
Types ¶
type NullTime ¶
NullTime is a custom nullable time for representing datetime.
func (NullTime) MarshalJSON ¶
MarshalJSON implements the JSON marshal function.
func (NullTime) UnmarshalJSON ¶
UnmarshalJSON implements the JSON unmarshal function.