Documentation
¶
Index ¶
- Constants
- func Clamp(value, min, max int64) int64
- func ClampCookieAge(seconds *int64) int64
- func ClampU(value, min, max uint64) uint64
- func ConvertImageToNRGBA(srcImage image.Image) (*image.NRGBA, error)
- func DirSize(dirPath string) (int64, error)
- func EncodeImage(dstImage *image.NRGBA) (*bytes.Buffer, error)
- func ExtractPDF()
- func FileSize(filePath string) (int64, error)
- func HashStringSHA1(s string) string
- func IsValidPassword(password string) bool
- func IsValidSessionName(sessionName *string) bool
- func IsValidUsername(username string) bool
- func PathExists(pathTo string) bool
- func PeriodicTask(d time.Duration, f func())
- func ReadJSON(jsonFile string) ([]byte, error)
- func Similarity(a string, b string) float64
- func TransformImage(srcImage *image.NRGBA, width int, cropLandscape bool, ltr bool) *image.NRGBA
- func UniversalExtract(dst string, archivePath string) ([]string, int)
- type Argon2idHash
- type HashSalt
- type OrderedMap
Constants ¶
const DEFAULT_ASPECT_RATIO = 1.5
const DEFAULT_COVER_WIDTH_SHIFT = 0.025
const DEFAULT_THUMB_COVER_WIDTH = 512
const DEFAULT_THUMB_PAGE_WIDTH = 256
Variables ¶
This section is empty.
Functions ¶
func ClampCookieAge ¶ added in v0.7.2
ClampCookieAge returns a valid cookie age in seconds.
func ConvertImageToNRGBA ¶ added in v0.8.0
func EncodeImage ¶ added in v0.7.5
EncodeImage encodes the given image to the format specified in the config.
func ExtractPDF ¶ added in v0.7.0
func ExtractPDF()
func HashStringSHA1 ¶ added in v0.8.0
func IsValidPassword ¶ added in v0.7.2
IsValidPassword checks if the password is valid.
func IsValidSessionName ¶ added in v0.7.2
IsValidSessionName checks if the session name is valid.
func IsValidUsername ¶ added in v0.7.2
IsValidUsername checks if the username is valid.
func PathExists ¶ added in v0.7.0
PathExists checks if the given path exists.
func PeriodicTask ¶
PeriodicTask loops the given function in separate thread between the given interval.
func Similarity ¶ added in v0.7.0
Similarity calculates the similarity between two strings.
func TransformImage ¶ added in v0.8.0
TransformImage resizes the given image to the specified width and returns it. If cover is true, the image will be tried to be cropped to the specified width as some covers include the back cover as well.
Types ¶
type Argon2idHash ¶ added in v0.7.2
type Argon2idHash struct {
// contains filtered or unexported fields
}
Argon2idHash is a wrapper for the argon2id hashing algorithm. https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#password-hashing-algorithms
func DefaultArgon2idHash ¶ added in v0.7.2
func DefaultArgon2idHash() *Argon2idHash
DefaultArgon2idHash constructor function for Argon2idHash. https://tobtu.com/minimum-password-settings/
func NewArgon2idHash ¶ added in v0.7.2
func NewArgon2idHash(time, saltLen, memory uint32, threads uint8, keyLen uint32) *Argon2idHash
NewArgon2idHash constructor function for Argon2idHash.
func (*Argon2idHash) Compare ¶ added in v0.7.2
func (a *Argon2idHash) Compare(hash, salt, password []byte) bool
Compare generated hash with stored hash.
func (*Argon2idHash) GenerateHash ¶ added in v0.7.2
func (a *Argon2idHash) GenerateHash(password, salt []byte) (*HashSalt, error)
GenerateHash using the password and provided salt. If no salt value was provided, fallbacks to a random value of a given length.
type OrderedMap ¶ added in v0.8.0
func NewOrderedMap ¶ added in v0.8.0
func NewOrderedMap() *OrderedMap
func (*OrderedMap) Get ¶ added in v0.8.0
func (om *OrderedMap) Get(key string) (interface{}, bool)
func (*OrderedMap) OrderedKeys ¶ added in v0.8.0
func (om *OrderedMap) OrderedKeys() []string
func (*OrderedMap) Set ¶ added in v0.8.0
func (om *OrderedMap) Set(key string, value interface{})