commands

package
v0.0.0-...-afc4a6d Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Overview

Package commands implements the processing of the command line flags and processing of the encryption operation.

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateDuration = errors.New("you cannot use the same duration unit specifier twice in one duration")
View Source
var ErrInvalidDurationFormat = errors.New("unsupported duration type or malformed duration - note: drand can only support as short as seconds")
View Source
var ErrInvalidDurationValue = errors.New("the duration you entered is either in the past or was too large and would cause an overflow")

Functions

func Encrypt

func Encrypt(flags Flags, dst io.Writer, src io.Reader, network *http.Network) error

Encrypt performs the encryption operation. This requires the implementation of an encoder for reading/writing to disk, a network for making calls to the drand network, and an encrypter for encrypting/decrypting the data.

func PrintUsage

func PrintUsage(log *log.Logger)

PrintUsage displays the usage information.

Types

type Flags

type Flags struct {
	Encrypt  bool
	Decrypt  bool
	Force    bool
	Network  string
	Chain    string
	Round    uint64
	Duration string
	Output   string
	Armor    bool
	Metadata bool
}

Flags represent the values from the command line.

func Parse

func Parse() (Flags, error)

Parse will parse the environment variables and command line flags. The command line flags will overwrite environment variables. Validation takes place.

Jump to

Keyboard shortcuts

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