()
| 37 | } |
| 38 | |
| 39 | func (m Metadata) VersionString() string { |
| 40 | switch m.Registry { |
| 41 | case RegistryCloudQuery: |
| 42 | return fmt.Sprintf("%s (%s@%s)", m.Name, m.Path, m.Version) |
| 43 | case RegistryLocal, RegistryGRPC: |
| 44 | return fmt.Sprintf("%s (%s@%s)", m.Name, m.Registry, m.Path) |
| 45 | case RegistryDocker: |
| 46 | return fmt.Sprintf("%s@%s (%s)", m.Name, m.Registry, m.Path) |
| 47 | case RegistryGitHub: |
| 48 | return fmt.Sprintf("%s@%s (%s@%s)", m.Name, m.Registry, m.Path, m.Version) |
| 49 | default: |
| 50 | return fmt.Sprintf("%s@%s (%s)", m.Name, m.Registry, m.Path) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | func (m *Metadata) Validate() error { |
| 55 | if m.Name == "" { |
no outgoing calls