github.com/containerd/nerdctl@v1.7.7/pkg/netutil/cni_plugin.go (about) 1 /* 2 Copyright The containerd Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package netutil 18 19 type CNIPlugin interface { 20 GetPluginType() string 21 } 22 23 type IPAMRange struct { 24 Subnet string `json:"subnet"` 25 RangeStart string `json:"rangeStart,omitempty"` 26 RangeEnd string `json:"rangeEnd,omitempty"` 27 Gateway string `json:"gateway,omitempty"` 28 IPRange string `json:"ipRange,omitempty"` 29 } 30 31 type IPAMRoute struct { 32 Dst string `json:"dst,omitempty"` 33 GW string `json:"gw,omitempty"` 34 Gateway string `json:"gateway,omitempty"` 35 } 36 37 type isolationConfig struct { 38 PluginType string `json:"type"` 39 } 40 41 func newIsolationPlugin() *isolationConfig { 42 return &isolationConfig{ 43 PluginType: "isolation", 44 } 45 } 46 47 func (*isolationConfig) GetPluginType() string { 48 return "isolation" 49 }