This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tconst | titleType | primaryTitle | originalTitle | isAdult | startYear | endYear | runtimeMinutes | genres | |
---|---|---|---|---|---|---|---|---|---|
tt0000001 | short | Carmencita | Carmencita | 0 | 1894 | \N | 1 | Documentary,Short | |
tt0000002 | short | Le clown et ses chiens | Le clown et ses chiens | 0 | 1892 | \N | 5 | Animation,Short | |
tt0000003 | short | Pauvre Pierrot | Pauvre Pierrot | 0 | 1892 | \N | 4 | Animation,Comedy,Romance | |
tt0000004 | short | Un bon bock | Un bon bock | 0 | 1892 | \N | 12 | Animation,Short | |
tt0000005 | short | Blacksmith Scene | Blacksmith Scene | 0 | 1893 | \N | 1 | Comedy,Short | |
tt0000006 | short | Chinese Opium Den | Chinese Opium Den | 0 | 1894 | \N | 1 | Short | |
tt0000007 | short | Corbett and Courtney Before the Kinetograph | Corbett and Courtney Before the Kinetograph | 0 | 1894 | \N | 1 | Short,Sport | |
tt0000008 | short | Edison Kinetoscopic Record of a Sneeze | Edison Kinetoscopic Record of a Sneeze | 0 | 1894 | \N | 1 | Documentary,Short | |
tt0000009 | movie | Miss Jerry | Miss Jerry | 0 | 1894 | \N | 45 | Romance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cmd | |
import ( | |
"context" | |
"fmt" | |
"reflect" | |
"sync" | |
) | |
// using sync.Pool to manage Movie structs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cmd | |
import ( | |
"context" | |
"encoding/csv" | |
"io" | |
"os" | |
"sync" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>{{.FileName}}</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"> | |
</head> | |
<body class=""> | |
<div class="container-fluid"> | |
<h1>{{.FileName}}</h1> | |
<table class="table table-striped"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ProcessRecord process records received via the chan | |
func (tr *HTMLTransformer) ProcessRecord(wg *sync.WaitGroup, record <-chan []string, done <-chan bool) { | |
var ( | |
now = time.Now() | |
data []utils.SalesRecord | |
end bool | |
ctx = context.Background() | |
) | |
defer func() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read reads from the csv file | |
func (c *CSVParser) Read(wg *sync.WaitGroup, record chan<- []string, done chan<- bool) { | |
start := time.Now() | |
defer func() { | |
close(done) | |
close(record) | |
c.reporter.AddDuration(time.Since(start).Seconds()) | |
wg.Done() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WriteReportToStdOut writes report to stdout | |
func (t *TransformationReporter) WriteReportToStdOut(ctx context.Context) error { | |
var err error | |
path := utils.RootDir() | |
// create template | |
tmpl, err := template.Must(template.New("STDOUT"), err). | |
ParseFiles(path + "/internal/transform/template/report.tmpl") | |
if err != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cmd | |
import ( | |
"sync" | |
"github.com/dele454/medium/csv-transform-to-html/internal/parser" | |
"github.com/dele454/medium/csv-transform-to-html/internal/report" | |
"github.com/dele454/medium/csv-transform-to-html/internal/transform" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"os" | |
"github.com/dele454/medium/csv-transform-to-html/cmd" | |
"github.com/dele454/medium/csv-transform-to-html/internal/errs" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Coding Standards | |
++++++++++++++++ | |
https://golang.org/doc/effective_go.html | |
Go In General | |
+++++++++++++ | |
https://gobyexample.com/ | |
https://golang.org/doc/code.html | |
http://www.go-gazelle.com |
NewerOlder