-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
60 lines (45 loc) · 1.32 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
import (
"context"
"fmt"
"github.com/WiiLink24/MiiContestChannel/common"
"github.com/WiiLink24/MiiContestChannel/contest"
"github.com/WiiLink24/MiiContestChannel/first"
"github.com/WiiLink24/MiiContestChannel/plaza"
"github.com/jackc/pgx/v4/pgxpool"
)
var (
ctx = context.Background()
pool *pgxpool.Pool
)
func main() {
config := common.GetConfig()
// Start SQL
dbString := fmt.Sprintf("postgres://%s:%s@%s/%s", config.Username, config.Password, config.DatabaseAddress, config.DatabaseName)
dbConf, err := pgxpool.ParseConfig(dbString)
common.CheckError(err)
pool, err = pgxpool.ConnectConfig(ctx, dbConf)
common.CheckError(err)
err = first.MakeFirst()
common.CheckError(err)
err = first.MakeAddition()
common.CheckError(err)
err = contest.MakeContestInfos(pool, ctx)
common.CheckError(err)
err = plaza.MakeSpotList(pool, ctx)
common.CheckError(err)
err = plaza.MakeBargainList(pool, ctx)
common.CheckError(err)
err = plaza.MakeNewList(pool, ctx)
common.CheckError(err)
err = plaza.MakeTop50(pool, ctx)
common.CheckError(err)
err = plaza.MakePopCraftsList(pool, ctx)
common.CheckError(err)
err = plaza.MakeNumberInfo(pool, ctx)
common.CheckError(err)
err = plaza.MakeSelectList(pool, ctx)
common.CheckError(err)
err = plaza.WriteWiiSportsResortMiis(pool, ctx)
common.CheckError(err)
}