// 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 = VethEndpointType return nil case "vhost-user": *endpointType = VhostUserEndpointType return nil case "macvlan": *endpointType = BridgedMacvlanEndpointType return nil case "macvtap": *endpointType = MacvtapEndpointType return nil case "tap": *endpointType = TapEndpointType return nil case "tuntap": *endpointType = TuntapEndpointType return nil case "ipvlan": *endpointType = IPVlanEndpointType return nil default: return fmt.Errorf("Unknown endpoint type %s", value) } }