utils

package
v0.0.0-...-859a9ad Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlattenMap

func FlattenMap(input map[string]interface{}, infix string) map[string]interface{}

func GenerateCode

func GenerateCode() string

Generate a random code with length 6

func GenerateFileName

func GenerateFileName(filename string) string

GenerateFileName generate file name.

func GenerateFolderName

func GenerateFolderName() string

GenerateFolderName generate folder name.

func GenerateJwtToken

func GenerateJwtToken(user_uuid string, community_uuid string) (string, uint, error)

func GenerateObjectName

func GenerateObjectName(filename string) string

GenerateObjectName generate object name with folder and random filename.

func GenerateRandomString

func GenerateRandomString(length int) string

GenerateRandomString generate random string.

func GetCommunityUUID

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

GetCommunityUUID get community uuid from context.

func GetUserUUID

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

GetUserID get user uuid from context.

func OpenKFBanner

func OpenKFBanner()

func StructToMapString

func StructToMapString(data interface{}) (map[string]string, error)

func StructToMapWithJSONTag

func StructToMapWithJSONTag(data interface{}) (map[string]interface{}, error)

Types

type JwtClaims

type JwtClaims struct {
	UserUUID      string `json:"user_uuid"`
	CommunityUUID string `json:"community_uuid"`
	jwt.RegisteredClaims
}

func ParseJwtToken

func ParseJwtToken(tokenString string) (*JwtClaims, error)

Jump to

Keyboard shortcuts

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