command

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// http://tldp.org/LDP/abs/html/exitcodes.html
	ExitSuccess = iota
	ExitError
	ExitBadConnection
	ExitInvalidInput // for txn, watch command
	ExitBadFeature   // provided a valid flag with an unsupported value
	ExitInterrupted
	ExitIO
	ExitBadArgs = 128
)

Variables

View Source
var (
	RootCmd = &cobra.Command{
		Use:        cliName,
		Short:      cliDescription,
		Version:    Version,
		SuggestFor: []string{"joss-cli"},
	}

	DebugFlag   bool
	AccessKey   string
	SecretKey   string
	Region      string
	OssType     string
	JossType    = joss.OssTypeJDCloud
	Endpoint    string
	Internal    bool
	VersionFlag bool

	CommandTimeoutFlag string
	CommandTimeout     time.Duration
	Force              bool

	Recursive bool
)
View Source
var (
	Version = "1.0.0+git"
	// We want to replace this variable at build time with "-ldflags -X main.GitSHA=xxx", where const is not supported.
	GitSHA = ""
)

Functions

func ByteCountBinary

func ByteCountBinary(b int64) string

func ExitWithError

func ExitWithError(code int, err error)

func GetJDEndpoint

func GetJDEndpoint(internal bool) string

func NewAccountCommand

func NewAccountCommand() *cobra.Command

func NewBucketAddCommand

func NewBucketAddCommand() *cobra.Command

func NewBucketListCommand

func NewBucketListCommand() *cobra.Command

func NewBucketRemoveCommand

func NewBucketRemoveCommand() *cobra.Command

func NewObjectListCommand

func NewObjectListCommand() *cobra.Command

获取bucket 内的文件

func NewObjectPutCommand

func NewObjectPutCommand() *cobra.Command

func NewSignUrlCommand added in v1.1.0

func NewSignUrlCommand() *cobra.Command

func NewVersionCommand

func NewVersionCommand() *cobra.Command

func SetAccount

func SetAccount(accessKey, secretKey string) (err error)

Types

type Account

type Account struct {
	AccessKey string "json:\"access_key\""
	SecretKey string "json:\"secret_key\""
}

func GetAcount

func GetAcount() (account Account, err error)

配置文件>环境变量

func (*Account) String

func (acc *Account) String() string

func (*Account) ToJson

func (acc *Account) ToJson() (jsonStr string, err error)

Jump to

Keyboard shortcuts

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