seer

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: BSD-3-Clause Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultUsageBeaconInterval    = 30 * time.Second
	DefaultAnnounceBeaconInterval = 10 * time.Minute
	ErrorUsageBeaconStopped       = errors.New("usage Stopped")
)
View Source
var (
	DefaultGeoBeaconInterval = 5 * time.Minute
	ErrorGeoBeaconStopped    = errors.New("geoBeacon Stopped")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, node peer.Node) (client *Client, err error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Geo

func (c *Client) Geo() iface.Geo

func (*Client) Usage

func (c *Client) Usage() iface.Usage

type Geo

type Geo Client

func (*Geo) All

func (g *Geo) All() ([]*iface.Peer, error)

func (*Geo) Beacon

func (g *Geo) Beacon(location iface.Location) iface.GeoBeacon

func (*Geo) Distance

func (g *Geo) Distance(from iface.Location, distance float32) ([]*iface.Peer, error)

distance is in meter

func (*Geo) Set

func (g *Geo) Set(location iface.Location) (err error)

type GeoBeacon

type GeoBeacon struct {
	// contains filtered or unexported fields
}

func (*GeoBeacon) Start

func (b *GeoBeacon) Start()

func (*GeoBeacon) Status

func (b *GeoBeacon) Status() error

func (*GeoBeacon) Stop

func (b *GeoBeacon) Stop()

type Peer

type Peer struct {
	Id       string
	Location iface.PeerLocation
}

type Usage

type Usage Client

func (*Usage) AddService

func (u *Usage) AddService(svrType iface.ServiceType, meta map[string]string)

func (*Usage) Announce

func (u *Usage) Announce(services iface.Services, nodeId, clientNodeId string, signature []byte) (response.Response, error)

func (*Usage) Beacon

func (u *Usage) Beacon(hostname, nodeId, clientNodeId string, signature []byte) iface.UsageBeacon

func (*Usage) Get

func (u *Usage) Get(id string) (*iface.UsageReturn, error)

func (*Usage) Heartbeat

func (u *Usage) Heartbeat(usage *iface.UsageData, hostname, nodeId, clientNodeId string, signature []byte) (response.Response, error)

func (*Usage) List

func (u *Usage) List() ([]string, error)

func (*Usage) ListServiceId

func (u *Usage) ListServiceId(name string) (response.Response, error)

type UsageBeacon

type UsageBeacon struct {
	// contains filtered or unexported fields
}

func (*UsageBeacon) Start

func (u *UsageBeacon) Start()

func (*UsageBeacon) Status

func (u *UsageBeacon) Status() error

func (*UsageBeacon) Stop

func (u *UsageBeacon) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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