1 // Package keystore is a simple key-value storage system with file and memory backing 2 package keystore // import "vimagination.zapto.org/keystore" 3 4 import ( 5 "errors" 6 "io" 7 ) 8 9 // Store represents the methods required for a Keystore 10 type Store interface { 11 Get(string, io.ReaderFrom) error 12 Set(string, io.WriterTo) error 13 Remove(string) error 14 Keys() []string 15 Rename(string, string) error 16 } 17 18 // Errors 19 var ( 20 ErrUnknownKey = errors.New("key not found") 21 ErrKeyExists = errors.New("key already exists") 22 ErrInvalidKey = errors.New("key contains invalid characters") 23 )