mirror of
https://github.com/fumiama/go-registry.git
synced 2026-06-05 07:50:25 +08:00
17 lines
233 B
Go
17 lines
233 B
Go
package registry
|
|
|
|
import "crypto/md5"
|
|
|
|
type Storage struct {
|
|
Md5 [md5.Size]byte
|
|
m map[string]string
|
|
}
|
|
|
|
func (s *Storage) Get(key string) (string, error) {
|
|
v, ok := s.m[key]
|
|
if ok {
|
|
return v, nil
|
|
}
|
|
return "", ErrNoSuchKey
|
|
}
|