cls3

package module
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 11 Imported by: 0

README

cls3

Go Report Card GitHub GitHub

The description in Japanese is available on the following blog page. -> Blog

What is

CLI tool to clear (so delete all objects and versions/delete-markers in) Amazon S3 Buckets(AWS). The bucket itself can also be deleted by the option.

Install

  • Homebrew
    brew install go-to-k/tap/cls3
    
  • Binary
  • Git Clone and install(for developers)
    git clone https://github.com/go-to-k/cls3.git
    cd cls3
    make install
    

How to use

cls3 -b <bucketName> [-p <profile>] [-r <region>] [-f|--force]
  • -b, --bucketName: required
    • Bucket name
  • -p, --profile: optional
    • AWS profile name
  • -r, --region: optional(default: ap-northeast-1)
    • AWS Region
  • -f, --force: optional
    • ForceMode (Delete the bucket together)

Documentation

Index

Constants

View Source
const DefaultAwsRegion = "us-east-1"
View Source
const SDKRetryMaxAttempts = 3

Variables

View Source
var Logger *zerolog.Logger
View Source
var Revision = ""
View Source
var Version = ""

Functions

func GetVersion added in v0.2.0

func GetVersion() string

func IsDebug added in v0.2.0

func IsDebug() bool

func LoadAWSConfig added in v0.3.0

func LoadAWSConfig(ctx context.Context, region string, profile string) (aws.Config, error)

func NewLogger

func NewLogger(isDebug bool)

Types

type App

type App struct {
	Cli        *cli.App
	BucketName string
	Profile    string
	Region     string
	ForceMode  bool
}

func NewApp

func NewApp(version string) *App

func (*App) Run

func (a *App) Run(ctx context.Context) error

type S3Wrapper added in v0.0.5

type S3Wrapper struct {
	// contains filtered or unexported fields
}

func NewS3Wrapper added in v0.0.5

func NewS3Wrapper(client client.IS3) *S3Wrapper

func (*S3Wrapper) ClearS3Objects added in v0.0.5

func (s *S3Wrapper) ClearS3Objects(ctx context.Context, bucketName string, forceMode bool) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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