schema

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

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

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

Documentation

Index

Constants

View Source
const (
	PsMsgTypeNode  = "node"
	PsMsgTypeOrder = "order"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	Server Server `json:"server"`
	Target Target `json:"target"`
}

type ControlCommonResult

type ControlCommonResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

ControlCommonResult

type ControlPaginate

type ControlPaginate struct {
	Total    int `json:"total"`
	Current  int `json:"current"`
	PageSize int `json:"pageSize"`
}

ControlPaginate

type MetaData

type MetaData struct {
	Ip   string `json:"ip"`
	Loc  string `json:"loc"`
	Colo string `json:"colo"`
}

type NextServer

type NextServer struct {
	Host string
	Port string
}

NextServer

type NodeInfo

type NodeInfo struct {
	PeerId   string   `json:"peer_id"`
	Addr     string   `json:"addr"`
	Port     int      `json:"port"`
	MetaData MetaData `json:"meta_data"`
	Price    int      `json:"price"`
	Type     NodeType `json:"type"`
}

func (*NodeInfo) String

func (a *NodeInfo) String() string

type NodeOrder

type NodeOrder struct {
	Uuid      string `json:"uuid"`
	Wallet    string `json:"wallet"`
	ServerCid string `json:"server_cid"`
	Port      int    `json:"port"`
	IsHeart   bool   `json:"is_heart"`
}

func (*NodeOrder) String

func (a *NodeOrder) String() string

func (*NodeOrder) ToProviderConfig

func (a *NodeOrder) ToProviderConfig(ctx context.Context, key []byte) (*ProviderConfig, error)

ToProviderConfig 解析config

type NodeType

type NodeType string
const NodeTypeProvider NodeType = "provider"

type ProviderConfig

type ProviderConfig struct {
	CertPem    string `json:"cert_pem"`
	KeyPem     string `json:"key_pem"`
	CaPem      string `json:"ca_pem"`
	CertConfig *certificate.BasicCertConf
}

ProviderConfig provider配置

func (*ProviderConfig) String

func (a *ProviderConfig) String() string

type PsMessage

type PsMessage struct {
	Type string      `json:"type"` // node, order
	Data interface{} `json:"data"`
}

func (*PsMessage) String

func (a *PsMessage) String() string

func (*PsMessage) ToNodeOrder

func (a *PsMessage) ToNodeOrder() (*NodeOrder, error)

ToNodeOrder 转换为节点订单信息

type Resource

type Resource struct {
	UUID string `json:"uuid"`
	Name string `json:"name"`
	Type string `json:"type"`
	Host string `json:"host"`
	Port string `json:"port"`
}

func (*Resource) CheckPort

func (a *Resource) CheckPort(targetPort int) bool

CheckPort Checking the Target Port eg:8080;9090;3000-4000

type Resources

type Resources []*Resource

type Server

type Server struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

type StatusText

type StatusText string

StatusText Define status text

func (StatusText) String

func (t StatusText) String() string

type Target

type Target struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

Jump to

Keyboard shortcuts

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