• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

docker / libnetwork / #3345

pending completion
#3345

push

web-flow
Merge pull request #1674 from sanimej/inspect

154 of 154 new or added lines in 14 files covered. (100.0%)

11544 of 26494 relevant lines covered (43.57%)

33493.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

25.4
/drivers/host/host.go
1
package host
2

3
import (
4
        "sync"
5

6
        "github.com/docker/libnetwork/datastore"
7
        "github.com/docker/libnetwork/discoverapi"
8
        "github.com/docker/libnetwork/driverapi"
9
        "github.com/docker/libnetwork/types"
10
)
11

12
const networkType = "host"
13

14
type driver struct {
15
        network string
16
        sync.Mutex
17
}
18

19
// Init registers a new instance of host driver
20
func Init(dc driverapi.DriverCallback, config map[string]interface{}) error {
×
21
        c := driverapi.Capability{
×
22
                DataScope: datastore.LocalScope,
×
23
        }
×
24
        return dc.RegisterDriver(networkType, &driver{}, c)
×
25
}
×
26

27
func (d *driver) NetworkAllocate(id string, option map[string]string, ipV4Data, ipV6Data []driverapi.IPAMData) (map[string]string, error) {
×
28
        return nil, types.NotImplementedErrorf("not implemented")
×
29
}
×
30

31
func (d *driver) NetworkFree(id string) error {
×
32
        return types.NotImplementedErrorf("not implemented")
×
33
}
×
34

35
func (d *driver) EventNotify(etype driverapi.EventType, nid, tableName, key string, value []byte) {
×
36
}
×
37

38
func (d *driver) DecodeTableEntry(tablename string, key string, value []byte) (string, map[string]string) {
×
39
        return "", nil
×
40
}
×
41

42
func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
2✔
43
        d.Lock()
2✔
44
        defer d.Unlock()
2✔
45

2✔
46
        if d.network != "" {
3✔
47
                return types.ForbiddenErrorf("only one instance of \"%s\" network is allowed", networkType)
1✔
48
        }
1✔
49

50
        d.network = id
1✔
51

1✔
52
        return nil
1✔
53
}
54

55
func (d *driver) DeleteNetwork(nid string) error {
2✔
56
        return types.ForbiddenErrorf("network of type \"%s\" cannot be deleted", networkType)
2✔
57
}
2✔
58

59
func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo, epOptions map[string]interface{}) error {
×
60
        return nil
×
61
}
×
62

63
func (d *driver) DeleteEndpoint(nid, eid string) error {
×
64
        return nil
×
65
}
×
66

67
func (d *driver) EndpointOperInfo(nid, eid string) (map[string]interface{}, error) {
×
68
        return make(map[string]interface{}, 0), nil
×
69
}
×
70

71
// Join method is invoked when a Sandbox is attached to an endpoint.
72
func (d *driver) Join(nid, eid string, sboxKey string, jinfo driverapi.JoinInfo, options map[string]interface{}) error {
×
73
        return nil
×
74
}
×
75

76
// Leave method is invoked when a Sandbox detaches from an endpoint.
77
func (d *driver) Leave(nid, eid string) error {
×
78
        return nil
×
79
}
×
80

81
func (d *driver) ProgramExternalConnectivity(nid, eid string, options map[string]interface{}) error {
×
82
        return nil
×
83
}
×
84

85
func (d *driver) RevokeExternalConnectivity(nid, eid string) error {
×
86
        return nil
×
87
}
×
88

89
func (d *driver) Type() string {
1✔
90
        return networkType
1✔
91
}
1✔
92

93
func (d *driver) IsBuiltIn() bool {
×
94
        return true
×
95
}
×
96

97
// DiscoverNew is a notification for a new discovery event, such as a new node joining a cluster
98
func (d *driver) DiscoverNew(dType discoverapi.DiscoveryType, data interface{}) error {
×
99
        return nil
×
100
}
×
101

102
// DiscoverDelete is a notification for a discovery delete event, such as a node leaving a cluster
103
func (d *driver) DiscoverDelete(dType discoverapi.DiscoveryType, data interface{}) error {
×
104
        return nil
×
105
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2024 Coveralls, Inc