Documentation ¶
Index ¶
- func CheckTokenExpiration(accessToken string) error
- func CheckValidChars(filename string) error
- func CreatePubFile(publicKey string, filename string) (string, error)
- func FileExists(filename string) bool
- func FileIsReadable(filename string) bool
- func FormatSubcommandUsage(usageString string) string
- func GetPublicKeyFromSession() (string, error)
- func ListFiles(config Config, prefix string) (result *s3.ListObjectsV2Output, err error)
- func ParseArgs(args []string, argFlags *flag.FlagSet) error
- func ParseS3ErrorResponse(respBody io.Reader) (string, error)
- func PromptPassword(message string) (password string, err error)
- type Config
- type CustomReader
- type EncryptionFileSet
- type XMLerrorResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckTokenExpiration ¶ added in v0.1.0
CheckTokenExpiration is used to determine whether the token is expiring in less than a day
func CheckValidChars ¶ added in v0.1.1
Check for invalid characters
func CreatePubFile ¶ added in v0.1.1
Create public key file
func FileExists ¶
FileExists checks if a file exists in the file system. Note that this function will not check if the file is readable, or if the file is a directory, only if it exists.
func FileIsReadable ¶
FileIsReadable checks that a file exists, and is readable by the program.
func FormatSubcommandUsage ¶
FormatSubcommandUsage moves the lines in the standard usage strings around so that the usage string is indented under the help text instead of above it.
func GetPublicKeyFromSession ¶ added in v0.1.1
reads the .sda-cli-session file, creates the public key file and returns the name of the file
func ListFiles ¶ added in v0.1.0
func ListFiles(config Config, prefix string) (result *s3.ListObjectsV2Output, err error)
func ParseS3ErrorResponse ¶ added in v0.0.4
ParseS3ErrorResponse checks if reader stream is xml encoded and if yes unmarshals the xml response and returns it.
func PromptPassword ¶
PromptPassword creates a user prompt for inputting passwords, where all characters are masked with "*"
Types ¶
type Config ¶ added in v0.1.0
type Config struct { AccessKey string `ini:"access_key"` SecretKey string `ini:"secret_key"` AccessToken string `ini:"access_token"` HostBucket string `ini:"host_bucket"` HostBase string `ini:"host_base"` MultipartChunkSizeMb int64 `ini:"multipart_chunk_size_mb"` GuessMimeType bool `ini:"guess_mime_type"` Encoding string `ini:"encoding"` CheckSslCertificate bool `ini:"check_ssl_certificate"` CheckSslHostname bool `ini:"check_ssl_hostname"` UseHTTPS bool `ini:"use_https"` SocketTimeout int `ini:"socket_timeout"` HumanReadableSizes bool `ini:"human_readable_sizes"` PublicKey string `ini:"public_key"` }
Config struct for storing the s3cmd file values
func GetAuth ¶ added in v0.1.1
GetAuth calls LoadConfig if we have a config file, otherwise try to load .sda-cli-session
func LoadConfigFile ¶ added in v0.1.0
LoadConfigFile loads ini configuration file to the Config struct
type CustomReader ¶ added in v0.1.0
type CustomReader struct { Fp *os.File Size int64 Reads int64 Bar *mpb.Bar SignMap map[int64]struct{} Mux sync.Mutex }
progress bar definitions Produces a progress bar with decorators that can produce different styles Check https://github.com/vbauerster/mpb for more info and how to use it
type EncryptionFileSet ¶
struct type to keep track of infiles and outfiles for encryption and decryption
type XMLerrorResponse ¶ added in v0.0.4
type XMLerrorResponse struct { Code string `xml:"Code"` Message string `xml:"Message"` Resource string `xml:"Resource"` }
struct type to unmarshall xml error response from s3 server