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

Method GetKeyFromPublic

kontrol/keypair.go:193–209  ·  view source on GitHub ↗
(public string)

Source from the content-addressed store, hash-verified

191}
192
193func (m *CachedStorage) GetKeyFromPublic(public string) (*KeyPair, error) {
194 if keyPair, err := m.cache.GetKeyFromPublic(public); err == nil {
195 return keyPair, nil
196 }
197
198 keyPair, err := m.backend.GetKeyFromPublic(public)
199 if err != nil {
200 return nil, err
201 }
202
203 // set key to the cache
204 if err := m.cache.AddKey(keyPair); err != nil {
205 return nil, err
206 }
207
208 return keyPair, nil
209}
210
211func (m *CachedStorage) IsValid(public string) error {
212 if err := m.cache.IsValid(public); err == nil {

Callers

nothing calls this directly

Calls 2

GetKeyFromPublicMethod · 0.65
AddKeyMethod · 0.65

Tested by

no test coverage detected