Documentation ¶
Index ¶
- type Client
- func (c *Client) AddPublicKey(pubkey, owner string, wings []string) error
- func (c *Client) DeleteKnot(query string) error
- func (c *Client) DeletePublicKey(query string) error
- func (c *Client) DeleteWing(query string) error
- func (c *Client) EditKnot(name, ipport string, wings []string) error
- func (c *Client) GetMosquitoes(dead bool, query string, response chan Mosquito)
- func (c *Client) ListKnots(query string, response chan Knot)
- func (c *Client) ListPublicKeys(query string, response chan Pubkey)
- func (c *Client) ListWings(query string, response chan Wing)
- func (c *Client) SenseKnots(ipport string, response chan Knot)
- type Knot
- type Mosquito
- type Pubkey
- type Wing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds the connection to the NATS server
func Init ¶
Init will give you a Client that you can use for other operations You need the hostname, the server certificate and the wasp credentials. The timeout will decide how much wasp operations wait after nats. 5 sec is a good value.
func (*Client) AddPublicKey ¶
AddPublicKey takes multiple arguments to add a public key
func (*Client) DeleteKnot ¶
DeleteKnot will delete a knot based on a string received as input the query must be IP.Port or IP:Port
func (*Client) DeletePublicKey ¶
DeletePublicKey will delete a public key based on a string received as input
func (*Client) DeleteWing ¶
DeleteWing will delete a knot based on a string received as input. The query must be the name of the wing. This will also cascade to knots and pubkeys.
func (*Client) EditKnot ¶
EditKnot takes multiple arguments to edit a knot ipport must be format 10.0.0.5:3152
func (*Client) GetMosquitoes ¶
GetMosquitoes will collect all the mosquitoes from all the knots. The "dead" bool means you also want to get the inactive mosquitoes (that don't have a recent Handshake). The query must be in format "knot;pubkey". Only the IP:Port is accepted for the knot in the query. The public key in the query allows you to search by using the public key of the mosquito
func (*Client) ListKnots ¶
ListKnots receives a query and a channel and reponse via channel with all public keys
func (*Client) ListPublicKeys ¶
ListPublicKeys receives a query and a channel and reponse via channel with all public keys
func (*Client) ListWings ¶
ListWings receives a query and a channel and reponse via channel with all wings The query can be the wing name
func (*Client) SenseKnots ¶
SenseKnots gathers information from all knots that are alive Sense can not know when everythin is done, so it just times out after 2 sec of silence ipport can be used in format IP:Port in order to sense only one knot
type Knot ¶
type Knot struct { IPPort string Name string Wings []string Err error BootTimestamp time.Time Mosquitoes int32 }
Knot holds your knot The error allows you to close the response channel this type should only be used via channels, as the spiderweber is based on gRPC
type Mosquito ¶
type Mosquito struct { KnotName string KnotIPPort string MosquitoPublicKey string MosquitoIP string Err error Handshake time.Time }
Mosquito contains all information returned by a spider regarding mosquitoes The error allows you to close the response channel this type should only be used via channels, as the spiderweber is based on gRPC
type Pubkey ¶
Pubkey struct hold information about a public key. The error allows you to close the response channel. This type should only be used via channels, as the spiderweber is based on gRPC.