Kite returns a single kite gathered from the key and the value for the current node.
()
| 47 | // Kite returns a single kite gathered from the key and the value for the |
| 48 | // current node. |
| 49 | func (n *Node) Kite() (*protocol.KiteWithToken, error) { |
| 50 | kite, err := n.KiteFromKey() |
| 51 | if err != nil { |
| 52 | return nil, err |
| 53 | } |
| 54 | |
| 55 | val, err := n.Value() |
| 56 | if err != nil { |
| 57 | return nil, err |
| 58 | } |
| 59 | |
| 60 | return &protocol.KiteWithToken{ |
| 61 | Kite: *kite, |
| 62 | URL: val.URL, |
| 63 | KeyID: val.KeyID, |
| 64 | }, nil |
| 65 | } |
| 66 | |
| 67 | // KiteFromKey returns a *protocol.Kite from an etcd key. etcd key is like: |
| 68 | // "/kites/devrim/env/mathworker/1/localhost/tardis.local/id" |