kata container endpoint
阿新 • • 發佈:2020-11-13
// Set sets an endpoint type based on the input string. func (endpointType *EndpointType) Set(value string) error { switch value { case "physical": *endpointType = PhysicalEndpointType return nil case "virtual": *endpointType = VethEndpointTypereturn nil case "vhost-user": *endpointType = VhostUserEndpointType return nil case "macvlan": *endpointType = BridgedMacvlanEndpointType return nil case "macvtap": *endpointType = MacvtapEndpointTypereturn nil case "tap": *endpointType = TapEndpointType return nil case "tuntap": *endpointType = TuntapEndpointType return nil case "ipvlan": *endpointType = IPVlanEndpointType returnnil default: return fmt.Errorf("Unknown endpoint type %s", value) } }