fs

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchGroup = fmt.Errorf("group not found in sherlock")
	ErrNoSuchVault = fmt.Errorf("vault for group not found in sherlock")
	ErrGroupExists = fmt.Errorf("group already exists")
)

Functions

This section is empty.

Types

type Fs

type Fs struct {
	// contains filtered or unexported fields
}

func New

func New(mock afero.Fs) *Fs

func (Fs) CreateGroup

func (fs Fs) CreateGroup(name string, initVault []byte) error

CreateGroup creates a new directory for a given group with its .vault file. if the group already exists it will be overwritten! To check if a group exists you should use the fs.GroupExists func

func (Fs) Delete added in v0.3.2

func (fs Fs) Delete(ctx context.Context, gid string) error

Delete removes the passed in group directory irreversible from sherlock

func (Fs) GroupExists

func (fs Fs) GroupExists(name string) error

func (Fs) InitFs

func (fs Fs) InitFs(initVault []byte) error

InitFs creates all directories required to be setup to use sherlock. If the directory exists nothing happens

func (Fs) ReadGroupVault

func (fs Fs) ReadGroupVault(group string) ([]byte, error)

ReadVault reads the stored .vault file

func (Fs) ReadRegisteredGroups added in v0.3.2

func (fs Fs) ReadRegisteredGroups() ([]string, error)

Read All Groups Saved

func (Fs) VaultExists

func (fs Fs) VaultExists(group string) error

func (Fs) Write

func (fs Fs) Write(ctx context.Context, gid string, data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL