upload

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArgHelp = `` /* 157-byte string literal not displayed */

ArgHelp is the suffix text that will be displayed after the argument list in the module help

View Source
var Args = flag.NewFlagSet("upload", flag.ExitOnError)

Args is a flagset that needs to be exported so that it can be written to the main program help

View Source
var Usage = `` /* 290-byte string literal not displayed */

Usage text that will be displayed as command line help text when using the `help download` command

Functions

func CheckTokenExpiration

func CheckTokenExpiration(accessToken string) (bool, error)

CheckTokenExpiration is used to determine whether the token is expiring in less than a day

func Upload

func Upload(args []string) error

Upload function uploads files to the s3 bucket. Input can be files or directories to be uploaded recursively

Types

type Config

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"`
}

Config struct for storing the s3cmd file values

func LoadConfigFile

func LoadConfigFile(path string) (*Config, error)

LoadConfigFile loads ini configuration file to the Config struct

Jump to

Keyboard shortcuts

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