package model type Vendor struct { Name string OEMUrl string OEMDir string AppFrontUserImageName string AppFrontAdminImageName string } var ( vendorMap = map[string]*Vendor{ "standard": &Vendor{ Name: "Standard", OEMUrl: "https://artifactory.yizhisec.com/artifactory/yizhisec-release/oem/release/2.1.0-std/oem.tar.gz", OEMDir: "oem", AppFrontUserImageName: "hub.yizhisec.com/hybridscope/v2/front-user:latest", AppFrontAdminImageName: "hub.yizhisec.com/build/hybirdscope/front/admin:latest", }, "elink": &Vendor{ Name: "elink", OEMUrl: "https://artifactory.yizhisec.com/artifactory/yizhisec-release/oem/release/2.1.0-std/oem_csgElink.tar.gz", OEMDir: "oem_csgElink", AppFrontUserImageName: "hub.yizhisec.com/hybridscope/v2/front-user-elink:latest", AppFrontAdminImageName: "hub.yizhisec.com/build/hybirdscope/front/admin:latest", }, "noah": &Vendor{ Name: "noah", OEMUrl: "https://artifactory.yizhisec.com/artifactory/yizhisec-release/oem/release/2.1.0-std/oem_noah.tar.gz", OEMDir: "oem_noah", AppFrontUserImageName: "hub.yizhisec.com/hybridscope/v2/front-user:latest", AppFrontAdminImageName: "hub.yizhisec.com/build/hybirdscope/front/admin:latest", }, "heishuimeng": &Vendor{ Name: "heishuimeng", OEMUrl: "https://artifactory.yizhisec.com/artifactory/yizhisec-release/oem/release/2.1.0-std/oem_heishuimeng.tar.gz", OEMDir: "oem_heishuimeng", AppFrontUserImageName: "hub.yizhisec.com/hybridscope/v2/front-user:latest", AppFrontAdminImageName: "hub.yizhisec.com/build/hybirdscope/front/admin:latest", }, } ) func GetVendor(name string) *Vendor { if vendor, ok := vendorMap[name]; ok { return vendor } return nil } func GetVendorNames() []string { names := make([]string, 0, len(vendorMap)) for name := range vendorMap { names = append(names, name) } return names }