Documentation ¶
Index ¶
- Variables
- func ConfigUse(cData *CommandData, target string, values []string)
- func ConfigView(cData *CommandData, sessionBase64 bool)
- func CreateKeystore(cData *CommandData, path string, overwrite bool)
- func CreateNamespace(cData *CommandData, name string, customNS bool)
- func DeleteAttribute(cData *CommandData, attribute libdm.Attribute, name string)
- func DeleteFile(cData *CommandData, name string, id uint)
- func DeleteNamespace(cData *CommandData, name string)
- func GetFileCommandData(n string, fid uint) (name string, id uint)
- func GetTempFile(fileName string) string
- func IsOrderReversed(str string) bool
- func KeystoreAddKey(cData *CommandData, keyFile string, fileID uint)
- func KeystoreCleanup(cData *CommandData, shredderCount uint)
- func KeystoreDelete(cData *CommandData, shredderCount uint)
- func KeystoreInfo(cData *CommandData)
- func KeystoreRemoveKey(cData *CommandData, fileID uint)
- func ListFiles(cData *CommandData, name string, id uint, sOrder string)
- func ListNamespace(cData *CommandData)
- func LoginCommand(cData *CommandData, usernameArg string, args ...bool)
- func Ping(cData *CommandData)
- func ProcesStrSliceParam(slice *[]string)
- func ProcesStrSliceParams(slices ...*[]string)
- func PublishFile(cData *CommandData, name string, id uint, publicName string, setClip bool)
- func RegisterCommand(cData *CommandData)
- func SetupClient(cData *CommandData, host, configFile string, ...)
- func ShredderFile(localFile string, size int64)
- func UnPublishFile(cData *CommandData, name string, id uint)
- func UpdateAttribute(cData *CommandData, attribute libdm.Attribute, name, newName string)
- func UpdateFile(cData *CommandData, name string, id uint, newName string, newNamespace string, ...)
- func UpdateNamespace(cData *CommandData, name, newName string, customNS bool)
- type Bar
- type BarTask
- type CommandData
- func (cData *CommandData) CloseKeystore()
- func (cData *CommandData) CreateFile(name string)
- func (cData *CommandData) DownloadFile(downloadData *DownloadData) (*libdm.FileDownloadResponse, error)
- func (cData *CommandData) DownloadNamespace(exGroups, exTags, exFiles []string, parallelism int, outDir string)
- func (cData *CommandData) EditFile(name string, id uint, editor string)
- func (cData *CommandData) FileTree(sOrder, namespace string)
- func (cData *CommandData) GetKeystore() (*libdm.Keystore, error)
- func (cData *CommandData) HasKeystoreSupport() bool
- func (cData *CommandData) Init() bool
- func (cData *CommandData) ListAttributes(attribute libdm.Attribute)
- func (cData *CommandData) Logout(username string)
- func (cData *CommandData) RequestedEncryptionInput() bool
- func (cData *CommandData) UploadItems(uris []string, threads int, uploadData *UploadData)
- func (cData *CommandData) ViewFile(downloadData *DownloadData)
- type DownloadData
- type FileOrder
- type FileSorter
- type HashBench
- type ProgressView
- type UploadData
Constants ¶
This section is empty.
Variables ¶
var ( GreenSuccessfully = color.HiGreenString("Successfully") RedError = color.HiRedString("Error") )
Colorized strings
var AvailableOrders = []string{"id", "name", "size", "pubname", "created", "namespace"}
AvailableOrders options fo ordering
var ( // ErrAbortDeletion if user canceled interaction ErrAbortDeletion = errors.New("aborted") )
var ReversedSuffixes = []string{"r", "d"}
ReversedSuffixes suffixes for reversing sort
var UseTargets = []string{"namespace", "tags", "groups"}
UseTargets targets for config use
Functions ¶
func ConfigUse ¶
func ConfigUse(cData *CommandData, target string, values []string)
ConfigUse command for config use
func CreateKeystore ¶
func CreateKeystore(cData *CommandData, path string, overwrite bool)
CreateKeystore create a keystore
func CreateNamespace ¶
func CreateNamespace(cData *CommandData, name string, customNS bool)
CreateNamespace creates a namespace
func DeleteAttribute ¶
func DeleteAttribute(cData *CommandData, attribute libdm.Attribute, name string)
DeleteAttribute delete an attribute
func DeleteFile ¶
func DeleteFile(cData *CommandData, name string, id uint)
DeleteFile deletes the desired file(s)
func DeleteNamespace ¶
func DeleteNamespace(cData *CommandData, name string)
DeleteNamespace update a namespace
func GetFileCommandData ¶
GetFileCommandData returns id if name is id
func GetTempFile ¶
GetTempFile returns tempfile from fileName
func IsOrderReversed ¶
IsOrderReversed return true if order should be reversed
func KeystoreAddKey ¶
func KeystoreAddKey(cData *CommandData, keyFile string, fileID uint)
KeystoreAddKey adds key to keystore
func KeystoreCleanup ¶
func KeystoreCleanup(cData *CommandData, shredderCount uint)
KeystoreCleanup cleansup a keystore
func KeystoreDelete ¶
func KeystoreDelete(cData *CommandData, shredderCount uint)
KeystoreDelete delete a keystore
func KeystoreRemoveKey ¶
func KeystoreRemoveKey(cData *CommandData, fileID uint)
KeystoreRemoveKey removes key from keystore
func ListFiles ¶
func ListFiles(cData *CommandData, name string, id uint, sOrder string)
ListFiles lists the files corresponding to the args
func LoginCommand ¶
func LoginCommand(cData *CommandData, usernameArg string, args ...bool)
LoginCommand login into the server
func ProcesStrSliceParam ¶
func ProcesStrSliceParam(slice *[]string)
ProcesStrSliceParam divides args by ,
func ProcesStrSliceParams ¶
func ProcesStrSliceParams(slices ...*[]string)
ProcesStrSliceParams divides args by ,
func PublishFile ¶
func PublishFile(cData *CommandData, name string, id uint, publicName string, setClip bool)
PublishFile publishes a file
func RegisterCommand ¶
func RegisterCommand(cData *CommandData)
RegisterCommand create a new account
func SetupClient ¶
func SetupClient(cData *CommandData, host, configFile string, ignoreCert, serverOnly, register, noLogin bool, token, username string)
SetupClient sets up client config
func UnPublishFile ¶ added in v1.4.5
func UnPublishFile(cData *CommandData, name string, id uint)
UnPublishFile makes a public file private
func UpdateAttribute ¶
func UpdateAttribute(cData *CommandData, attribute libdm.Attribute, name, newName string)
UpdateAttribute update an attribute
func UpdateFile ¶
func UpdateFile(cData *CommandData, name string, id uint, newName string, newNamespace string, addTags []string, removeTags []string, addGroups []string, removeGroups []string, setPublic, setPrivate bool)
UpdateFile updates a file on the server
func UpdateNamespace ¶
func UpdateNamespace(cData *CommandData, name, newName string, customNS bool)
UpdateNamespace update a namespace
Types ¶
type Bar ¶ added in v1.4.5
type Bar struct {
// contains filtered or unexported fields
}
Bar a porgressbar
type CommandData ¶
type CommandData struct { LibDM *libdm.LibDM Command string Config *dmConfig.Config EncryptionKey []byte Encryption, Keyfile string RandKey int Namespace string UnmodifiedNamespace string FileAttributes libdm.FileAttributes Details uint8 NameLen int All, AllNamespaces bool NoRedaction, OutputJSON bool Yes, Force, Quiet bool NoDecrypt, NoEmojis bool VerifyFile bool Compression bool Extract bool // contains filtered or unexported fields }
CommandData data for commands
func (*CommandData) CloseKeystore ¶
func (cData *CommandData) CloseKeystore()
CloseKeystore closes keystoree
func (*CommandData) CreateFile ¶ added in v1.4.0
func (cData *CommandData) CreateFile(name string)
CreateFile create a file and upload it
func (*CommandData) DownloadFile ¶
func (cData *CommandData) DownloadFile(downloadData *DownloadData) (*libdm.FileDownloadResponse, error)
DownloadFile download a file specified by data
func (*CommandData) DownloadNamespace ¶ added in v1.4.1
func (cData *CommandData) DownloadNamespace(exGroups, exTags, exFiles []string, parallelism int, outDir string)
DownloadNamespace download files from namespace
func (*CommandData) EditFile ¶
func (cData *CommandData) EditFile(name string, id uint, editor string)
EditFile edits a file
func (*CommandData) FileTree ¶ added in v1.4.0
func (cData *CommandData) FileTree(sOrder, namespace string)
FileTree shows a unix tree like view of files
func (*CommandData) GetKeystore ¶
func (cData *CommandData) GetKeystore() (*libdm.Keystore, error)
GetKeystore returns the keystore for user
func (*CommandData) HasKeystoreSupport ¶
func (cData *CommandData) HasKeystoreSupport() bool
HasKeystoreSupport return true if kesytore is set up correctly and is enabled
func (*CommandData) ListAttributes ¶ added in v1.4.0
func (cData *CommandData) ListAttributes(attribute libdm.Attribute)
ListAttributes lists attributes in a namespace
func (*CommandData) Logout ¶ added in v1.4.0
func (cData *CommandData) Logout(username string)
Logout Logs out the user
func (*CommandData) RequestedEncryptionInput ¶
func (cData *CommandData) RequestedEncryptionInput() bool
RequestedEncryptionInput determine if encryption input was requested
func (*CommandData) UploadItems ¶ added in v1.4.5
func (cData *CommandData) UploadItems(uris []string, threads int, uploadData *UploadData)
UploadItems to the server and set's its affiliations
func (*CommandData) ViewFile ¶
func (cData *CommandData) ViewFile(downloadData *DownloadData)
ViewFile view file
type DownloadData ¶
type DownloadData struct { FileName string FileID uint LocalPath string Preview bool ProgressView *ProgressView }
DownloadData information for downloading files
type FileOrder ¶
type FileOrder int16
FileOrder order/sort stuff
const ( NoOrder FileOrder = iota IDOrder NameOrder SizeOrder PubNameOrder CreatedOrder NamespaceOrder )
Order
func FileOrderFromString ¶
FileOrderFromString return order from string
type FileSorter ¶
type FileSorter struct { Files []*libdm.FileResponseItem Reverse bool }
FileSorter a sorter
func NewFileSorter ¶
func NewFileSorter(files []*libdm.FileResponseItem) *FileSorter
NewFileSorter create a new sorter
func (*FileSorter) Reversed ¶
func (sorter *FileSorter) Reversed(reversed bool) *FileSorter
Reversed Sort reversed
type HashBench ¶ added in v1.4.5
type HashBench struct {
// contains filtered or unexported fields
}
HashBench benchmarks crc32
func NewHashBench ¶ added in v1.4.5
func NewHashBench() *HashBench
NewHashBench create a new hashBench
type ProgressView ¶ added in v1.4.5
type ProgressView struct { ProgressContainer *mpb.Progress Bars []*mpb.Bar RawBars []*Bar }
ProgressView holds info for progress
func NewProgressView ¶ added in v1.4.5
func NewProgressView() *ProgressView
NewProgressView create new progressview
func (*ProgressView) AddBar ¶ added in v1.4.5
func (pv *ProgressView) AddBar(bbar *Bar) *mpb.Bar
AddBar to ProgressView