seer

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Geo() Geo
	Usage() Usage
}

type Cpu

type Cpu struct {
	Total     uint64 `cbor:"21,keyasint"`
	Count     int    `cbor:"22,keyasint"`
	User      uint64 `cbor:"23,keyasint"`
	Nice      uint64 `cbor:"24,keyasint"`
	System    uint64 `cbor:"25,keyasint"`
	Idle      uint64 `cbor:"26,keyasint"`
	Iowait    uint64 `cbor:"27, keyasint"`
	Irq       uint64 `cbor:"28,keyasint"`
	Softirq   uint64 `cbor:"29,keyasint"`
	Steal     uint64 `cbor:"30,keyasint"`
	Guest     uint64 `cbor:"31,keyasint"`
	GuestNice uint64 `cbor:"32,keyasint"`
	StatCount int    `cbor:"33,keyasint"`
}

type Disk

type Disk struct {
	Total     uint64 `cbor:"14,keyasint"`
	Free      uint64 `cbor:"15,keyasint"`
	Used      uint64 `cbor:"16,keyasint"`
	Available uint64 `cbor:"17,keyasint"`
}

type Geo

type Geo interface {
	All() ([]*Peer, error)
	Set(location Location) error
	Beacon(location Location) GeoBeacon
	Distance(from Location, distance float32) ([]*Peer, error)
}

type GeoBeacon

type GeoBeacon interface {
	Start()
}

type Location

type Location struct {
	Latitude  float32 `cbor:"1,keyasint" yaml:"lat"`
	Longitude float32 `cbor:"2,keyasint" yaml:"long"`
}

type Memory

type Memory struct {
	Used  uint64 `cbor:"11,keyasint"`
	Total uint64 `cbor:"12,keyasint"`
	Free  uint64 `cbor:"13,keyasint"`
}

type Peer

type Peer struct {
	Id       string
	Location PeerLocation
}

GeoBeacon Types

type PeerLocation

type PeerLocation struct {
	Timestamp int64    `cbor:"1,keyasint"`
	Location  Location `cbor:"4,keyasint"`
}

type Resolver

type Resolver interface {
	LookupTXT(context.Context, string) ([]string, error)
	LookupCNAME(ctx context.Context, host string) (string, error)
}

type Service

type Service interface {
	services.DBService
	services.GitHubAuth
	Resolver() Resolver
}

type ServiceInfo

type ServiceInfo struct {
	Type ServiceType
	Meta map[string]string
}

type ServiceType

type ServiceType string

Usage Types

const (
	ServiceTypeUnknown   ServiceType = "unknown"
	ServiceTypeHttp      ServiceType = "http"
	ServiceTypeP2P       ServiceType = "p2p"
	ServiceTypeAuth      ServiceType = "auth"
	ServiceTypeSeer      ServiceType = "seer"
	ServiceTypeBilling   ServiceType = "billing"
	ServiceTypeConsole   ServiceType = "console"
	ServiceTypeHoarder   ServiceType = "hoarder"
	ServiceTypeMonkey    ServiceType = "monkey"
	ServiceTypeSubstrate ServiceType = "substrate"
	ServiceTypePatrick   ServiceType = "patrick"
	ServiceTypeTns       ServiceType = "tns"
	ServiceTypeQ         ServiceType = "q"
	ServiceTypeGateway   ServiceType = "gateway"
)

TODO: We repeat these string vars every where...

type Services

type Services []ServiceInfo

type Usage

type Usage interface {
	Beacon(hostname, nodeId, clientNodeId string, signature []byte) UsageBeacon
	Heartbeat(usage *UsageData, hostname, nodeId, clientNodeId string, signature []byte) (response.Response, error)
	Announce(services Services, nodeId, clientNodeId string, signature []byte) (response.Response, error)
	AddService(svrType ServiceType, meta map[string]string)
	List() ([]string, error)
	ListServiceId(name string) (response.Response, error)
	Get(id string) (*UsageReturn, error)
}

type UsageBeacon

type UsageBeacon interface {
	Start()
}

type UsageData

type UsageData struct {
	Memory Memory `cbor:"3,keyasint"`
	Cpu    Cpu    `cbor:"5,keyasint"`
	Disk   Disk   `cbor:"7,keyasint"`
}

type UsageReturn

type UsageReturn struct {
	Id            string
	Name          string
	Type          []string
	Timestamp     int
	UsedMem       int
	TotalMem      int
	FreeMem       int
	TotalCpu      int
	CpuCount      int
	CpuUser       int
	CpuNice       int
	CpuSystem     int
	CpuIdle       int
	CpuIowait     int
	CpuIrq        int
	CpuSoftirq    int
	CpuSteal      int
	CpuGuest      int
	CpuGuestNice  int
	CpuStatCount  int
	Address       string
	TotalDisk     int
	FreeDisk      int
	UsedDisk      int
	AvailableDisk int
}

Jump to

Keyboard shortcuts

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