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:
16
storage.go
Normal file
16
storage.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user