kata container endpoint

 

 

// 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)
        }
}

 

posted on 2020-11-13 18:05  tycoon3  阅读(80)  评论(0编辑  收藏  举报

导航