proto

package
v0.0.0-...-fdd7d54 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 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 Certificate

type Certificate struct {
	Site struct {
		Subject  string   `json:"subject"`
		Altnames []string `json:"altnames"`
		RenewAt  int      `json:"renewAt"`
	} `json:"site"`
	Pems struct {
		Cert      string   `json:"cert"`
		Chain     string   `json:"chain"`
		Privkey   string   `json:"privkey"`
		Subject   string   `json:"subject"`
		Altnames  []string `json:"altnames"`
		IssuedAt  int64    `json:"issuedAt"`
		ExpiresAt int64    `json:"expiresAt"`
	} `json:"pems"`
}

func (*Certificate) Scan

func (a *Certificate) Scan(value interface{}) error

func (Certificate) Value

func (a Certificate) Value() (driver.Value, error)

type HeartBeatReq

type HeartBeatReq struct {
	Stats Stats
}

type HeartBeatRes

type HeartBeatRes struct {
	Success bool `json:"success"`
}

type Ip

type Ip struct {
	Address   string `json:"ip"`
	Swarm     bool
	Gateway   bool
	Signature string
}

type IpTest

type IpTest struct {
	Ip      string `json:"ip"`
	Swarm   bool   `json:"swarm"`
	Gateway bool   `json:"gateway"`
}

func (*IpTest) IsOpen

func (i *IpTest) IsOpen() bool

type JoinReq

type JoinReq struct {
	Address   string `json:"address"`
	Ipv4      Ip     `json:"ipv4"`
	Ipv6      Ip     `json:"ipv6"`
	Signature []byte `json:"signature"`
	Expires   int64  `json:"expires"`
}

type JoinRes

type JoinRes struct {
	Success    bool   `json:"success"`
	Message    string `json:"message"`
	Configured bool   `json:"configured"`
	Certs      map[string]Certificate
}

type Proto

type Proto struct {
	Service Service     `json:"service"`
	Data    interface{} `json:"data"`
}

type Service

type Service int64
const (
	JoinService      Service = iota
	HeartBeatService Service = iota
	SpeedTestService Service = iota
)

type Stats

type Stats struct {
	Storage int64   // total disk space usage
	In      int64   // total bytes in since last sync
	Out     int64   // total bytes out since last sync
	Ingress float64 // ingress bytes/second
	Egress  float64 // egress bytes/second
}

type TestResult

type TestResult struct {
	Ports    map[string]IpTest
	Download float64
	Upload   float64
}

Jump to

Keyboard shortcuts

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