helpers

package
v0.0.0-...-7c47925 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Object_store_type_local = "local"
	Object_store_type_s3    = "s3"
	Object_store_type_gcs   = "gcs"
	Object_store_type_azure = "azure"
)

Variables

This section is empty.

Functions

func CleanDatabase

func CleanDatabase(dbDialect *string)

func DecodeAvroFromBytes

func DecodeAvroFromBytes(schema string, payload []byte) (interface{}, error)

DecodeAvroFromBytes convert bytes to interface{} datum

func DeleteAllExistingObjects

func DeleteAllExistingObjects(objectStoreType string, objectStoreBucket string, objectStorePath string)

func DeleteTestFile

func DeleteTestFile(fileName string)

Deletes a file from the testdata path

func DownloadCSV

func DownloadCSV(url string) [][]string

func DownloadParquet

func DownloadParquet(url string) []interface{}

func EmptyOutputPath

func EmptyOutputPath(subPath string)

Deletes all files at the output path

func EncodeAvroToBytes

func EncodeAvroToBytes(schema string, datum interface{}) ([]byte, error)

EncodeAvroToBytes convert interface{} datum to bytes

func EventuallyListOutputFiles

func EventuallyListOutputFiles(subPath string, g types.Gomega) []string

Lists all files at the output path

func GetCSV

func GetCSV(filePath string) [][]string

func GetOutputPathURI

func GetOutputPathURI(subPath string) string

Gets an output path URI

func GetTestFileURI

func GetTestFileURI(fileName string) string

Gets a file URI for file in the testdata path

func ListOutputFiles

func ListOutputFiles(subPath string) []string

Lists all files at the output path

func LoadTestFileIntoTable

func LoadTestFileIntoTable(ctx context.Context, conn *grpc.ClientConn, table *v1alpha.Table, fileURI string) *v1alpha.LoadDataResponse

loads a file from testdata/ into a table.

func LoadTestFilesIntoTable

func LoadTestFilesIntoTable(ctx context.Context, conn *grpc.ClientConn, table *v1alpha.Table, fileNames ...string) []*v1alpha.LoadDataResponse

loads files from testdata/ into a table.

func LogLn

func LogLn(format string, args ...any)

helper to log to test output

func ReadTestFile

func ReadTestFile(fileName string) []byte

Reads a file from the testdata path

func TestsAreRunningLocally

func TestsAreRunningLocally() bool

func TestsAreRunningLocallyInDocker

func TestsAreRunningLocallyInDocker() bool

func WriteTestFile

func WriteTestFile(fileName string, data []byte)

Writes a file to the testdata path

Types

type HostConfig

type HostConfig struct {
	Hostname string
	Port     int
	UseTLS   bool
}

HostConfig holds the data needed to connect to a particular grpc server

func (HostConfig) GetContextCancelConnection

func (c HostConfig) GetContextCancelConnection(seconds int) (context.Context, context.CancelFunc, *grpc.ClientConn)

func (HostConfig) GetGrpcConnection

func (c HostConfig) GetGrpcConnection(ctx context.Context) *grpc.ClientConn

type MinioHelper

type MinioHelper struct {
	Endpoint     string
	RootUser     string
	RootPassword string
}

func (*MinioHelper) AddFileToBucket

func (m *MinioHelper) AddFileToBucket(filePath string, bucket string, region string, key string) error

func (*MinioHelper) InitBucketAndUser

func (m *MinioHelper) InitBucketAndUser(bucket string, region string, userName string, userPassword string, isGetOnly bool, replaceBucketIfExisting bool) error

Jump to

Keyboard shortcuts

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