browses3

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 23 Imported by: 0

README

browse-s3 CLI

browse-s3 tool is used for accessing S3. The browse-s3 CLI tool can do the following:

  • browse buckets
  • show content of files
  • open image file
  • copy file to local storage
  • use prefix/filter
  • date

Example

❯ ./browse-s3 --help
NAME:
browse-s3 - A new cli application

USAGE:
browse-s3 [global options] command [command options] [arguments...]

DESCRIPTION:
Browse AWS S3

COMMANDS:
help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
--profile value  aws profile to use for access
--bucket value   bucket to browse optional with path
--filter value   regexp for bucket/file names
--day value      date string (YYYY-MM-DD) to match buckets/files only if bucket is set
--help, -h       show help (default: false)

Browse files in a bucket

browse-s3 --profile im-saasstage  --bucket im-saas-env-configurationbucket-179gyf6ri972i

List buckets

browse-s3 --profile im-saasstage --filter ".*wire.*"

Files in a specific bucket folder

browse-s3 --profile im-saastage --bucket wireingest-filearea-1x1v8ekfnrc4z/ktd/wam/

browse-s3 --profile im-saastage --bucket wireingest-filearea-1x1v8ekfnrc4z/ktd/wam/ --filter ".*xml"

Demo CCA Importer files

go run cmd/main.go  --profile im-saasstage --bucket wireingest-filearea-1x1v8ekfnrc4z --filter ktd/wam --suffix xml

go run cmd/main.go  --profile im-saasstage --bucket wireingest-filearea-1x1v8ekfnrc4z --filter ktd/wam --suffix jpg

Demo view Open Content object stored in S3 bucket

go run cmd/main.go  --profile gota --bucket gota-ocdata-imid-editorial/46ec818a-64fa-5a67-b81f-dea0509f617d/

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HelpTextBuckets = `` /* 413-byte string literal not displayed */

)

Functions

func AssumeProfile

func AssumeProfile(sess *session.Session, profile string) (*session.Session, error)

Types

type Bucket

type Bucket struct {
	Name         string
	CreationDate time.Time
	Location     string
}

type BucketModel

type BucketModel struct {
	Files []*S3File

	WindowSize tea.WindowSizeMsg

	Plugins map[string]func(bm *BucketModel) (tea.Model, tea.Cmd)
	// contains filtered or unexported fields
}

func NewBucketModel

func NewBucketModel(sess *session.Session, bucketFullPath string, filter string, day string) (BucketModel, error)

func (*BucketModel) GetFile

func (b *BucketModel) GetFile() string

func (*BucketModel) Init

func (b *BucketModel) Init() tea.Cmd

func (*BucketModel) Load

func (b *BucketModel) Load(reload bool) error

func (*BucketModel) NextPage

func (b *BucketModel) NextPage()

func (*BucketModel) PickRow

func (b *BucketModel) PickRow(file s3.Object) bool

func (*BucketModel) PrevPage

func (b *BucketModel) PrevPage()

func (*BucketModel) SetFilter

func (b *BucketModel) SetFilter(filter string) error

func (*BucketModel) Update

func (b *BucketModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*BucketModel) View

func (b *BucketModel) View() string

type BucketsModel

type BucketsModel struct {
	Buckets []*Bucket
	// contains filtered or unexported fields
}

func NewBucketsModel

func NewBucketsModel(sess *session.Session, filter string) (BucketsModel, error)

func (*BucketsModel) Init

func (b *BucketsModel) Init() tea.Cmd

func (*BucketsModel) Load

func (b *BucketsModel) Load() error

func (*BucketsModel) NextPage

func (b *BucketsModel) NextPage()

func (*BucketsModel) PickRow

func (b *BucketsModel) PickRow(bucket s3.Bucket) bool

func (*BucketsModel) PrevPage

func (b *BucketsModel) PrevPage()

func (*BucketsModel) Update

func (b *BucketsModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*BucketsModel) View

func (b *BucketsModel) View() string

type InfoModel

type InfoModel struct {
	Message string
	Parent  tea.Model
}

func NewInfoModel

func NewInfoModel(message string) InfoModel

func (InfoModel) Init

func (m InfoModel) Init() tea.Cmd

func (InfoModel) Update

func (m InfoModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (InfoModel) View

func (m InfoModel) View() string

type Option

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

type ProgressModel

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

func NewProgressModel

func NewProgressModel(message string, parent tea.Model) (ProgressModel, error)

func (ProgressModel) Init

func (m ProgressModel) Init() tea.Cmd

func (ProgressModel) Update

func (m ProgressModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ProgressModel) View

func (m ProgressModel) View() string

type PromptModel

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

func (PromptModel) Init

func (m PromptModel) Init() tea.Cmd

func (PromptModel) Update

func (m PromptModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (PromptModel) View

func (m PromptModel) View() string

type S3File

type S3File struct {
	FileName string
	Modified *time.Time
	Size     int64
}

type Stack

type Stack []*string

func (*Stack) IsEmpty

func (s *Stack) IsEmpty() bool

IsEmpty check if stack is empty

func (*Stack) Peek

func (s *Stack) Peek() *string

func (*Stack) Pop

func (s *Stack) Pop() *string

Pop Remove and return top element of stack. Return nil is stack is empty

func (*Stack) Push

func (s *Stack) Push(str *string)

Push a new value onto the stack

type ViewModel

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

func (ViewModel) Init

func (m ViewModel) Init() tea.Cmd

func (ViewModel) Update

func (m ViewModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ViewModel) View

func (m ViewModel) View() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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