Documentation
¶
Index ¶
- func DetectMIMEType(data *([]byte)) string
- func GenerateLockKey(identifier string) int64
- func GetEnv(key, fallback string) string
- func GetExtFromFilename(filename string) string
- func GetExtFromMIMEType(mimeType string) string
- func GetImageDimensions(imageBytes []byte) (int32, int32, error)
- func GetMimeTypeFromFilename(filename string) string
- func IsStrTruthy(s string) bool
- func JsonEscape(i string) string
- func MaybeRemoveExif(data []byte) ([]byte, error)
- func Reversed[T any](s []T) []T
- func RunWithLock(lock MutexLock, fn func() error) error
- func RunWorkerPool[T any](tasks []WorkerTask[T], maxWorkers int) chan workerResult[T]
- func SafeDeref[T any](p *T) T
- func SafeDerefWithDefault[T any](p *T, defaultValue T) T
- func Slugify(s string, lower ...bool) string
- type Lazy
- type MutexLock
- type PgAdvisoryLock
- type RedisLock
- type SeekerReader
- type WorkerTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectMIMEType ¶
func GenerateLockKey ¶
func GetExtFromFilename ¶
func GetExtFromMIMEType ¶
func GetMimeTypeFromFilename ¶
func IsStrTruthy ¶
func JsonEscape ¶
func MaybeRemoveExif ¶
func RunWithLock ¶
func RunWorkerPool ¶
func RunWorkerPool[T any](tasks []WorkerTask[T], maxWorkers int) chan workerResult[T]
func SafeDerefWithDefault ¶
func SafeDerefWithDefault[T any](p *T, defaultValue T) T
Types ¶
type PgAdvisoryLock ¶
type PgAdvisoryLock struct {
// contains filtered or unexported fields
}
func NewPgAdvisoryLock ¶
func NewPgAdvisoryLock(db *sql.DB, lockKey int64) *PgAdvisoryLock
func (*PgAdvisoryLock) AcquireLock ¶
func (p *PgAdvisoryLock) AcquireLock() (bool, error)
func (*PgAdvisoryLock) ReleaseLock ¶
func (p *PgAdvisoryLock) ReleaseLock() error
type RedisLock ¶
type RedisLock struct {
// contains filtered or unexported fields
}
func NewRedisLock ¶
func (*RedisLock) AcquireLock ¶
func (*RedisLock) ReleaseLock ¶
type WorkerTask ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.