helper

package
v0.0.0-...-6e09809 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const LETTERS_FOR_ID = "abcdefghijklmnopqrstuvwxyz0123456789" // lowercase RFC 1123

Variables

View Source
var (
	TKS_ADMIN                   = "tks-admin"
	PREFIX_USER_ID              = "u"
	PREFIX_CLUSTER_ID           = "c"
	PREFIX_ORGANIZATION_ID      = "o"
	PREFIX_APPLICATION_GROUP_ID = "a"
	ID_LENGTH                   = 9
)

Functions

func BoolP

func BoolP(value bool) *bool

func CheckPasswordHash

func CheckPasswordHash(hashVal, userPw string) bool

func Contains

func Contains(s []string, str string) bool

func CreateJWT

func CreateJWT(accountId string, uId string, organizationId string) (string, error)

func DeepCopy

func DeepCopy(src, dest interface{}) error

func GenerateApplicaionGroupId

func GenerateApplicaionGroupId() string

func GenerateClusterId

func GenerateClusterId() string

func GenerateEmailCode

func GenerateEmailCode(ctx context.Context) (string, error)

func GenerateOrganizationId

func GenerateOrganizationId() string

func GenerateRandomString

func GenerateRandomString(length int) string

func HashPassword

func HashPassword(password string) (string, error)

func IsDurationExpired

func IsDurationExpired(targetTime time.Time, duration time.Duration) bool

func ModelToJson

func ModelToJson(in any) string

func NilUUID

func NilUUID() uuid.UUID

func RetrieveClaims

func RetrieveClaims(token *jwt.Token) (map[string]interface{}, error)

func SplitAddress

func SplitAddress(ctx context.Context, url string) (address string, port int)

func StringP

func StringP(value string) *string

func StringToTokenWithoutVerification

func StringToTokenWithoutVerification(tokenString string) (*jwt.Token, error)

func ToSnakeCase

func ToSnakeCase(str string) string

func UUIDP

func UUIDP(value uuid.UUID) *uuid.UUID

func ValidateApplicationGroupId

func ValidateApplicationGroupId(id string) bool

func ValidateClusterId

func ValidateClusterId(id string) bool

func ValidateOrganizationId

func ValidateOrganizationId(id string) bool

func VerifyToken

func VerifyToken(tokenString string) (*jwt.Token, error)

Types

type LogicSshWsSession

type LogicSshWsSession struct {
	IsFlagged bool
	// contains filtered or unexported fields
}

func NewLogicSshWsSession

func NewLogicSshWsSession(cols, rows int, isAdmin bool, sshClient *ssh.Client, wsConn *websocket.Conn) (*LogicSshWsSession, error)

func (*LogicSshWsSession) Close

func (sws *LogicSshWsSession) Close()

func (*LogicSshWsSession) LogString

func (sws *LogicSshWsSession) LogString() string

func (*LogicSshWsSession) Start

func (sws *LogicSshWsSession) Start(quitChan chan bool)

func (*LogicSshWsSession) Wait

func (sws *LogicSshWsSession) Wait(quitChan chan bool)

Jump to

Keyboard shortcuts

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