Documentation
¶
Index ¶
- Constants
- func CompareHashAndPasswordFromAuthHeader(passwordHash []byte, r *http.Request) error
- func ComparePasswordAndHash(passwordHash []byte, encodedPassword string) error
- func DecodeId(hashId string, resourceType int) (int, error)
- func DeleteFile(fileName string) error
- func EncodeId(id int, resourceType int) string
- func GenerateRandomString(n int) string
- func GetFileMD5Hash(file io.Reader) (string, error)
- func GetFileNameWithTimestamp(fileName string) string
- func GetFileNameWithoutTimestamp(fileName string) string
- func GetFileSHA1Hash(file io.Reader) (string, error)
- func GetFileSizeInKilobytes(file *os.File) (string, error)
- func GetTokenFromAuthHeader(authHeader string, headerType string) (string, error)
- func Initialize(config *config.Config) error
- func InitializeFiles(config *config.Config) error
- func InitializeHashId(config *config.Config) error
- func InitializeJWT(config *config.Config)
- func ReadFile(fileName string) (*os.File, error)
- func ReadFileByteStream(fileName string) ([]byte, error)
- func SaveMultipartFile(file multipart.File, fileName string, w http.ResponseWriter, r *http.Request) error
- func VerifyLoginJWT(authHeader string) (int, error)
- type Claims
- type Files
- type JWT
- type TokenResponse
- type Utils
Constants ¶
View Source
const ( HeaderBearerType = "Bearer" HeaderBasicType = "Basic" )
View Source
const ( FoldersResourceType = 0 FilesResourceType = 1 )
Variables ¶
This section is empty.
Functions ¶
func ComparePasswordAndHash ¶
func DeleteFile ¶
func GenerateRandomString ¶
func GetTokenFromAuthHeader ¶
func Initialize ¶
func InitializeFiles ¶
func InitializeHashId ¶
func InitializeJWT ¶
func ReadFileByteStream ¶
func SaveMultipartFile ¶
func VerifyLoginJWT ¶
Types ¶
type TokenResponse ¶
type TokenResponse struct {
Token string `json:"token"`
}
func CreateLoginJWT ¶
func CreateLoginJWT(email string) (*TokenResponse, error)
Click to show internal directories.
Click to hide internal directories.