utils

package
v0.0.0-...-0b4b916 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatTime

func FormatTime(str v1.Time) string

func GenRSAPubAndPri

func GenRSAPubAndPri(bits int, filepath string) error

func GenerateToken

func GenerateToken(userId int64, privateKey []byte, expireTime time.Time) (string, error)

func MD5

func MD5(str string) string

func ParseToken

func ParseToken(token string, publicKey []byte) (*jwt.Token, error)

Types

type CoreV1Deployments

type CoreV1Deployments []*v1.Deployment

func (CoreV1Deployments) Len

func (this CoreV1Deployments) Len() int

func (CoreV1Deployments) Less

func (this CoreV1Deployments) Less(i, j int) bool

func (CoreV1Deployments) Swap

func (this CoreV1Deployments) Swap(i, j int)

type CoreV1Pods

type CoreV1Pods []*corev1.Pod

func (CoreV1Pods) Len

func (this CoreV1Pods) Len() int

func (CoreV1Pods) Less

func (this CoreV1Pods) Less(i, j int) bool

func (CoreV1Pods) Swap

func (this CoreV1Pods) Swap(i, j int)

type MapItem

type MapItem struct {
	Key string
	// contains filtered or unexported fields
}

type MapItems

type MapItems []*MapItem

func ConvertToMapItems

func ConvertToMapItems(m sync.Map) MapItems

把sync.map 转为自定义切片

func (MapItems) Len

func (this MapItems) Len() int

func (MapItems) Less

func (this MapItems) Less(i, j int) bool

func (MapItems) Swap

func (this MapItems) Swap(i, j int)

type UserClaim

type UserClaim struct {
	UserId int64 `json:"user_id"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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