cmd

package
v1.44.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 47 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is the class of errors returned by this package.
	Error = errs.Class("uplink")
	// ErrAccessFlag is used where the `--access` flag is registered but not supported.
	ErrAccessFlag = Error.New("--access flag not supported with `setup` and `import` subcommands")
)
View Source
var RootCmd = &cobra.Command{
	Use:                "uplink",
	Short:              "The Storj client-side CLI",
	Args:               cobra.OnlyValidArgs,
	PersistentPreRunE:  combineCobraFuncs(startCPUProfile, modifyFlagDefaults),
	PersistentPostRunE: stopAndWriteProfile,
}

RootCmd represents the base CLI command when called without any subcommands.

Functions

func DisplayGatewayCredentials added in v1.22.1

func DisplayGatewayCredentials(accessKey, secretKey, endpoint, format, awsProfile string) (err error)

DisplayGatewayCredentials formats and writes credentials to stdout.

func IsSerializedAccess added in v0.31.0

func IsSerializedAccess(access string) bool

IsSerializedAccess returns whether the passed access is a serialized access string or not.

func RegisterAccess added in v1.20.1

func RegisterAccess(ctx context.Context, access *uplink.Access, authService string, public bool, timeout time.Duration) (accessKey, secretKey, endpoint string, err error)

RegisterAccess registers an access grant with a Gateway Authorization Service.

Types

type AccessConfig added in v0.30.0

type AccessConfig struct {
	Accesses map[string]string `internal:"true"`
	Access   string            `help:"the serialized access, or name of the access to use" default:"" basic-help:"true"`

	// used for backward compatibility
	Scopes map[string]string `internal:"true"` // deprecated
	Scope  string            `internal:"true"` // deprecated
}

AccessConfig holds information about which accesses exist and are selected.

func (AccessConfig) GetAccess added in v0.30.0

func (a AccessConfig) GetAccess() (_ *uplink.Access, err error)

GetAccess returns the appropriate access for the config.

func (AccessConfig) GetNamedAccess added in v0.30.0

func (a AccessConfig) GetNamedAccess(name string) (_ *uplink.Access, err error)

GetNamedAccess returns named access if exists.

type ClientConfig added in v0.29.0

type ClientConfig struct {
	UserAgent   string        `help:"User-Agent used for connecting to the satellite" default:""`
	DialTimeout time.Duration `help:"timeout for dials" default:"0h2m00s"`
	EnableQUIC  bool          `help:"Use QUIC as the transport protocol when it's available, otherwise, fallback to TCP" default:"false"`
}

ClientConfig is a configuration struct for the uplink that controls how to talk to the rest of the network.

type Config added in v0.29.0

type Config struct {
	AccessConfig
	Client ClientConfig
}

Config uplink configuration.

type UplinkFlags

type UplinkFlags struct {
	Config

	Version checker.Config

	PBKDFConcurrency int `` /* 373-byte string literal not displayed */
}

UplinkFlags configuration flags.

type WriterAt added in v1.37.2

type WriterAt struct {
	object.WriterAt
	// contains filtered or unexported fields
}

WriterAt wraps writer and progress bar to display progress correctly.

func (*WriterAt) Truncate added in v1.37.2

func (w *WriterAt) Truncate(size int64) error

Truncate truncates writer to specific size.

func (*WriterAt) WriteAt added in v1.37.2

func (w *WriterAt) WriteAt(p []byte, off int64) (n int, err error)

WriteAt writes bytes to wrapped writer and add amount of bytes to progress bar.

Jump to

Keyboard shortcuts

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