MCPcopy Index your code
hub / github.com/koding/kite / getBinaryURL

Function getBinaryURL

kitectl/command/install.go:158–177  ·  view source on GitHub ↗
(manifest map[string]interface{})

Source from the content-addressed store, hash-verified

156}
157
158func getBinaryURL(manifest map[string]interface{}) (string, error) {
159 platforms, ok := manifest["platforms"].(map[string]interface{})
160 if !ok {
161 return "", errors.New("no platforms key in kite manifest")
162 }
163
164 platform := runtime.GOOS + "_" + runtime.GOARCH
165
166 platformURL, ok := platforms[platform]
167 if !ok {
168 return "", fmt.Errorf("no binary available for platform: %s", platform)
169 }
170
171 binaryURL, ok := platformURL.(string)
172 if !ok {
173 return "", errors.New("invalid platform URL")
174 }
175
176 return binaryURL, nil
177}
178
179func getVersion(manifest map[string]interface{}) (string, error) {
180 version, ok := manifest["version"].(string)

Callers 1

RunMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected