Documentation ¶
Index ¶
- Variables
- func ConfigUse(cData *CommandData, target string, values []string)
- func ConfigView(cData *CommandData)
- 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)
- func RegisterCommand(cData *CommandData)
- func SetupClient(cData *CommandData, host, configFile string, ...)
- func ShredderFile(localFile string, size int64)
- 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 CommandData
- func (cData *CommandData) CloseKeystore()
- func (cData *CommandData) DownloadFile(data *DownloadData)
- func (cData *CommandData) EditFile(id uint)
- func (cData *CommandData) GetKeystore() (*libdm.Keystore, error)
- func (cData *CommandData) HasKeystoreSupport() bool
- func (cData *CommandData) Init() bool
- func (cData *CommandData) RequestedEncryptionInput() bool
- func (cData *CommandData) UploadFile(uris []string, threads uint, uploadData *UploadData)
- func (cData *CommandData) ViewFile(data *DownloadData)
- type DownloadData
- type FileOrder
- type FileSorter
- 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 update 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)
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)
SetupClient sets up client config
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 CommandData ¶
type CommandData struct { LibDM *libdm.LibDM Command string Config *dmConfig.Config EncryptionKey []byte Encryption, Keyfile string RandKey int Namespace string FileAttributes libdm.FileAttributes Details uint8 NameLen int All, AllNamespaces bool NoRedaction, OutputJSON bool Yes, Force, Quiet bool NoDecrypt, NoEmojis bool VerifyFile bool // contains filtered or unexported fields }
CommandData data for commands
func (*CommandData) CloseKeystore ¶
func (cData *CommandData) CloseKeystore()
CloseKeystore closes keystoree
func (*CommandData) DownloadFile ¶
func (cData *CommandData) DownloadFile(data *DownloadData)
DownloadFile view file
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) RequestedEncryptionInput ¶
func (cData *CommandData) RequestedEncryptionInput() bool
RequestedEncryptionInput determine if encryption input was requested
func (*CommandData) UploadFile ¶
func (cData *CommandData) UploadFile(uris []string, threads uint, uploadData *UploadData)
UploadFile uploads the given file to the server and set's its affiliations
func (*CommandData) ViewFile ¶
func (cData *CommandData) ViewFile(data *DownloadData)
ViewFile view file
type DownloadData ¶
type DownloadData struct { FileName string FileID uint LocalPath string Preview bool NoPreview bool // contains filtered or unexported fields }
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