1
0
mirror of https://github.com/fumiama/go-registry.git synced 2026-06-21 10:30:31 +08:00

add method cat & md5

This commit is contained in:
源文雨
2022-10-27 16:33:55 +08:00
parent 9963c35b7d
commit bc01e93330
6 changed files with 149 additions and 12 deletions

16
storage.go Normal file
View File

@@ -0,0 +1,16 @@
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
}