common

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func AddCRCHeader added in v0.0.20

func AddCRCHeader(c *gin.Context, crc string)

func CRC32FromReader added in v0.0.20

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

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 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