types.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package api
  2. import "github.com/docker/libnetwork/types"
  3. /***********
  4. Resources
  5. ************/
  6. // networkResource is the body of the "get network" http response message
  7. type networkResource struct {
  8. Name string
  9. ID string
  10. Type string
  11. Endpoints []*endpointResource
  12. }
  13. // endpointResource is the body of the "get endpoint" http response message
  14. type endpointResource struct {
  15. Name string
  16. ID string
  17. Network string
  18. }
  19. /***********
  20. Body types
  21. ************/
  22. // networkCreate is the expected body of the "create network" http request message
  23. type networkCreate struct {
  24. Name string
  25. NetworkType string
  26. Options map[string]interface{}
  27. }
  28. // endpointCreate represents the body of the "create endpoint" http request message
  29. type endpointCreate struct {
  30. Name string
  31. NetworkID string
  32. ExposedPorts []types.TransportPort
  33. PortMapping []types.PortBinding
  34. }
  35. // endpointJoin represents the expected body of the "join endpoint" or "leave endpoint" http request messages
  36. type endpointJoin struct {
  37. ContainerID string
  38. HostName string
  39. DomainName string
  40. HostsPath string
  41. ResolvConfPath string
  42. DNS []string
  43. ExtraHosts []endpointExtraHost
  44. ParentUpdates []endpointParentUpdate
  45. UseDefaultSandbox bool
  46. }
  47. // EndpointExtraHost represents the extra host object
  48. type endpointExtraHost struct {
  49. Name string
  50. Address string
  51. }
  52. // EndpointParentUpdate is the object carrying the information about the
  53. // endpoint parent that needs to be updated
  54. type endpointParentUpdate struct {
  55. EndpointID string
  56. Name string
  57. Address string
  58. }