cloudf

package module
v0.0.0-...-4eac87c Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 7 Imported by: 0

README

cf_gcs_csv_to_bq

When GCS csv finalize, trigger to BigQuery in using Golang on Cloud Functions

Editor Config

copy .env.example.yaml to .env.yaml

$ cp .env.example.yaml .env.yaml
$ vim ./.env.yaml

Setup your BQ project_id, dataset and table name

Deploy

$ gcloud functions deploy GCSToBigQuery \
  --runtime go111 \
  --trigger-resource <YOUR_BUCKET_NAME> \
  --trigger-event google.storage.object.finalize \
  --env-vars-file .env.yaml

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GCSToBigQuery

func GCSToBigQuery(ctx context.Context, e GCSEvent) error

GCSToBigQuery is import csv to BQ with GCS event.

Types

type GCSEvent

type GCSEvent struct {
	Bucket         string    `json:"bucket"`
	Name           string    `json:"name"`
	Metageneration string    `json:"metageneration"`
	ResourceState  string    `json:"resourceState"`
	TimeCreated    time.Time `json:"timeCreated"`
	Updated        time.Time `json:"updated"`
}

GCSEvent is the payload of a GCS event.

Jump to

Keyboard shortcuts

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