box

package
v0.0.0-...-412af48 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileStatus

func FileStatus(name string) (string, error)

FileStatus returns the status of a file.

func FindConfigDir

func FindConfigDir(reporoot, team string) (string, error)

FindConfigDir tests various places until it finds the config dir. If we can't determine the relative path, "" is returned.

func PrettyCommitMessage

func PrettyCommitMessage(verb string, files []string) string

PrettyCommitMessage generates a pretty commit message.

Types

type Box

type Box struct {
	// Paths:
	Team        string // Name of the team (i.e. .blackbox-$TEAM)
	RepoBaseDir string // Rel path to the VCS repo.
	ConfigPath  string // Abs or Rel path to the .blackbox (or whatever) directory.
	ConfigRO    bool   // True if we should not try to change files in ConfigPath.
	// Settings:
	Umask  int    // umask to set when decrypting
	Editor string // Editor to call
	Debug  bool   // Are we in debug logging mode?
	// Cache of data gathered from .blackbox:
	Admins   []string        // If non-empty, the list of admins.
	Files    []string        // If non-empty, the list of files.
	FilesSet map[string]bool // If non-nil, a set of Files.
	// Handles to interfaces:
	Vcs     vcs.Vcs          // Interface access to the VCS.
	Crypter crypters.Crypter // Inteface access to GPG.
	// contains filtered or unexported fields
}

Box describes what we know about a box.

func NewForTestingInit

func NewForTestingInit(vcsname string) *Box

NewForTestingInit creates a box in a bare environment.

func NewFromFlags

func NewFromFlags(c *cli.Context) *Box

NewFromFlags creates a box using items from flags. Nearly all subcommands use this.

func NewUninitialized

func NewUninitialized(c *cli.Context) *Box

NewUninitialized creates a box in a pre-init situation.

func (*Box) AdminAdd

func (bx *Box) AdminAdd(nom string, sdir string) error

AdminAdd adds admins.

func (*Box) AdminList

func (bx *Box) AdminList() error

AdminList lists the admin id's.

func (*Box) AdminRemove

func (bx *Box) AdminRemove([]string) error

AdminRemove removes an id from the admin list.

func (*Box) Cat

func (bx *Box) Cat(names []string) error

Cat outputs a file, unencrypting if needed.

func (*Box) Decrypt

func (bx *Box) Decrypt(names []string, overwrite bool, bulkpause bool, setgroup string) error

Decrypt decrypts a file.

func (*Box) Diff

func (bx *Box) Diff([]string) error

Diff ...

func (*Box) Edit

func (bx *Box) Edit(names []string) error

Edit unencrypts, calls editor, calls encrypt.

func (*Box) Encrypt

func (bx *Box) Encrypt(names []string, shred bool) error

Encrypt encrypts a file.

func (*Box) FileAdd

func (bx *Box) FileAdd(names []string, shred bool) error

FileAdd enrolls files.

func (*Box) FileList

func (bx *Box) FileList() error

FileList lists the files.

func (*Box) FileRemove

func (bx *Box) FileRemove(names []string) error

FileRemove de-enrolls files.

func (*Box) Info

func (bx *Box) Info() error

Info prints debugging info.

func (*Box) Init

func (bx *Box) Init(yes, vcsname string) error

Init initializes a repo.

func (*Box) Reencrypt

func (bx *Box) Reencrypt(names []string, overwrite bool, bulkpause bool) error

Reencrypt decrypts and reencrypts files.

func (*Box) Shred

func (bx *Box) Shred(names []string) error

Shred shreds files.

func (*Box) Status

func (bx *Box) Status(names []string, nameOnly bool, match string) error

Status prints the status of files.

func (*Box) TestingInitRepo

func (bx *Box) TestingInitRepo() error

TestingInitRepo initializes a repo. Uses bx.Vcs to create ".git" or whatever. Uses bx.Vcs to discover what was created, testing its work.

type StatusMode

type StatusMode int

StatusMode is a type of query.

const (
	// Itemized is blah
	Itemized StatusMode = iota // Individual files by name
	// All files is blah
	All
	// Unchanged is blah
	Unchanged
	// Changed is blah
	Changed
)

Jump to

Keyboard shortcuts

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