common

package
v0.0.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const GCPHashHeader = "x-goog-hash"

Variables

This section is empty.

Functions

func AddHashHeader added in v0.0.25

func AddHashHeader(c *gin.Context, hash string)

func CRC32CFromReader added in v0.0.25

func CRC32CFromReader(reader io.Reader) (string, error)

func CRC32CSum added in v0.0.25

func CRC32CSum(crc32c hash.Hash32) string

func CRC32CWriter added in v0.0.25

func CRC32CWriter() hash.Hash32

func ClaimsFromToken

func ClaimsFromToken(claim jwt.Claims, token string, key []byte) error

ClaimsFromToken parses the claims from the token

func GetToken

func GetToken(c *gin.Context) (string, error)

GetToken gets the token from the headers

func NewLastModifiedFS added in v0.0.20

func NewLastModifiedFS(fs http.FileSystem, lastModified time.Time) http.FileSystem

NewLastModifiedFS returns a filesystem with a fixed LastModified to enable caching of embedded assets

func ParamS added in v0.0.5

func ParamS(param string, c *gin.Context) string

ParamS sanitize the param

func QueryS added in v0.0.5

func QueryS(param string, c *gin.Context) string

QueryS sanitize the param

func Sanitize added in v0.0.5

func Sanitize(param string) string

Sanitize removes all path separators

func SanitizeUid added in v0.0.23

func SanitizeUid(uid string) string

SanitizeUid

func SignClaims

func SignClaims(claims jwt.Claims, key []byte) (string, error)

SignClaims signs the claims i.e. creates a token

Types

type EntryType added in v0.0.12

type EntryType string
const (
	DocumentType   EntryType = "DocumentType"
	CollectionType EntryType = "CollectionType"
)

type StaticFileInfoWrapper added in v0.0.20

type StaticFileInfoWrapper struct {
	os.FileInfo
	LastModfied time.Time
}

func (*StaticFileInfoWrapper) ModTime added in v0.0.20

func (f *StaticFileInfoWrapper) ModTime() time.Time

type StaticFileWrapper added in v0.0.20

type StaticFileWrapper struct {
	http.File
	LastModified time.Time
}

func (*StaticFileWrapper) Stat added in v0.0.20

func (f *StaticFileWrapper) Stat() (os.FileInfo, error)

type SyncVersion added in v0.0.12

type SyncVersion int
const (
	Sync10 SyncVersion = 10
	Sync15 SyncVersion = 15
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL