Documentation ¶
Overview ¶
Package stctl implements storage tranfer actions used by the stctl CLI tool.
Index ¶
- type Command
- func (c *Command) Create(ctx context.Context) (*storagetransfer.TransferJob, error)
- func (c *Command) Disable(ctx context.Context, name string) (*storagetransfer.TransferJob, error)
- func (c *Command) ListJobs(ctx context.Context) error
- func (c *Command) ListOperations(ctx context.Context, name string) error
- func (c *Command) Sync(ctx context.Context) (*storagetransfer.TransferJob, error)
- type TransferJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { Client TransferJob Project string SourceBucket string TargetBucket string Prefixes []string StartTime flagx.Time Interval string AfterDate time.Time MinFileAge time.Duration MaxFileAge time.Duration DeleteAfterTransfer bool Output io.Writer }
Command executes stctl actions.
func (*Command) ListOperations ¶
ListOperations lists past operations for the named job that started after c.AfterDate.
func (*Command) Sync ¶
Sync guarantees that a job exists matching the current command parameters. If a job with matching command parameters already exists, no action is taken. If a matching description is found with different values for IncludePrefixes or StartTimeOfDay, then the original job is disabled and a new job created. In either case, the found or newly created job is returned on success.
type TransferJob ¶
type TransferJob interface { Jobs(ctx context.Context, visit func(resp *storagetransfer.ListTransferJobsResponse) error) error Create(ctx context.Context, create *storagetransfer.TransferJob) (*storagetransfer.TransferJob, error) Get(ctx context.Context, name string) (*storagetransfer.TransferJob, error) Update(ctx context.Context, name string, update *storagetransfer.UpdateTransferJobRequest) (*storagetransfer.TransferJob, error) Operations(ctx context.Context, name string, visit func(r *storagetransfer.ListOperationsResponse) error) error }
TransferJob captures the interface required by Command implementations.