infrastructure

package
v0.0.0-...-8b849f6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GcpInteractor *usecases.GcpInteractor
View Source
var LocalInteractor *usecases.LocalInteractor

Functions

func GetGcpInteractor

func GetGcpInteractor() (gcpInteractor *usecases.GcpInteractor, err error)

func GetLocalInteractor

func GetLocalInteractor() (localInteractor *usecases.LocalInteractor, err error)

Types

type GcpHandler

type GcpHandler struct {
	Client *storage.Client
}

func NewGcpHandler

func NewGcpHandler(keyFile string) (gcpHandler *GcpHandler, err error)

A keyFile for source and another keyFile for sink

func (*GcpHandler) DownloadFile

func (handler *GcpHandler) DownloadFile(fileName string) (success bool, err error)

Download will download file, save file and parse file

func (*GcpHandler) FileExists

func (handler *GcpHandler) FileExists(fileName string) (fileExists bool, err error)

FileExists returns true if it exists in the specified google cloud provider bucket

func (*GcpHandler) GetBucketObject

func (handler *GcpHandler) GetBucketObject(flowType domain.FlowType, projectId string, bucketName string, fileName string) storage.ObjectHandle

GetBucketObject is a helper method that returns the file Object that GCP requires

func (*GcpHandler) ListBuckets

func (handler *GcpHandler) ListBuckets(flowType domain.FlowType, projectId string) (buckets []domain.Bucket, err error)

func (*GcpHandler) UploadFile

func (handler *GcpHandler) UploadFile(fileName string) (success bool, err error)

UploadFile will upload a file from the file system to the target/sink bucket

type LocalHandler

type LocalHandler struct{}

func NewLocalHandler

func NewLocalHandler() *LocalHandler

func (*LocalHandler) FileExists

func (handler *LocalHandler) FileExists(fileName string) (fileExists bool, err error)

Jump to

Keyboard shortcuts

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