bcat

package module
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: MIT Imports: 13 Imported by: 0

README

Black Cat

This tool is a Golang tool that uploads compressed data to s3.

Help

$ bcat --help
Usage:
  bcat [OPTIONS] <command>

Application Options:
  -l, --localstack  Use LocalStack
  -e, --endpoint=   Localstack endpoint (default: http://localhost:4572)

Help Options:
  -h, --help        Show this help message

Available commands:
  deploy    Deploy Command
  download  Download Command
  upload    Upload Command
  version   Version Command

Documentation

Index

Constants

View Source
const (
	BCATFILE = "bcat.tar.zst"
)

Variables

This section is empty.

Functions

func Compress

func Compress(writer *io.PipeWriter, targetPath string, errChan chan error)

Compress compress the file with the specified path.

func CreateSession

func CreateSession(rolearn string, region string) *session.Session

CreateSession Create a session for aws s3.

func CreateSessionForLocalstack

func CreateSessionForLocalstack(region string, endpoint string) *session.Session

CreateSessionForLocalstack Create a session for localstack

func Decompress

func Decompress(dest string, reader *io.PipeReader, errChan chan error)

Decompress method

Types

type Artifact

type Artifact struct {
	Name string `yaml:"name"`
	Path string `yaml:"path"`
	Dest string `yaml:"dest"`
}

Artifact used in Deploy-Cmd

type DeployConfig

type DeployConfig struct {
	Artifacts []Artifact `yaml:"artifacts"`
}

DeployConfig Deploy-Cmd configuration struct

func Parse

func Parse(configFilePath string) (DeployConfig, error)

Parse bcat-deploy parse

type DeployManager

type DeployManager struct {
	Downloader Downloader
	Config     DeployConfig
}

DeployManager manage deploy struct

func (*DeployManager) Deploy

func (dm *DeployManager) Deploy() error

Deploy deploy

type Downloader

type Downloader struct {
	S3Manager S3Manager
}

Downloader download struct

func (*Downloader) Download

func (downloader *Downloader) Download(destPath string, downloadPath string) error

Download download

type S3Manager

type S3Manager struct {
	Session *session.Session
	Bucket  string
}

S3Manager A struct with the session and target bucket name. Data is transferred to s3 via this.

func (*S3Manager) DownloadS3

func (manager *S3Manager) DownloadS3(writer *io.PipeWriter, downloadPath string, errChan chan error)

DownloadS3 method

func (*S3Manager) UploadS3

func (manager *S3Manager) UploadS3(reader *io.PipeReader, uploadPath string, outputChan chan *s3manager.UploadOutput, errChan chan error)

UploadS3 Upload the file to s3 based on the [] byte passed as an argument.

type Uploader

type Uploader struct {
	S3Manager S3Manager
}

Uploader upload struct

func (*Uploader) Upload

func (uploader *Uploader) Upload(targetPath string, uploadPath string) error

Upload upload

type Walker

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

Walker hold tar writer

func (*Walker) WriteWithWalk

func (w *Walker) WriteWithWalk(file string, fi os.FileInfo, err error) error

WriteWithWalk write the contents of the specified file

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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