upload

package module
v0.0.0-...-ed93953 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2019 License: MIT Imports: 11 Imported by: 0

README

Setup -- ingesting data:

  • upload csv team files to gcs bucket
  • trigger a cloud function which read the file and insert the data into firestore database

Blog Posts :

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToFirestore

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

ToFirestore reads GCS file and upload contet to Firestore

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.

type Team

type Team struct {
	Team          string `json:"team" firestore:"team"`
	Player        string `json:"player" firestore:"player"`
	Nationality   string `json:"nationality" firestore:"nationality"`
	Position      string `json:"postion" firestore:"position"`
	Appearences   int    `json:"appearences" firestore:"appearences"`
	Goals         int    `json:"goals" firestore:"goals"`
	Assists       int    `json:"assists" firestore:"assists"`
	Passes        int    `json:"passes" firestore:"passes"`
	Interceptions int    `json:"interceptions" firestores:"interceptions"`
	Tackles       int    `json:"tackles" firestores:"tackles"`
	Fouls         int    `json:"fouls" firestores:"fouls"`
	Price         int    `json:"price" firestores:"price"`
}

Team holds the team member information

Jump to

Keyboard shortcuts

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