DirStorage

DirStorage is the default Storage: one file named <key>.json per target set in Dir (PROTOCOL §8).

On this page

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 string

Methods#

Read#

func (s *DirStorage) Read(key string) ([]byte, error)

Read implements Storage.

View source

Write#

func (s *DirStorage) Write(key string, data []byte) error

Write implements Storage.

View source