Documentation ¶
Index ¶
- type Client
- func (c *Client) ConsumeToken(secret string) (Token, error)
- func (c *Client) DeleteKnot(ip, port string) error
- func (c *Client) DeletePubkey(pubkey string) error
- func (c *Client) DeleteWing(name string) error
- func (c *Client) GenerateToken(owner string, wings []string) (string, error)
- func (c *Client) GetAllKnots(knots *[]Knot) error
- func (c *Client) GetAllPubkeys(pubkeys *[]Pubkey) error
- func (c *Client) GetAllTokens(tokens *[]Token) error
- func (c *Client) GetAllWings(wings *[]Wing) error
- func (c *Client) GetKnot(ip, port string) (Knot, error)
- func (c *Client) GetPubkey(pubkey string) (Pubkey, error)
- func (c *Client) GetWing(name string) (Wing, error)
- func (c *Client) InitDB()
- func (c *Client) PutKnot(knot Knot) error
- func (c *Client) PutPubkey(pubkey Pubkey) error
- type KVPair
- type Knot
- type Pubkey
- type Token
- 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 etcd connection
func (*Client) ConsumeToken ¶
ConsumeToken receives a secret and returns the token or an error. After returning the result, the token gets deleted (if found, obviously).
func (*Client) DeleteKnot ¶
DeleteKnot removes a knot and also keys from wings:
func (*Client) DeletePubkey ¶
DeletePubkey receives a string and deletes public key by prefix it also deletes the public key from the wings
func (*Client) GenerateToken ¶
GenerateToken will receive the owner&wings and return the secret for the new token
func (*Client) GetAllKnots ¶
GetAllKnots always returns all knots, or error
func (*Client) GetAllPubkeys ¶
GetAllPubkeys receives a pointer to a slice and fills it up with all public keys
func (*Client) GetAllTokens ¶
GetAllTokens receives a pointer to a slice and fills it up with all tokens
func (*Client) GetKnot ¶
GetKnot returns all keys belonging to a knot in the database keys will always start with "knot:"
func (*Client) GetPubkey ¶
GetPubkey receives a string and returns the pubkey or an error
func (*Client) PutKnot ¶
PutKnot validates the IP and after that adds the knot in the DB If a knot already exists for the IP:Port combination, it returns error
type KVPair ¶
type KVPair struct {
// contains filtered or unexported fields
}
KVPair can be used to send data at etcd
type Knot ¶
Knot holds informaton
type Pubkey ¶
Pubkey struct hold information about a public key wings are just a slice of strings
type Token ¶
Token structure holds all information regarding the token. These tokens are designed to be used only one time.