constant

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Int64   int64  = 0
	Uint32  uint32 = 0
	DevMode        = "dev"
)

Used for type cloning conversion

View Source
const TempOrderCacheKey = "temp_order:%s"

TempOrderCacheKey Cache to Redis Key eg: temp_order:order_no

Variables

View Source
var (
	Version     = "unknown version"
	BuildTime   = "unknown time"
	Repository  = "https://github.com/perfect-panel/server"
	ServiceName = "ApiService"
)

Version PPanel version

Functions

func CheckoutTokenHash added in v1.14.16

func CheckoutTokenHash(token string) string

CheckoutTokenHash returns the durable representation of the guest checkout capability. Only the caller receives the original high-entropy token.

Types

type CtxKey

type CtxKey string
const (
	CtxKeyUser         CtxKey = "user"
	CtxKeySessionID    CtxKey = "sessionId"
	CtxKeyRequestHost  CtxKey = "requestHost"
	CtxKeyPlatform     CtxKey = "platform"
	CtxKeyPayment      CtxKey = "payment"
	CtxKeyDeviceSecure CtxKey = "deviceSecure"
	CtxKeyClientIP     CtxKey = "clientIP"
	LoginType          CtxKey = "loginType"
)

type TemporaryOrderInfo

type TemporaryOrderInfo struct {
	OrderNo       string `json:"order_no"`
	CheckoutToken string `json:"checkout_token"`
	Identifier    string `json:"identifier"`
	AuthType      string `json:"auth_type"`
	// PasswordHash is the one-way encoded password needed to finish a guest
	// account after payment.  Never place the plaintext password in Redis.
	PasswordHash string `json:"password_hash,omitempty"`
	// Password is retained only to finish orders created by older releases.
	// New orders never populate it and it must never be logged.
	Password   string `json:"password,omitempty"`
	InviteCode string `json:"invite_code,omitempty"`
}

func (*TemporaryOrderInfo) Marshal

func (t *TemporaryOrderInfo) Marshal() ([]byte, error)

func (*TemporaryOrderInfo) Unmarshal added in v1.1.0

func (t *TemporaryOrderInfo) Unmarshal(data []byte) error

type VerifyType

type VerifyType uint8

VerifyType is the type of verification code

const (
	Register VerifyType = iota + 1
	Security
)

func ParseVerifyType

func ParseVerifyType(i uint8) VerifyType

func (VerifyType) String

func (v VerifyType) String() string

Jump to

Keyboard shortcuts

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