constant

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: GPL-3.0 Imports: 5 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 (
	ChannelStable  = "stable"
	ChannelBeta    = "beta"
	ChannelNightly = "nightly"
	ChannelDev     = "dev"
)

Release channels. A build that does not have Channel injected is a local developer build.

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"
	// Channel names the release channel this binary was built for. Every build
	// path injects it alongside Version; never infer the channel from the shape
	// of the version string.
	Channel     = ChannelDev
	Repository  = "https://github.com/perfect-panel/server"
	ServiceName = "ApiService"
)

Version PPanel version

Functions

func ChannelLabel added in v1.16.0

func ChannelLabel(channel string) string

ChannelLabel returns the suffix shown next to the version for builds that did not come from the stable channel. Stable builds carry no suffix.

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.

func Display added in v1.16.0

func Display() string

Display returns the version string the CLI and the admin API show operators. The channel comes from Channel and never from the shape of Version: the release pipelines strip the tag's leading "v", so classifying a build by that prefix reported every published release as a development build.

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"
	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