utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDollarLatexToHTML

func ConvertDollarLatexToHTML(text string) string

func ConvertDollarLatexToLaTeX

func ConvertDollarLatexToLaTeX(text string) string

func ConvertHTMLTODollarLatex

func ConvertHTMLTODollarLatex(text string) string

func DownloadFile

func DownloadFile(urlPath string) (string, error)

func GenItemId

func GenItemId(teachingId int64, id int64) int64

func GenQuestionAnswerId

func GenQuestionAnswerId(teachingId int64, id int64) int64

tbd: UUID

func GetOutNetIp

func GetOutNetIp() string

func Int642String

func Int642String(i int64) string

int642String convert int64 to string

func IsNoInArrEleMent

func IsNoInArrEleMent[T comparable](arr []T, val T) bool

func NoInArrEleMent

func NoInArrEleMent[T comparable](arr []T, ele []T) []T

generic NoInArrEleMent

func ObjectAssignBySameTypeName

func ObjectAssignBySameTypeName(in, out interface{}) interface{}

func PathExists

func PathExists(path string) (bool, error)

func ReadExcel

func ReadExcel(filename string) ([][]string, error)

func RemoveDuplicateInt64Slice

func RemoveDuplicateInt64Slice(languages []int64) []int64

RemoveDuplicateInt64Slice 数组去重 int64

func RemoveDuplicateStringSlice

func RemoveDuplicateStringSlice(languages []string) []string

RemoveDuplicateStringSlice 数组去重 string

func RemoveFile

func RemoveFile(path string) error

func ReverseString

func ReverseString(s []string) []string

func SaveUploadFileToLocalPath

func SaveUploadFileToLocalPath(file multipart.File, handler *multipart.FileHeader) (string, error)

func SaveUploadfile2TmpFile

func SaveUploadfile2TmpFile(file multipart.File, handler *multipart.FileHeader) (string, error)

func String2Int32

func String2Int32(s string) (int32, error)

String2Int32 convert string to int32

func String2Int64

func String2Int64(s string) (int64, error)

string to int64

func StringArrToString

func StringArrToString(s []string) string

func UniqueEleMent

func UniqueEleMent[T comparable](arr []T) []T

Types

type Claims

type Claims struct {
	UID      string
	Platform string //login platform
	jwt.RegisteredClaims
}

func BuildClaims

func BuildClaims(uid, platform string, ttl int64) Claims

Jump to

Keyboard shortcuts

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