MCPcopy Create free account
hub / github.com/anchordotdev/cli / View

Method View

trust/models/trust.go:129–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127}
128
129func (m *TrustUpdateStore) View() string {
130 var b strings.Builder
131
132 if len(m.installed) > 0 {
133 var styledCAs []string
134
135 for _, subjectCommonName := range m.commonNames {
136 algorithms := m.installed[subjectCommonName]
137
138 styledCAs = append(styledCAs, fmt.Sprintf("%s [%s]",
139 ui.Underline(subjectCommonName),
140 ui.Whisper(strings.Join(algorithms, ", ")),
141 ))
142 }
143
144 fmt.Fprintln(&b, ui.StepDone(fmt.Sprintf("Updated %s: installed %s",
145 ui.Emphasize(m.Store.Description()),
146 strings.Join(styledCAs, ", "),
147 )))
148 }
149
150 if m.installing != nil {
151 // present thumbprint for comparison with pop up prompt
152 if m.Config.GOOS() == "windows" {
153 fmt.Fprintln(&b, ui.StepHint(fmt.Sprintf("\"%s\" Thumbprint (sha1): %s",
154 m.installing.Subject.CommonName,
155 m.installing.WindowsThumbprint(),
156 )))
157 }
158
159 fmt.Fprintln(&b, ui.StepInProgress(fmt.Sprintf("[%d/%d] Updating %s: installing %s %s… %s",
160 m.index,
161 m.MissingCount,
162 ui.Emphasize(m.Store.Description()),
163 ui.Underline(m.installing.Subject.CommonName),
164 ui.Whisper(m.installing.PublicKeyAlgorithm.String()),
165 m.spinner.View())))
166 }
167
168 return b.String()
169}
170
171type VMHint struct{}
172

Callers

nothing calls this directly

Calls 5

GOOSMethod · 0.80
WindowsThumbprintMethod · 0.80
DescriptionMethod · 0.65
StringMethod · 0.65
ViewMethod · 0.45

Tested by

no test coverage detected