This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 667
/
awsvpc.go
77 lines (54 loc) · 1.66 KB
/
awsvpc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package router
// A dummy overlay for the AWSVPC underlay to make `weave status` to return
// a valid information about peer connections.
import (
"github.com/weaveworks/mesh"
)
// mesh.OverlayConnection
type AWSVPCConnection struct {
establishedChan chan struct{}
errorChan chan error
}
func (conn *AWSVPCConnection) Confirm() {
// We close the channel to notify mesh that the connection has been established.
close(conn.establishedChan)
}
func (conn *AWSVPCConnection) EstablishedChannel() <-chan struct{} {
return conn.establishedChan
}
func (conn *AWSVPCConnection) ErrorChannel() <-chan error {
return conn.errorChan
}
func (conn *AWSVPCConnection) Stop() {}
func (conn *AWSVPCConnection) ControlMessage(tag byte, msg []byte) {
}
func (conn *AWSVPCConnection) Attrs() map[string]interface{} {
return map[string]interface{}{"name": "awsvpc"}
}
// OverlayForwarder
func (conn *AWSVPCConnection) Forward(key ForwardPacketKey) FlowOp {
return DiscardingFlowOp{}
}
type AWSVPC struct{}
func NewAWSVPC() AWSVPC {
return AWSVPC{}
}
// mesh.Overlay
func (vpc AWSVPC) AddFeaturesTo(features map[string]string) {}
func (vpc AWSVPC) PrepareConnection(params mesh.OverlayConnectionParams) (mesh.OverlayConnection, error) {
conn := &AWSVPCConnection{
establishedChan: make(chan struct{}),
errorChan: make(chan error, 1),
}
return conn, nil
}
func (vpc AWSVPC) Diagnostics() interface{} {
return nil
}
func (vpc AWSVPC) Stop() {}
// NetworkOverlay
func (vpc AWSVPC) InvalidateRoutes() {}
func (vpc AWSVPC) InvalidateShortIDs() {}
func (vpc AWSVPC) StartConsumingPackets(localPeer *mesh.Peer, peers *mesh.Peers, consumer OverlayConsumer) error {
return nil
}