types

package
v0.0.0-...-1059341 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessPoint

type AccessPoint struct {
	AreaID        string
	SchedulerURLs []string
}

type Client

type Client struct {
	Node       *Edge
	Weight     int
	HttpClient *http.Client
}

type Edge

type Edge struct {
	Address      string
	Token        *Token
	NodeID       string
	NATType      string
	SchedulerURL string
	SchedulerKey string
}

func (Edge) GetNATType

func (e Edge) GetNATType() NATType

func (Edge) ToNatPunchReq

func (e Edge) ToNatPunchReq() *NatPunchReq

type EdgeDownloadInfo

type EdgeDownloadInfo struct {
	Address string
	Tk      *Token
	NodeID  string
	NatType string
}

type EdgeDownloadInfoList

type EdgeDownloadInfoList struct {
	Infos        []*EdgeDownloadInfo
	SchedulerURL string
	SchedulerKey string
}

type Extra

type Extra struct {
	Cost    int64 //ms
	Count   int64
	Address string
}

type FileRange

type FileRange struct {
	Start int64
	End   int64
}

type Host

type Host struct {
	IP   string
	Port string
}

func (Host) String

func (h Host) String() string

type NATType

type NATType int
const (
	NATUnknown NATType = iota
	NATOpenInternet
	NATSymmetric
	NATFullCone
	NATRestricted
	NATPortRestricted
	NATUDPBlock
)

func (NATType) String

func (n NATType) String() string

type NatPunchReq

type NatPunchReq struct {
	Tk      *Token
	NodeID  string
	Timeout time.Duration
}

type ProofParam

type ProofParam struct {
	Proofs       *WorkloadReport
	SchedulerKey string
	SchedulerURL string
}

type Token

type Token struct {
	ID string
	// CipherText encrypted TokenPayload by public key
	CipherText string
	// Sign signs CipherText by scheduler private key
	Sign string
}

Token access download asset

type Workload

type Workload struct {
	DownloadSpeed int64 // bytes/ms
	DownloadSize  int64
	StartTime     int64
	EndTime       int64
}

type WorkloadReport

type WorkloadReport struct {
	TokenID  string
	ClientID string
	NodeID   string
	Workload *Workload
	Extra    *Extra `json:"-"`
}

Jump to

Keyboard shortcuts

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