commands

package
v0.0.0-...-5e848ab Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(paths []string, dstPath string, overwrite bool) error

func GetHorcruxPathsInDir

func GetHorcruxPathsInDir(dir string) ([]string, error)

func Prompt

func Prompt(message string, args ...interface{}) string

func Split

func Split(path string, destination string, total int, threshold int) error

func SplitWithPrompt

func SplitWithPrompt(path string) error

func ValidateHorcruxes

func ValidateHorcruxes(horcruxes []Horcrux) error

Types

type Horcrux

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

func GetHorcruxes

func GetHorcruxes(paths []string) ([]Horcrux, error)

func NewHorcrux

func NewHorcrux(path string) (*Horcrux, error)

returns a horcrux with its header parsed, and it's file's read pointer right after the header.

func (*Horcrux) GetFile

func (h *Horcrux) GetFile() *os.File

func (*Horcrux) GetHeader

func (h *Horcrux) GetHeader() HorcruxHeader

func (*Horcrux) GetPath

func (h *Horcrux) GetPath() string

type HorcruxHeader

type HorcruxHeader struct {
	OriginalFilename string `json:"originalFilename"`
	Timestamp        int64  `json:"timestamp"`
	Index            int    `json:"index"`
	Total            int    `json:"total"`
	Threshold        int    `json:"threshold"`
	KeyFragment      []byte `json:"keyFragment"`
}

func GetHeaderFromHorcruxFile

func GetHeaderFromHorcruxFile(file *os.File) (*HorcruxHeader, error)

this function gets the header from the horcrux file and ensures that we leave the file with its read pointer at the start of the encrypted content so that we can later directly read from that point yes this is a side effect, no I'm not proud of it.

Jump to

Keyboard shortcuts

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