utils

package
v0.0.0-...-f9df99f Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCSV

func CreateCSV(data [][]string) (*bytes.Buffer, error)

func CreateS3Client

func CreateS3Client(ctx context.Context, region string, endpoint string) (*s3.Client, error)

func CreateZipArchive

func CreateZipArchive(bufOne, bufTwo *bytes.Buffer, bufOneName, bufTwoName string) (*bytes.Buffer, error)

func FormatDateString

func FormatDateString(inputDate string) (string, error)

func FormatStreamAndRoute

func FormatStreamAndRoute(ds string) (string, string, error)

func GetEnvVar

func GetEnvVar(key string) string

func SaveCsvToFile

func SaveCsvToFile(csvData *bytes.Buffer, outputPath string, filename string) error

func UploadCsvToS3

func UploadCsvToS3(ctx context.Context, client *s3.Client, bucketName string, key string, csvData *bytes.Buffer) error

Types

type AppConfig

type AppConfig struct {
	DataStreams   string
	StartDate     string
	EndDate       string
	TargetEnv     string
	CsvOutputPath string
	PsApiUrl      string
	S3Config      *S3StorageConfig
}

func GetConfig

func GetConfig() AppConfig

type S3StorageConfig

type S3StorageConfig struct {
	BucketName string
	Endpoint   string
}

Jump to

Keyboard shortcuts

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