utils

package
v0.0.0-...-c0cc0bc Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSimpleMode

func CheckSimpleMode(env cmds.Environment) error

func GenerateToken

func GenerateToken(peerId, secret string, expiryDuration time.Duration) (string, error)

func RandomString

func RandomString(l int) string

func RemoveSpaceAndComma

func RemoveSpaceAndComma(s string) string

RemoveSpaceAndComma remove white space and comma

func TodayUnix

func TodayUnix() int64

TodayUnix truncate today to date,discards hour,minute and second and return unix timestamp

Types

type Claims

type Claims struct {
	PeerId string
	Expiry int64
}

func VerifyToken

func VerifyToken(token string, secret string) (*Claims, error)

Jump to

Keyboard shortcuts

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