Documentation
¶
Index ¶
- func CreateR2Client(accessKeyID string, accessKeySecret string, accountID string) *r2.Client
- func ErrorHandler(err error)
- func GenerateUUID() string
- func GetLocationNameFromURL(url string, scrapOption string) string
- func ParseTime(timeToParse string) string
- func R2UploadObject(fileName string, uploadIdentifier string, fileData io.Reader)
- func ReadFromFile(fileName string) *os.File
- func ValidateEmailAddress(email string) bool
- func ValidateTripAdvisorURL(url string, scrapOption string) bool
- func WriteToFileFromTarStream(fileName string, fileSuffix string, tarF io.ReadCloser) string
- type Creds
- type R2Obj
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateR2Client ¶
CreateR2Client creates a new R2 client
func GetLocationNameFromURL ¶
GetLocationNameFromURL get the scrape target name from the given URL
func R2UploadObject ¶
R2UploadObject upload an object to R2
func ValidateEmailAddress ¶
ValidateEmailAddress validates the EHL email address
func ValidateTripAdvisorURL ¶
ValidateTripAdvisorURL validates the TripAdvisor URLs
func WriteToFileFromTarStream ¶
func WriteToFileFromTarStream(fileName string, fileSuffix string, tarF io.ReadCloser) string
WriteToFileFromTarStream writes a file to disk
Types ¶
type Creds ¶
type Creds struct { AccessKeyID string `json:"accessKeyId"` AccessKeySecret string `json:"accessKeySecret"` AccountID string `json:"accountId"` BucketName string `json:"bucketName"` }
Creds is the Credentials of the R2 bucket
func ParseCredsFromJSON ¶
ParseCredsFromJSON parses the credentials from a JSON file
type R2Obj ¶
type R2Obj struct { ChecksumAlgorithm string `json:"checksumAlgorithm"` Etag string `json:"Etag"` Key string `json:"Key"` LastModified string `json:"LastModified"` Size int64 `json:"Size"` StorageClass string `json:"StorageClass"` Metadata string }
R2Obj is an object struct for R2 bucket objects
func R2EnrichMetaData ¶
R2EnrichMetaData enriches the R2 object in the list with the metadata
func R2ListObjects ¶
func R2ListObjects() []R2Obj
R2ListObjects List objects in R2 and return a string slice of the file names
Click to show internal directories.
Click to hide internal directories.