DirStorage
DirStorage is the default Storage: one file named <key>.json per target set in Dir (PROTOCOL §8).
DirStorage is the default Storage: one file named <key>.json per target set in Dir (PROTOCOL §8). The directory is created with mode 0700 and files with mode 0600; writes go to a temporary file that is renamed over the target.
type DirStorage struct {
Dir string
}Fields#
Dir#
Dir stringMethods#
Read#
func (s *DirStorage) Read(key string) ([]byte, error)Read implements Storage.
Write#
func (s *DirStorage) Write(key string, data []byte) errorWrite implements Storage.