utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSecret

func GenerateSecret(length int) (string, error)

func GetAdminToken

func GetAdminToken(claims *AdminClaims, key string) (string, error)

func GetJsonStruct

func GetJsonStruct(byteArr []byte, val interface{}) error

func GetMimetypeByPath

func GetMimetypeByPath(path string) string

func GetSessionToken

func GetSessionToken(claims *SessionClaims, key string) (string, error)

func GetTempPath

func GetTempPath(root string, id string, filename string) string

func GetValidatedPayload

func GetValidatedPayload(c echo.Context, payload interface{}) error

func StringToPGUUID

func StringToPGUUID(uuidStr string) (pgtype.UUID, error)

Types

type AdminClaims

type AdminClaims struct {
	AdminID string `json:"uid"`
	jwt.RegisteredClaims
}

func GetAdminInfo

func GetAdminInfo(token string, key string) (*AdminClaims, error)

type FileIO

type FileIO struct {
	// contains filtered or unexported fields
}

func NewFileIO

func NewFileIO(local string, temp string) *FileIO

func (*FileIO) AddChunk

func (fio *FileIO) AddChunk(path string, chunkCount int, fileData []byte) error

func (*FileIO) DeleteFile

func (fio *FileIO) DeleteFile(path string) error

func (*FileIO) MergeChunksAndWriteToStore

func (fio *FileIO) MergeChunksAndWriteToStore(path string, fileName string, totalChunks int64, data []byte) (string, string, error)

func (*FileIO) WriteToStoreOnly

func (fio *FileIO) WriteToStoreOnly(fileName string, data []byte) (string, error)

type SessionClaims

type SessionClaims struct {
	SessionID string `json:"session_id"`
	jwt.RegisteredClaims
}

func GetSessionInfo

func GetSessionInfo(token string, key string) (*SessionClaims, error)

Jump to

Keyboard shortcuts

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