null.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package null
  2. import (
  3. "github.com/docker/libnetwork/driverapi"
  4. "github.com/docker/libnetwork/sandbox"
  5. "github.com/docker/libnetwork/types"
  6. )
  7. const networkType = "null"
  8. type driver struct{}
  9. // New provides a new instance of null driver
  10. func New() (string, driverapi.Driver) {
  11. return networkType, &driver{}
  12. }
  13. func (d *driver) Config(option map[string]interface{}) error {
  14. return nil
  15. }
  16. func (d *driver) CreateNetwork(id types.UUID, option map[string]interface{}) error {
  17. return nil
  18. }
  19. func (d *driver) DeleteNetwork(nid types.UUID) error {
  20. return nil
  21. }
  22. func (d *driver) CreateEndpoint(nid, eid types.UUID, epOptions map[string]interface{}) (*sandbox.Info, error) {
  23. return nil, nil
  24. }
  25. func (d *driver) DeleteEndpoint(nid, eid types.UUID) error {
  26. return nil
  27. }
  28. func (d *driver) EndpointInfo(nid, eid types.UUID) (map[string]interface{}, error) {
  29. return make(map[string]interface{}, 0), nil
  30. }
  31. // Join method is invoked when a Sandbox is attached to an endpoint.
  32. func (d *driver) Join(nid, eid types.UUID, sboxKey string, options map[string]interface{}) error {
  33. return nil
  34. }
  35. // Leave method is invoked when a Sandbox detaches from an endpoint.
  36. func (d *driver) Leave(nid, eid types.UUID, options map[string]interface{}) error {
  37. return nil
  38. }
  39. func (d *driver) Type() string {
  40. return networkType
  41. }