MCPcopy Create free account
hub / github.com/docker/go-plugins-helpers / ProgramExternalConnectivity

Method ProgramExternalConnectivity

network/api_test.go:48–62  ·  view source on GitHub ↗
(r *ProgramExternalConnectivityRequest)

Source from the content-addressed store, hash-verified

46}
47
48func (t *TestDriver) ProgramExternalConnectivity(r *ProgramExternalConnectivityRequest) error {
49 i := r.Options["com.docker.network.endpoint.exposedports"]
50 epl, ok := i.([]interface{})
51 if !ok {
52 return fmt.Errorf("invalid data in request: %v (%T)", i, i)
53 }
54 ep, ok := epl[0].(map[string]interface{})
55 if !ok {
56 return fmt.Errorf("invalid data in request: %v (%T)", epl[0], epl[0])
57 }
58 if ep["Proto"].(float64) != 6 || ep["Port"].(float64) != 70 {
59 return fmt.Errorf("Unexpected exposed ports in request: %v", ep)
60 }
61 return nil
62}
63
64func (t *TestDriver) RevokeExternalConnectivity(r *RevokeExternalConnectivityRequest) error {
65 return nil

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected