diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..648f09d0 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +empty: + echo "empty" + +# supabase +supabase-start: + supabase start +supabase-stop: + supabase stop + +# migration +## make create-migrate-file name="" +create-migrate-file: + supabase migration new ${name} +migrate: + supabase migration up +reset-migrate: + supabase db reset + + +# create entity +create-entity: + $(shell ./scripts/create-entity.sh) \ No newline at end of file diff --git a/batch-service/Dockerfile b/batch-service/Dockerfile new file mode 100644 index 00000000..c820b9b0 --- /dev/null +++ b/batch-service/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.22.0-alpine3.18 + +WORKDIR /app + +COPY /batch-service /app + +RUN go mod tidy && \ + go install github.com/cosmtrek/air@v1.46.0 && \ + go install github.com/volatiletech/sqlboiler/v4@latest && \ + go install github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-psql@latest + +EXPOSE 5555 + +CMD ["air", "-c", ".air.toml"] \ No newline at end of file diff --git a/batch-service/cmd/main.go b/batch-service/cmd/main.go index ebfc386d..8ec6ac32 100644 --- a/batch-service/cmd/main.go +++ b/batch-service/cmd/main.go @@ -1,13 +1,13 @@ package main import ( - "cloud.google.com/go/firestore" "context" + "database/sql" + "log" + "github.com/YukiOnishi1129/techpicks/batch-service/cmd/usecase" "github.com/YukiOnishi1129/techpicks/batch-service/database" - "github.com/YukiOnishi1129/techpicks/batch-service/infrastructure/firestore/repository" "github.com/joho/godotenv" - "log" ) func main() { @@ -18,24 +18,22 @@ func main() { log.Fatalf("Error loading .env file") return } - client, err := database.CreateFirestoreClient(ctx) + + db, err := database.Init() if err != nil { - log.Fatalf("Failed to create client: %v", err) + log.Fatalf("Failed to init db: %v", err) return } - defer func(client *firestore.Client) { - err = client.Close() + defer func(db *sql.DB) { + err = db.Close() if err != nil { - log.Fatalf("Failed to close client: %v", err) - return + log.Fatalf("Failed to close db connection: %v", err) } - }(client) + }(db) - pr := repository.NewPlatformRepository(client) - ar := repository.NewArticleRepository(client) - au := usecase.NewArticleUsecase(client, pr, ar) + au := usecase.NewArticleUsecase(db) - err = au.CreateArticles(ctx, client) + err = au.BatchCreateArticles(ctx) if err != nil { log.Fatalf("Failed to create articles: %v", err) return diff --git a/batch-service/cmd/usecase/article.go b/batch-service/cmd/usecase/article.go index 9c267302..74251421 100644 --- a/batch-service/cmd/usecase/article.go +++ b/batch-service/cmd/usecase/article.go @@ -1,116 +1,251 @@ package usecase import ( - "cloud.google.com/go/firestore" "context" - "github.com/YukiOnishi1129/techpicks/batch-service/domain" - "github.com/YukiOnishi1129/techpicks/batch-service/infrastructure/firestore/repository" - "github.com/google/uuid" + "database/sql" "log" - "sync" "time" + + "github.com/YukiOnishi1129/techpicks/batch-service/entity" + "github.com/google/uuid" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries/qm" ) type ArticleUsecaseInterface interface { - CreateArticles(ctx context.Context, client *firestore.Client) error + CreateArticles(ctx context.Context, db *sql.DB) error } type ArticleUsecase struct { - client *firestore.Client - pr *repository.PlatformRepository - ar *repository.ArticleRepository + db *sql.DB } -func NewArticleUsecase(client *firestore.Client, pr *repository.PlatformRepository, ar *repository.ArticleRepository) *ArticleUsecase { +func NewArticleUsecase(db *sql.DB) *ArticleUsecase { return &ArticleUsecase{ - client: client, - pr: pr, - ar: ar, + db: db, } } -func (au *ArticleUsecase) CreateArticles(ctx context.Context, client *firestore.Client) error { +func (au *ArticleUsecase) BatchCreateArticles(ctx context.Context) error { now := time.Now() - // get platforms - platforms, err := au.pr.GetPlatforms(ctx) + log.Printf("【start BatchCreateArticles】") + feeds, err := entity.Feeds(qm.Where("deleted_at IS NULL"), qm.OrderBy("created_at")).All(ctx, au.db) if err != nil { + log.Printf("【error get feeds】: %s", err) return err } - for _, p := range platforms { - var wg sync.WaitGroup - rss, err := GetRSS(p.RssURL) + // for feeds + for _, f := range feeds { + // transaction + tx, err := au.db.BeginTx(ctx, nil) if err != nil { - log.Printf("【error get rss】: %s", p.Name) - continue + log.Printf("【error begin transaction】: %s", err) + err = tx.Rollback() + if err != nil { + return err + } + return err } - articles, err := au.ar.GetArticlesByPlatform(ctx, p.ID) + log.Printf("【begin transaction】") + + log.Printf("【start create article】: %s", f.Name) + aCount := 0 + farCount := 0 + // get rss + rss, err := GetRSS(f.RSSURL) if err != nil { - log.Printf("【error get articles by platform】: %s", p.Name) + log.Printf("【error get rss】: %s", f.Name) + err = tx.Rollback() + if err != nil { + continue + } continue } + + for _, r := range rss { + isSkip := false + // 1. check article table at article_url + articles, _ := entity.Articles(qm.Where("article_url = ?", r.Link)).All(ctx, tx) + if articles != nil { + for _, a := range articles { + feedArticleRelation, _ := entity.FeedArticleRelations(qm.Where("feed_id = ?", f.ID), qm.Where("article_id = ?", a.ID)).One(ctx, tx) + if feedArticleRelation == nil { + err = createFeedArticleRelation(ctx, tx, f.ID, a.ID) + if err != nil { + log.Printf("【error insert feed article relation】: %s", r.Title) + err = tx.Rollback() + if err != nil { + continue + } + continue + } + farCount++ + break + } + } + isSkip = true + } + + if isSkip { + continue + } + + // create article and feed_article_relation data + // insert article + articleID, _ := uuid.NewUUID() + publishedAt := time.Unix(int64(r.PublishedAt), 0) + articleTitle := "" + if len(r.Title) > 255 { + articleTitle = r.Title[:255] + } + article := entity.Article{ + ID: articleID.String(), + Title: articleTitle, + Description: r.Description, + ThumbnailURL: r.ImageURL, + ArticleURL: r.Link, + PublishedAt: publishedAt, + IsPrivate: false, + } + err = article.Insert(ctx, tx, boil.Infer()) + if err != nil { + log.Printf("【error insert article】: %s, err: %v", r.Title, err) + err = tx.Rollback() + if err != nil { + continue + } + continue + } + + // insert feed article relation + err = createFeedArticleRelation(ctx, tx, f.ID, articleID.String()) + if err != nil { + log.Printf("【error insert feed article relation】: %s", r.Title) + err = tx.Rollback() + if err != nil { + continue + } + continue + } + log.Printf("【create article】: %s", r.Title) + aCount++ + farCount++ + } + + err = tx.Commit() if err != nil { + log.Printf("【error commit transaction】: %s", err) return err } - wg.Add(1) - go createArticles(ctx, client, &wg, articles, rss, p) - wg.Wait() + log.Printf("【commit transaction】") + log.Printf("【end create article】: %s", f.Name) + log.Printf("【add article count】: %d", aCount) + log.Printf("【add feed_article_relationcount】: %d", farCount) } - + log.Printf("【end BatchCreateArticles】") end := time.Now() diff := end.Sub(now) log.Printf("【end create article all】: %s", diff) + return nil } -func createArticles(ctx context.Context, client *firestore.Client, wg *sync.WaitGroup, articles []domain.Article, rss []RSS, p domain.Platform) { - log.Printf("【start create article】: %s %s", p.Name, p.CategoryName) - defer wg.Done() - batch := client.BulkWriter(ctx) - aCount := 0 - - for _, r := range rss { - isSkip := false - for _, article := range articles { - if article.ArticleURL == r.Link { - isSkip = true - break - } - } - if isSkip { - log.Printf("【skip create article】: %s", r.Title) - continue - } - - articleID, err := uuid.NewUUID() - if err != nil { - continue - } - now := time.Now().Unix() - ref := client.Collection("articles").Doc(articleID.String()) - _, err = batch.Set(ref, domain.ArticleFirestore{ - Title: r.Title, - Description: r.Description, - ThumbnailURL: r.ImageURL, - ArticleURL: r.Link, - PublishedAt: r.PublishedAt, - PlatformID: p.ID, - PlatformName: p.Name, - PlatformCategoryName: p.CategoryName, - PlatformSiteURL: p.SiteURL, - PlatformType: p.PlatformType, - PlatformFaviconURL: p.FaviconURL, - IsEng: p.IsEng, - IsPrivate: false, - CreatedAt: int(now), - UpdatedAt: int(now), - DeletedAt: nil, - }) - if err != nil { - continue - } - aCount++ +func createFeedArticleRelation(ctx context.Context, tx *sql.Tx, feedID, articleID string) error { + feedArticleRelationID, _ := uuid.NewUUID() + feedArticleRelation := entity.FeedArticleRelation{ + ID: feedArticleRelationID.String(), + FeedID: feedID, + ArticleID: articleID, } - batch.Flush() - log.Printf("【end create article】: %s %s", p.Name, p.CategoryName) - log.Printf("【article count】: %d", aCount) + err := feedArticleRelation.Insert(ctx, tx, boil.Infer()) + if err != nil { + return err + } + return nil } + +//func (au *ArticleUsecase) CreateArticles(ctx context.Context) error { +// now := time.Now() +// // get platforms +// platforms, err := au.pr.GetPlatforms(ctx) +// if err != nil { +// return err +// } +// for _, p := range platforms { +// var wg sync.WaitGroup +// rss, err := GetRSS(p.RssURL) +// if err != nil { +// log.Printf("【error get rss】: %s", p.Name) +// continue +// } +// articles, err := au.ar.GetArticlesByPlatform(ctx, p.ID) +// if err != nil { +// log.Printf("【error get articles by platform】: %s", p.Name) +// continue +// } +// if err != nil { +// return err +// } +// wg.Add(1) +// go createArticles(ctx, client, &wg, articles, rss, p) +// wg.Wait() +// } +// +// end := time.Now() +// diff := end.Sub(now) +// log.Printf("【end create article all】: %s", diff) +// return nil +//} +// +//func createArticles(ctx context.Context, client *firestore.Client, wg *sync.WaitGroup, articles []domain.Article, rss []RSS, p domain.Platform) { +// log.Printf("【start create article】: %s %s", p.Name, p.CategoryName) +// defer wg.Done() +// batch := client.BulkWriter(ctx) +// aCount := 0 +// +// for _, r := range rss { +// isSkip := false +// for _, article := range articles { +// if article.ArticleURL == r.Link { +// isSkip = true +// break +// } +// } +// if isSkip { +// log.Printf("【skip create article】: %s", r.Title) +// continue +// } +// +// articleID, err := uuid.NewUUID() +// if err != nil { +// continue +// } +// now := time.Now().Unix() +// ref := client.Collection("articles").Doc(articleID.String()) +// _, err = batch.Set(ref, domain.ArticleFirestore{ +// Title: r.Title, +// Description: r.Description, +// ThumbnailURL: r.ImageURL, +// ArticleURL: r.Link, +// PublishedAt: r.PublishedAt, +// PlatformID: p.ID, +// PlatformName: p.Name, +// PlatformCategoryName: p.CategoryName, +// PlatformSiteURL: p.SiteURL, +// PlatformType: p.PlatformType, +// PlatformFaviconURL: p.FaviconURL, +// IsEng: p.IsEng, +// IsPrivate: false, +// CreatedAt: int(now), +// UpdatedAt: int(now), +// DeletedAt: nil, +// }) +// if err != nil { +// continue +// } +// aCount++ +// } +// batch.Flush() +// log.Printf("【end create article】: %s %s", p.Name, p.CategoryName) +// log.Printf("【article count】: %d", aCount) +//} diff --git a/batch-service/cmd/usecase/rss.go b/batch-service/cmd/usecase/rss.go index 80bee6d5..a4ad0f43 100644 --- a/batch-service/cmd/usecase/rss.go +++ b/batch-service/cmd/usecase/rss.go @@ -1,10 +1,12 @@ package usecase import ( + "context" "fmt" "github.com/Songmu/go-httpdate" "github.com/mmcdole/gofeed" "github.com/otiai10/opengraph" + "time" ) type RSS struct { @@ -16,8 +18,11 @@ type RSS struct { } func GetRSS(rssURL string) ([]RSS, error) { + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() fp := gofeed.NewParser() - feed, err := fp.ParseURL(rssURL) + + feed, err := fp.ParseURLWithContext(rssURL, ctx) if err != nil { return nil, err } @@ -39,7 +44,6 @@ func GetRSS(rssURL string) ([]RSS, error) { println(fmt.Sprintf("skiped time: %s\n", t)) continue } - rss[i] = RSS{ Title: item.Title, Link: item.Link, @@ -52,7 +56,9 @@ func GetRSS(rssURL string) ([]RSS, error) { } func getOGPImage(url string) (string, error) { - ogp, err := opengraph.Fetch(url) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + ogp, err := opengraph.FetchWithContext(ctx, url) if err != nil { return "", err } diff --git a/batch-service/cmd/usecase/rss_test.go b/batch-service/cmd/usecase/rss_test.go index f5c2dd89..b0f73c2c 100644 --- a/batch-service/cmd/usecase/rss_test.go +++ b/batch-service/cmd/usecase/rss_test.go @@ -10,14 +10,14 @@ func TestGetRss(t *testing.T) { }{ { name: "Success: GetRss", - rssURL: "https://medium.com/feed/tag/nextjs", - siteURL: "https://zenn.dev/itta/articles/a1cc436afbc901", + rssURL: "https://menthas.com/javascript/rss", + siteURL: "https://menthas.com/javascript/rss", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - //GetRSS(tt.rssURL) + // GetRSS(tt.rssURL) //getFavicon(tt.siteURL) }) } diff --git a/batch-service/database/init_db.go b/batch-service/database/init_db.go new file mode 100644 index 00000000..8c846ae2 --- /dev/null +++ b/batch-service/database/init_db.go @@ -0,0 +1,34 @@ +package database + +import ( + "database/sql" + "fmt" + _ "github.com/lib/pq" + "os" +) + +func Init() (db *sql.DB, err error) { + db, err = connectDB() + if err != nil { + println("Failed to connect to db init") + return nil, err + } + return db, nil +} + +func connectDB() (*sql.DB, error) { + dsn := fmt.Sprintf("port=%s host=%s user=%s password=%s dbname=%s sslmode=disable", os.Getenv("POSTGRES_PORT"), os.Getenv("POSTGRES_HOST"), os.Getenv("POSTGRES_USER"), os.Getenv("POSTGRES_PASSWORD"), os.Getenv("POSTGRES_DATABASE")) + db, err := sql.Open("postgres", dsn) + if err != nil { + println("Failed to connect to db") + return nil, fmt.Errorf("failed to connect to db: %v", err) + } + + //defer func(db *sql.DB) { + // err := db.Close() + // if err != nil { + // println("Failed to close db connection") + // } + //}(db) + return db, nil +} diff --git a/batch-service/database/seed/main.go b/batch-service/database/seed/main.go index 0779a5bc..2314f5a8 100644 --- a/batch-service/database/seed/main.go +++ b/batch-service/database/seed/main.go @@ -1,7 +1,6 @@ package main import ( - "cloud.google.com/go/firestore" "context" "github.com/YukiOnishi1129/techpicks/batch-service/database" "github.com/YukiOnishi1129/techpicks/batch-service/database/seed/seeders" @@ -16,7 +15,11 @@ func main() { log.Fatalf("Error loading .env file") return } - client, err := database.CreateFirestoreClient(ctx) + db, err := database.Init() + if err != nil { + log.Fatalf("Failed to init db: %v", err) + return + } if err != nil { log.Fatalf("Failed to create client: %v", err) @@ -24,18 +27,11 @@ func main() { } // do seeder - ps := seeders.NewPlatformSeed(client) + is := seeders.NewInitSeed(db) - err = ps.SeedPlatform(ctx) + err = is.SeedInitData(ctx) if err != nil { log.Fatalf("Failed to insert: %v", err) return } - - defer func(client *firestore.Client) { - err := client.Close() - if err != nil { - return - } - }(client) } diff --git a/batch-service/database/seed/seeders/init_seed.go b/batch-service/database/seed/seeders/init_seed.go new file mode 100644 index 00000000..6a01f383 --- /dev/null +++ b/batch-service/database/seed/seeders/init_seed.go @@ -0,0 +1,2042 @@ +package seeders + +import ( + "context" + "database/sql" + "github.com/YukiOnishi1129/techpicks/batch-service/entity" + "github.com/google/uuid" + "github.com/volatiletech/null/v8" + "github.com/volatiletech/sqlboiler/v4/queries/qm" + "time" + + "github.com/volatiletech/sqlboiler/v4/boil" + + "github.com/YukiOnishi1129/techpicks/batch-service/domain" +) + +type InitSeedInterface interface { + InitSeed(ctx context.Context) error +} + +type InitSeed struct { + db *sql.DB +} + +func NewInitSeed(db *sql.DB) *InitSeed { + return &InitSeed{db: db} +} + +func (is *InitSeed) SeedInitData(ctx context.Context) error { + tx, err := is.db.BeginTx(ctx, nil) + if err != nil { + return err + } + seedCategories := getCategoryDatas() + seedPlatformFeeds := getSeedPlatformAndFeeds() + for _, s := range seedCategories { + categoryID, _ := uuid.NewUUID() + categoryIDStr := categoryID.String() + c, _ := entity.Categories(qm.Where("name = ?", s.Name)).One(ctx, tx) + if c != nil { + categoryIDStr = c.ID + } + // create new category if it does not exist + if c == nil { + category := entity.Category{ + ID: categoryID.String(), + Name: s.Name, + Type: int(s.Type), + } + err = category.Insert(ctx, tx, boil.Infer()) + if err != nil { + return err + } + } + + for _, sp := range seedPlatformFeeds { + if sp.seedCategoryID == s.seedCategoryID { + p, _ := entity.Platforms(qm.Where("site_url = ?", sp.PlatformSiteURL)).One(ctx, tx) + if p != nil { + f, _ := entity.Feeds(qm.Where("rss_url = ?", sp.RssURL)).One(ctx, tx) + if f == nil { + err = createFeed(ctx, tx, createFeedArg{ + PlatformID: p.ID, + CategoryID: categoryIDStr, + FeedName: sp.FeedName, + RssURL: sp.RssURL, + FeedSiteURL: sp.FeedSiteURL, + DeletedAt: sp.DeletedAt, + }) + if err != nil { + return err + } + } + continue + } + + platformID, _ := uuid.NewUUID() + err = createPlatform(ctx, tx, createPlatformArg{ + ID: platformID.String(), + Name: sp.PlatformName, + SiteURL: sp.PlatformSiteURL, + PlatformType: sp.PlatformType, + FaviconURL: sp.FaviconURL, + IsEng: sp.IsEng, + DeletedAt: sp.DeletedAt, + }) + if err != nil { + return err + } + + err = createFeed(ctx, tx, createFeedArg{ + PlatformID: platformID.String(), + CategoryID: categoryIDStr, + FeedName: sp.FeedName, + RssURL: sp.RssURL, + FeedSiteURL: sp.FeedSiteURL, + DeletedAt: sp.DeletedAt, + }) + if err != nil { + return err + } + } + } + } + err = tx.Commit() + if err != nil { + return err + } + return nil +} + +type createPlatformArg struct { + ID string + Name string + SiteURL string + PlatformType domain.PlatformType + FaviconURL string + IsEng bool + DeletedAt *time.Time +} + +func createPlatform(ctx context.Context, tx *sql.Tx, arg createPlatformArg) error { + platform := entity.Platform{ + ID: arg.ID, + Name: arg.Name, + SiteURL: arg.SiteURL, + PlatformType: int(arg.PlatformType), + FaviconURL: arg.FaviconURL, + IsEng: arg.IsEng, + } + if arg.DeletedAt != nil { + platform.DeletedAt = null.TimeFromPtr(arg.DeletedAt) + } + err := platform.Insert(ctx, tx, boil.Infer()) + if err != nil { + return err + } + return nil +} + +type createFeedArg struct { + PlatformID string + CategoryID string + FeedName string + RssURL string + FeedSiteURL string + DeletedAt *time.Time +} + +func createFeed(ctx context.Context, tx *sql.Tx, arg createFeedArg) error { + feedID, _ := uuid.NewUUID() + feed := entity.Feed{ + ID: feedID.String(), + Name: arg.FeedName, + RSSURL: arg.RssURL, + SiteURL: arg.FeedSiteURL, + PlatformID: arg.PlatformID, + CategoryID: arg.CategoryID, + } + if arg.DeletedAt != nil { + feed.DeletedAt = null.TimeFromPtr(arg.DeletedAt) + } + err := feed.Insert(ctx, tx, boil.Infer()) + if err != nil { + return err + } + return nil +} + +//func getMetaData(url string) (faviconURL, ogpImageURL string, err error) { +// g := goose.New() +// article, err := g.ExtractFromURL(url) +// if err != nil { +// return "", "", err +// } +// faviconURL = article.MetaFavicon +// ogpImageURL = article.TopImage +// return faviconURL, ogpImageURL, nil +//} + +type seedCategory struct { + Name string + Type domain.CategoryType + seedCategoryID int +} + +func getCategoryDatas() []seedCategory { + return []seedCategory{ + { + Name: "All", + Type: domain.CategoryTypeAll, + seedCategoryID: 1, + }, + { + Name: "Trend", + Type: domain.CategoryTypeTrend, + seedCategoryID: 2, + }, + { + Name: "Technology", + Type: domain.CategoryTypeAll, + seedCategoryID: 3, + }, + { + Name: "Programming", + Type: domain.CategoryTypeAll, + seedCategoryID: 4, + }, + { + Name: "JavaScript", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 5, + }, + { + Name: "TypeScript", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 6, + }, + { + Name: "Python", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 7, + }, + { + Name: "Ruby", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 8, + }, + { + Name: "Golang", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 9, + }, + { + Name: "Java", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 10, + }, + { + Name: "Kotlin", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 11, + }, + { + Name: "Swift", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 12, + }, + { + Name: "PHP", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 13, + }, + { + Name: "C", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 14, + }, + { + Name: "C++", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 15, + }, + { + Name: "Rust", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 16, + }, + { + Name: "Scala", + Type: domain.CategoryTypeLanguage, + seedCategoryID: 17, + }, + { + Name: "React", + Type: domain.CategoryTypeFrontend, + seedCategoryID: 18, + }, + { + Name: "Vue", + Type: domain.CategoryTypeFrontend, + seedCategoryID: 19, + }, + { + Name: "Next.js", + Type: domain.CategoryTypeFrontend, + seedCategoryID: 20, + }, + { + Name: "Nuxt.js", + Type: domain.CategoryTypeFrontend, + seedCategoryID: 21, + }, + { + Name: "Node.js", + Type: domain.CategoryTypeBackend, + seedCategoryID: 22, + }, + { + Name: "express", + Type: domain.CategoryTypeBackend, + seedCategoryID: 23, + }, + { + Name: "Nestjs", + Type: domain.CategoryTypeBackend, + seedCategoryID: 24, + }, + { + Name: "Infrastructure", + Type: domain.CategoryTypeInfrastructure, + seedCategoryID: 25, + }, + { + Name: "React Native", + Type: domain.CategoryTypeMobile, + seedCategoryID: 26, + }, + { + Name: "Flutter", + Type: domain.CategoryTypeMobile, + seedCategoryID: 27, + }, + { + Name: "AWS", + Type: domain.CategoryTypeCloud, + seedCategoryID: 28, + }, + { + Name: "GCP", + Type: domain.CategoryTypeCloud, + seedCategoryID: 29, + }, + { + Name: "Azure", + Type: domain.CategoryTypeCloud, + seedCategoryID: 30, + }, + { + Name: "Docker", + Type: domain.CategoryTypeInfrastructure, + seedCategoryID: 31, + }, + { + Name: "Kubernetes", + Type: domain.CategoryTypeInfrastructure, + seedCategoryID: 32, + }, + { + Name: "Machine Learning", + Type: domain.CategoryTypeMachineLearning, + seedCategoryID: 33, + }, + { + Name: "Deep Learning", + Type: domain.CategoryTypeMachineLearning, + seedCategoryID: 34, + }, + { + Name: "Security", + Type: domain.CategoryTypeSecurity, + seedCategoryID: 35, + }, + { + Name: "GraphQL", + Type: domain.CategoryTypeLibrary, + seedCategoryID: 36, + }, + { + Name: "GitHub", + Type: domain.CategoryTypeTool, + seedCategoryID: 37, + }, + { + Name: "Git", + Type: domain.CategoryTypeTool, + seedCategoryID: 38, + }, + { + Name: "VSCode", + Type: domain.CategoryTypeTool, + seedCategoryID: 39, + }, + { + Name: "GitHub Actions", + Type: domain.CategoryTypeDevOps, + seedCategoryID: 40, + }, + { + Name: "ChatGPT", + Type: domain.CategoryTypeTool, + seedCategoryID: 41, + }, + { + Name: "個人開発", + Type: domain.CategoryTypeOthers, + seedCategoryID: 42, + }, + { + Name: "Frontend", + Type: domain.CategoryTypeFrontend, + seedCategoryID: 43, + }, + { + Name: "Test", + Type: domain.CategoryTypeOthers, + seedCategoryID: 44, + }, + { + Name: "Expo", + Type: domain.CategoryTypeMobile, + seedCategoryID: 45, + }, + { + Name: "Devops", + Type: domain.CategoryTypeDevOps, + seedCategoryID: 46, + }, + } +} + +//func getPlatformDatas() []domain.Platform { +// deletedAt := time.Now() +// return []domain.Platform{ +// { +// Name: "Qiita", +// SiteURL: "https://qiita.com/", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://cdn.qiita.com/assets/favicons/public/apple-touch-icon-ec5ba42a24ae923f16825592efdc356f.png", +// IsEng: false, +// }, +// { +// Name: "Zenn", +// SiteURL: "https://zenn.dev/", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", +// IsEng: false, +// }, +// { +// Name: "はてなブックマーク", +// SiteURL: "https://b.hatena.ne.jp/hotentry/it", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://b.st-hatena.com/9912ec0e0fc8f818cf97c46ebfa93196dc945692/images/v4/public/gh-logo@2x.png", +// IsEng: false, +// }, +// { +// Name: "dev.to", +// SiteURL: "https://dev.to/", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://dev-to.s3.us-east-2.amazonaws.com/favicon.ico", +// IsEng: true, +// }, +// { +// Name: "A List Apart", +// SiteURL: "https://alistapart.com/", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://i0.wp.com/alistapart.com/wp-content/uploads/2019/03/cropped-icon_navigation-laurel-512.jpg?fit=32%2C32&ssl=1", +// IsEng: true, +// }, +// { +// Name: "David Walsh Blog", +// SiteURL: "https://davidwalsh.name/", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://davidwalsh.name/wp-content/themes/punky/images/logo.png", +// IsEng: true, +// }, +// { +// Name: "JavaScript Playground", +// SiteURL: "https://www.jackfranklin.co.uk/blog/", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://www.jackfranklin.co.uk/images/favicon/apple-touch-icon.png", +// IsEng: true, +// }, +// { +// Name: "Stack Overflow", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", +// IsEng: true, +// DeletedAt: &deletedAt, +// }, +// { +// Name: "free code camp", +// SiteURL: "https://www.freecodecamp.org/news/", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://cdn.freecodecamp.org/universal/favicons/favicon.ico", +// IsEng: true, +// }, +// { +// Name: "Developer.io", +// SiteURL: "https://dev.classmethod.jp/", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://dev.classmethod.jp/favicon.ico", +// IsEng: false, +// }, +// { +// Name: "google japan", +// SiteURL: "https://developers-jp.googleblog.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://developers-jp.googleblog.com/favicon.ico", +// IsEng: false, +// }, +// { +// Name: "楽天 ラクマ事業部", +// SiteURL: "https://www.wantedly.com/stories/s/rakuma", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://www.wantedly.com//favicon.ico", +// IsEng: false, +// }, +// { +// Name: "CyberAgent", +// SiteURL: "https://developers.cyberagent.co.jp/blog/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://developers.cyberagent.co.jp/blog/wp-content/uploads/2016/09/cropped-ca-32x32.png", +// IsEng: false, +// }, +// { +// Name: "paypay", +// SiteURL: "https://blog.paypay.ne.jp/category/engineering/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://blog.paypay.ne.jp/wp-content/uploads/2020/06/favicon.ico", +// IsEng: false, +// }, +// { +// Name: "メルカリ", +// SiteURL: "https://engineering.mercari.com/blog/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://engineering.mercari.com/favicon.ico", +// IsEng: false, +// }, +// { +// Name: "NTT", +// SiteURL: "https://engineers.ntt.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://engineers.ntt.com/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "Qiita (企業)", +// SiteURL: "https://blog.qiita.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://blog.qiita.com/wp-content/uploads/fbrfg/apple-touch-icon.png", +// IsEng: false, +// }, +// { +// Name: "Cybozu", +// SiteURL: "https://blog.cybozu.io/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://blog.cybozu.io/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "mixi", +// SiteURL: "https://mixi-developers.mixi.co.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://miro.medium.com/v2/resize:fill:256:256/1*lNHpX-0s-NUfCc6OxYFXLQ.png", +// IsEng: false, +// }, +// { +// Name: "GREE", +// SiteURL: "https://labs.gree.jp/blog/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://labs.gree.jp/blog/wp-content/uploads/2015/01/favicon.png", +// IsEng: false, +// }, +// { +// Name: "ZOZO", +// SiteURL: "https://techblog.zozo.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://techblog.zozo.com/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "DeNA", +// SiteURL: "https://engineering.dena.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://engineering.dena.com/favicon.png", +// IsEng: false, +// }, +// { +// Name: "リクルートテクノロジーズ", +// SiteURL: "https://blog.recruit.co.jp/rtc/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://blog.recruit.co.jp/rtc/wp-content/themes/pc-rtc-blog.git/library/images/favicon.ico", +// IsEng: false, +// }, +// { +// Name: "dwango on GitHub", +// SiteURL: "https://dwango.github.io/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://dwango.github.io/apple-touch-icon-144-precomposed.png", +// IsEng: false, +// }, +// { +// Name: "SanSan", +// SiteURL: "https://buildersbox.corp-sansan.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://buildersbox.corp-sansan.com/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "HRBrain", +// SiteURL: "https://times.hrbrain.co.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://times.hrbrain.co.jp/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "Lineヤフー", +// SiteURL: "https://techblog.lycorp.co.jp/ja", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://www.lycorp.co.jp/assets/images/favicon.ico", +// IsEng: false, +// }, +// { +// Name: "Sony Music", +// SiteURL: "https://tech.sme.co.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech.sme.co.jp/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "IBM", +// SiteURL: "https://www.ibm.com/blogs/solutions/jp-ja/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://www.ibm.com/favicon.ico", +// IsEng: false, +// }, +// { +// Name: "カミナシ", +// SiteURL: "https://kaminashi-developer.hatenablog.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://kaminashi-developer.hatenablog.jp/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "ANDPAD", +// SiteURL: "https://tech.andpad.co.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech.andpad.co.jp/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "gaudiy", +// SiteURL: "https://techblog.gaudiy.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://techblog.gaudiy.com/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "aws amazon web services", +// SiteURL: "https://aws.amazon.com/jp/blogs/news/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://a0.awsstatic.com/main/images/site/fav/favicon.ico", +// IsEng: false, +// }, +// { +// Name: "aws startup", +// SiteURL: "https://aws.amazon.com/jp/blogs/startup/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://a0.awsstatic.com/main/images/site/fav/favicon.ico", +// IsEng: false, +// }, +// { +// Name: "LayerX", +// SiteURL: "https://tech.layerx.co.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech.layerx.co.jp/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "UPSIDER", +// SiteURL: "https://tech.up-sider.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech.up-sider.com/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "CADDI", +// SiteURL: "https://caddi.tech/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://caddi.tech/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "UZABASE", +// SiteURL: "https://tech.uzabase.com/archive/category/Blog", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech.uzabase.com/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "BASE", +// SiteURL: "https://devblog.thebase.in/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://devblog.thebase.in/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "タイミー", +// SiteURL: "https://tech.timee.co.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech.timee.co.jp/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "はてな開発者ブログ", +// SiteURL: "https://developer.hatenastaff.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://developer.hatenastaff.com/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "Money Forward", +// SiteURL: "https://moneyforward-dev.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://moneyforward-dev.jp/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "pixiv", +// SiteURL: "https://inside.pixiv.blog/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://inside.pixiv.blog/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "speee", +// SiteURL: "https://tech.speee.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech.speee.jp/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "Gunosy", +// SiteURL: "https://tech.gunosy.io/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech.gunosy.io/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "クックパッド", +// SiteURL: "https://techlife.cookpad.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://techlife.cookpad.com/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "wantedly", +// SiteURL: "https://www.wantedly.com/stories/s/wantedly_engineers", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://www.wantedly.com//favicon.ico", +// IsEng: false, +// }, +// { +// Name: "ABEJA", +// SiteURL: "https://tech-blog.abeja.asia/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech-blog.abeja.asia/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "AppBrew", +// SiteURL: "https://tech.appbrew.io/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech.appbrew.io/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "エウレカ", +// SiteURL: "https://medium.com/eureka-engineering", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", +// IsEng: false, +// }, +// { +// Name: "Airbnb", +// SiteURL: "https://medium.com/airbnb-engineering", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", +// IsEng: true, +// }, +// { +// Name: "Atlassian", +// SiteURL: "https://blog.developer.atlassian.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://blog.developer.atlassian.com/wp-content/uploads/2019/02/cropped-Atlassian-Developer@2x-blue-rgb-32x32.png", +// IsEng: true, +// }, +// { +// Name: "Docker", +// SiteURL: "https://www.docker.com/blog/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://www.docker.com/wp-content/uploads/2024/02/cropped-docker-logo-favicon-32x32.png", +// IsEng: true, +// }, +// { +// Name: "Facebook", +// SiteURL: "https://engineering.fb.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://engineering.fb.com/wp-content/themes/code-fb-com/favicon.ico", +// IsEng: true, +// }, +// { +// Name: "GitHub", +// SiteURL: "https://github.blog/category/engineering/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://github.githubassets.com/favicon.ico", +// IsEng: true, +// }, +// { +// Name: "Google", +// SiteURL: "https://developers.googleblog.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://developers.googleblog.com/favicon.ico", +// IsEng: true, +// }, +// { +// Name: "Instagram", +// SiteURL: "https://instagram-engineering.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", +// IsEng: true, +// }, +// { +// Name: "Netflix", +// SiteURL: "https://netflixtechblog.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", +// IsEng: true, +// }, +// { +// Name: "PayPal", +// SiteURL: "https://medium.com/paypal-tech", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", +// IsEng: true, +// }, +// { +// Name: "Salesforce", +// SiteURL: "https://engineering.salesforce.com/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://engineering.salesforce.com/wp-content/uploads/2022/05/salesforce-icon.png?w=32", +// IsEng: true, +// }, +// { +// Name: "Zoom", +// SiteURL: "https://medium.com/zoom-developer-blog", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", +// IsEng: true, +// }, +// { +// Name: "Asana", +// SiteURL: "https://blog.asana.com/category/eng/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://d1gwm4cf8hecp4.cloudfront.net/images/favicons/apple-touch-icon-57x57.png", +// IsEng: true, +// }, +// { +// Name: "mercari", +// SiteURL: "https://engineering.mercari.com/en/blog/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://engineering.mercari.com/favicon.ico", +// IsEng: true, +// }, +// { +// Name: "ROUTE 06", +// SiteURL: "https://tech.route06.co.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://tech.route06.co.jp/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "スタディサプリ", +// SiteURL: "https://blog.studysapuri.jp/", +// PlatformType: domain.PlatformTypeCompany, +// FaviconURL: "https://blog.studysapuri.jp/icon/favicon", +// IsEng: false, +// }, +// { +// Name: "Menthas", +// SiteURL: "https://menthas.com/", +// PlatformType: domain.PlatformTypeSite, +// FaviconURL: "https://menthas.com/apple-touch-icon.png", +// IsEng: false, +// }, +// } +//} + +type seedPlatformFeed struct { + PlatformName string + FeedName string + seedCategoryID int + PlatformSiteURL string + FeedSiteURL string + PlatformType domain.PlatformType + FaviconURL string + IsEng bool + RssURL string + DeletedAt *time.Time +} + +func getSeedPlatformAndFeeds() []seedPlatformFeed { + deletedAt := time.Now() + return []seedPlatformFeed{ + { + PlatformName: "Qiita", + FeedName: "Qiitaのトレンド", + seedCategoryID: 2, + RssURL: "https://qiita.com/popular-items/feed.atom", + PlatformSiteURL: "https://qiita.com/", + FeedSiteURL: "https://qiita.com/", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.qiita.com/assets/favicons/public/apple-touch-icon-ec5ba42a24ae923f16825592efdc356f.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zennの新着記事", + seedCategoryID: 1, + RssURL: "https://zenn.dev/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "はてなブックマーク", + FeedName: "はてなブックマークのテクノロジー", + seedCategoryID: 3, + RssURL: "https://b.hatena.ne.jp/hotentry/it.rss", + PlatformSiteURL: "https://b.hatena.ne.jp/hotentry", + FeedSiteURL: "https://b.hatena.ne.jp/hotentry/it", + PlatformType: domain.PlatformTypeSummary, + FaviconURL: "https://b.st-hatena.com/9912ec0e0fc8f818cf97c46ebfa93196dc945692/images/v4/public/gh-logo@2x.png", + IsEng: false, + }, + { + PlatformName: "dev.to", + FeedName: "dev.to", + seedCategoryID: 1, + RssURL: "https://dev.to/feed", + PlatformSiteURL: "https://dev.to/", + FeedSiteURL: "https://dev.to/", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://dev-to.s3.us-east-2.amazonaws.com/favicon.ico", + IsEng: true, + }, + { + PlatformName: "A List Apart", + FeedName: "A List Apart", + seedCategoryID: 1, + RssURL: "https://alistapart.com/main/feed/", + PlatformSiteURL: "https://alistapart.com/", + FeedSiteURL: "https://alistapart.com/", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://i0.wp.com/alistapart.com/wp-content/uploads/2019/03/cropped-icon_navigation-laurel-512.jpg?fit=32%2C32&ssl=1", + IsEng: true, + }, + { + PlatformName: "David Walsh Blog", + FeedName: "David Walsh Blog", + seedCategoryID: 1, + RssURL: "https://davidwalsh.name/feed/atom", + PlatformSiteURL: "https://davidwalsh.name/", + FeedSiteURL: "https://davidwalsh.name/", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://davidwalsh.name/wp-content/themes/punky/images/logo.png", + IsEng: true, + }, + { + PlatformName: "JavaScript Playground", + FeedName: "JavaScript Playground", + seedCategoryID: 1, + RssURL: "https://www.jackfranklin.co.uk/feed.xml", + PlatformSiteURL: "https://www.jackfranklin.co.uk/blog/", + FeedSiteURL: "https://www.jackfranklin.co.uk/blog/", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://www.jackfranklin.co.uk/images/favicon/apple-touch-icon.png", + IsEng: true, + }, + { + PlatformName: "Stack Overflow", + FeedName: "Stack Overflow", + seedCategoryID: 1, + RssURL: "https://stackoverflow.com/feeds", + PlatformSiteURL: "https://stackoverflow.com/", + FeedSiteURL: "https://stackoverflow.com/", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196", + IsEng: true, + DeletedAt: &deletedAt, + }, + { + PlatformName: "free code camp", + FeedName: "free code camp", + seedCategoryID: 1, + RssURL: "https://www.freecodecamp.org/news/rss/", + PlatformSiteURL: "https://www.freecodecamp.org/news/", + FeedSiteURL: "https://www.freecodecamp.org/news/", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.freecodecamp.org/universal/favicons/favicon.ico", + IsEng: true, + }, + { + PlatformName: "Developer.io", + FeedName: "Developer.io", + seedCategoryID: 1, + RssURL: "https://dev.classmethod.jp/feed/", + PlatformSiteURL: "https://dev.classmethod.jp/", + FeedSiteURL: "https://dev.classmethod.jp/", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://dev.classmethod.jp/favicon.ico", + IsEng: false, + }, + { + PlatformName: "google japan", + FeedName: "google japan", + seedCategoryID: 1, + RssURL: "https://developers-jp.googleblog.com/atom.xml", + PlatformSiteURL: "https://developers-jp.googleblog.com/", + FeedSiteURL: "https://developers-jp.googleblog.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://developers-jp.googleblog.com/favicon.ico", + IsEng: false, + }, + { + PlatformName: "楽天 ラクマ事業部", + FeedName: "楽天 ラクマ事業部", + seedCategoryID: 1, + RssURL: "https://www.wantedly.com/stories/s/rakuma/rss.xml", + PlatformSiteURL: "https://www.wantedly.com/stories/s/rakuma", + FeedSiteURL: "https://www.wantedly.com/stories/s/rakuma", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://www.wantedly.com//favicon.ico", + IsEng: false, + }, + { + PlatformName: "CyberAgent", + FeedName: "CyberAgent", + seedCategoryID: 1, + RssURL: "https://developers.cyberagent.co.jp/blog/feed/", + PlatformSiteURL: "https://developers.cyberagent.co.jp/blog/", + FeedSiteURL: "https://developers.cyberagent.co.jp/blog/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://developers.cyberagent.co.jp/blog/wp-content/uploads/2016/09/cropped-ca-32x32.png", + IsEng: false, + }, + { + PlatformName: "paypay", + FeedName: "paypay", + seedCategoryID: 1, + RssURL: "https://blog.paypay.ne.jp/category/engineering/feed/", + PlatformSiteURL: "https://blog.paypay.ne.jp/category/engineering/", + FeedSiteURL: "https://blog.paypay.ne.jp/category/engineering/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://blog.paypay.ne.jp/wp-content/uploads/2020/06/favicon.ico", + IsEng: false, + }, + { + PlatformName: "メルカリ", + FeedName: "メルカリ", + seedCategoryID: 1, + RssURL: "https://engineering.mercari.com/blog/feed.xml", + PlatformSiteURL: "https://engineering.mercari.com/blog/", + FeedSiteURL: "https://engineering.mercari.com/blog/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://engineering.mercari.com/favicon.ico", + IsEng: false, + }, + { + PlatformName: "NTT", + FeedName: "NTT", + seedCategoryID: 1, + RssURL: "https://engineers.ntt.com/feed", + PlatformSiteURL: "https://engineers.ntt.com/", + FeedSiteURL: "https://engineers.ntt.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://engineers.ntt.com/icon/favicon", + IsEng: false, + }, + { + PlatformName: "Qiita (企業)", + FeedName: "Qiita (企業)", + seedCategoryID: 1, + RssURL: "https://blog.qiita.com/feed/", + PlatformSiteURL: "https://blog.qiita.com/", + FeedSiteURL: "https://blog.qiita.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://blog.qiita.com/wp-content/uploads/fbrfg/apple-touch-icon.png", + IsEng: false, + }, + { + PlatformName: "Cybozu", + FeedName: "Cybozu", + seedCategoryID: 1, + RssURL: "https://blog.cybozu.io/feed", + PlatformSiteURL: "https://blog.cybozu.io/", + FeedSiteURL: "https://blog.cybozu.io/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://blog.cybozu.io/icon/favicon", + IsEng: false, + }, + { + PlatformName: "mixi", + FeedName: "mixi", + seedCategoryID: 1, + RssURL: "https://mixi-developers.mixi.co.jp/feed", + PlatformSiteURL: "https://mixi-developers.mixi.co.jp/", + FeedSiteURL: "https://mixi-developers.mixi.co.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://miro.medium.com/v2/resize:fill:256:256/1*lNHpX-0s-NUfCc6OxYFXLQ.png", + IsEng: false, + }, + { + PlatformName: "GREE", + FeedName: "GREE", + seedCategoryID: 1, + RssURL: "https://labs.gree.jp/blog/feed/", + PlatformSiteURL: "https://labs.gree.jp/blog/", + FeedSiteURL: "https://labs.gree.jp/blog/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://labs.gree.jp/blog/wp-content/uploads/2015/01/favicon.png", + IsEng: false, + }, + { + PlatformName: "ZOZO", + FeedName: "ZOZO", + seedCategoryID: 1, + RssURL: "https://techblog.zozo.com/rss", + PlatformSiteURL: "https://techblog.zozo.com/", + FeedSiteURL: "https://techblog.zozo.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://techblog.zozo.com/icon/favicon", + IsEng: false, + }, + { + PlatformName: "DeNA", + FeedName: "DeNA", + seedCategoryID: 1, + RssURL: "https://engineering.dena.com/index.xml", + PlatformSiteURL: "https://engineering.dena.com/", + FeedSiteURL: "https://engineering.dena.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://engineering.dena.com/favicon.png", + IsEng: false, + }, + { + PlatformName: "リクルートテクノロジーズ", + FeedName: "リクルートテクノロジーズ", + seedCategoryID: 1, + RssURL: "https://blog.recruit.co.jp/rtc/feed/", + PlatformSiteURL: "https://blog.recruit.co.jp/rtc/", + FeedSiteURL: "https://blog.recruit.co.jp/rtc/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://blog.recruit.co.jp/rtc/wp-content/themes/pc-rtc-blog.git/library/images/favicon.ico", + IsEng: false, + }, + { + PlatformName: "dwango on GitHub", + FeedName: "dwango on GitHub", + seedCategoryID: 1, + RssURL: "https://dwango.github.io/index.xml", + PlatformSiteURL: "https://dwango.github.io/", + FeedSiteURL: "https://dwango.github.io/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://dwango.github.io/apple-touch-icon-144-precomposed.png", + IsEng: false, + }, + { + PlatformName: "SanSan", + FeedName: "SanSan", + seedCategoryID: 1, + RssURL: "https://buildersbox.corp-sansan.com/rss", + PlatformSiteURL: "https://buildersbox.corp-sansan.com/", + FeedSiteURL: "https://buildersbox.corp-sansan.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://buildersbox.corp-sansan.com/icon/favicon", + IsEng: false, + }, + { + PlatformName: "HRBrain", + FeedName: "HRBrain", + seedCategoryID: 1, + RssURL: "https://times.hrbrain.co.jp/rss", + PlatformSiteURL: "https://times.hrbrain.co.jp/", + FeedSiteURL: "https://times.hrbrain.co.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://times.hrbrain.co.jp/icon/favicon", + IsEng: false, + }, + { + PlatformName: "Lineヤフー", + FeedName: "Lineヤフー", + seedCategoryID: 1, + RssURL: "https://techblog.lycorp.co.jp/ja/feed/index.xml", + PlatformSiteURL: "https://techblog.lycorp.co.jp/ja", + FeedSiteURL: "https://techblog.lycorp.co.jp/ja", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://www.lycorp.co.jp/assets/images/favicon.ico", + IsEng: false, + }, + { + PlatformName: "Sony Music", + FeedName: "Sony Music", + seedCategoryID: 1, + RssURL: "https://tech.sme.co.jp/rss", + PlatformSiteURL: "https://tech.sme.co.jp/", + FeedSiteURL: "https://tech.sme.co.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech.sme.co.jp/icon/favicon", + IsEng: false, + }, + { + PlatformName: "IBM", + FeedName: "IBM", + seedCategoryID: 1, + RssURL: "https://www.ibm.com/blogs/solutions/jp-ja/feed/atom/", + PlatformSiteURL: "https://www.ibm.com/blogs/solutions/jp-ja/", + FeedSiteURL: "https://www.ibm.com/blogs/solutions/jp-ja/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://www.ibm.com/favicon.ico", + IsEng: false, + }, + { + PlatformName: "カミナシ", + FeedName: "カミナシ", + seedCategoryID: 1, + RssURL: "https://kaminashi-developer.hatenablog.jp/rss", + PlatformSiteURL: "https://kaminashi-developer.hatenablog.jp/", + FeedSiteURL: "https://kaminashi-developer.hatenablog.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://kaminashi-developer.hatenablog.jp/icon/favicon", + IsEng: false, + }, + { + PlatformName: "ANDPAD", + FeedName: "ANDPAD", + seedCategoryID: 1, + RssURL: "https://tech.andpad.co.jp/rss", + PlatformSiteURL: "https://tech.andpad.co.jp/", + FeedSiteURL: "https://tech.andpad.co.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech.andpad.co.jp/icon/favicon", + IsEng: false, + }, + { + PlatformName: "gaudiy", + FeedName: "gaudiy", + seedCategoryID: 1, + RssURL: "https://techblog.gaudiy.com/rss", + PlatformSiteURL: "https://techblog.gaudiy.com/", + FeedSiteURL: "https://techblog.gaudiy.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://techblog.gaudiy.com/icon/favicon", + IsEng: false, + }, + { + PlatformName: "aws amazon web services", + FeedName: "aws amazon web services", + seedCategoryID: 1, + RssURL: "https://aws.amazon.com/jp/blogs/news/feed/", + PlatformSiteURL: "https://aws.amazon.com/jp/blogs/news/", + FeedSiteURL: "https://aws.amazon.com/jp/blogs/news/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://a0.awsstatic.com/main/images/site/fav/favicon.ico", + IsEng: false, + }, + { + PlatformName: "aws startup", + FeedName: "aws startup", + seedCategoryID: 1, + RssURL: "https://aws.amazon.com/jp/blogs/startup/feed/", + PlatformSiteURL: "https://aws.amazon.com/jp/blogs/startup/", + FeedSiteURL: "https://aws.amazon.com/jp/blogs/startup/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://a0.awsstatic.com/main/images/site/fav/favicon.ico", + IsEng: false, + }, + { + PlatformName: "LayerX", + FeedName: "LayerX", + seedCategoryID: 1, + RssURL: "https://tech.layerx.co.jp/rss", + PlatformSiteURL: "https://tech.layerx.co.jp/", + FeedSiteURL: "https://tech.layerx.co.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech.layerx.co.jp/icon/favicon", + IsEng: false, + }, + { + PlatformName: "UPSIDER", + FeedName: "UPSIDER", + seedCategoryID: 1, + RssURL: "https://tech.up-sider.com/rss", + PlatformSiteURL: "https://tech.up-sider.com/", + FeedSiteURL: "https://tech.up-sider.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech.up-sider.com/icon/favicon", + IsEng: false, + }, + { + PlatformName: "CADDI", + FeedName: "CADDI", + seedCategoryID: 1, + RssURL: "https://caddi.tech/rss", + PlatformSiteURL: "https://caddi.tech/", + FeedSiteURL: "https://caddi.tech/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://caddi.tech/icon/favicon", + IsEng: false, + }, + { + PlatformName: "UZABASE", + FeedName: "UZABASE", + seedCategoryID: 1, + RssURL: "https://tech.uzabase.com/rss/category/Blog", + PlatformSiteURL: "https://tech.uzabase.com/archive/category/Blog", + FeedSiteURL: "https://tech.uzabase.com/rss/category/Blog", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech.uzabase.com/icon/favicon", + IsEng: false, + }, + { + PlatformName: "BASE", + FeedName: "BASE", + seedCategoryID: 1, + RssURL: "https://devblog.thebase.in/rss", + PlatformSiteURL: "https://devblog.thebase.in/", + FeedSiteURL: "https://devblog.thebase.in/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://devblog.thebase.in/icon/favicon", + IsEng: false, + }, + { + PlatformName: "タイミー", + FeedName: "タイミー", + seedCategoryID: 1, + RssURL: "https://tech.timee.co.jp/rss", + PlatformSiteURL: "https://tech.timee.co.jp/", + FeedSiteURL: "https://tech.timee.co.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech.timee.co.jp/icon/favicon", + IsEng: false, + }, + { + PlatformName: "はてな開発者ブログ", + FeedName: "はてな開発者ブログ", + seedCategoryID: 1, + RssURL: "https://developer.hatenastaff.com/rss", + PlatformSiteURL: "https://developer.hatenastaff.com/", + FeedSiteURL: "https://developer.hatenastaff.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://developer.hatenastaff.com/icon/favicon", + IsEng: false, + }, + { + PlatformName: "Money Forward", + FeedName: "Money Forward", + seedCategoryID: 1, + RssURL: "https://moneyforward-dev.jp/rss", + PlatformSiteURL: "https://moneyforward-dev.jp/", + FeedSiteURL: "https://moneyforward-dev.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://moneyforward-dev.jp/icon/favicon", + IsEng: false, + }, + { + PlatformName: "pixiv", + FeedName: "pixiv", + seedCategoryID: 1, + RssURL: "https://inside.pixiv.blog/rss", + PlatformSiteURL: "https://inside.pixiv.blog/", + FeedSiteURL: "https://inside.pixiv.blog/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://inside.pixiv.blog/icon/favicon", + IsEng: false, + }, + { + PlatformName: "speee", + FeedName: "speee", + seedCategoryID: 1, + RssURL: "https://tech.speee.jp/rss", + PlatformSiteURL: "https://tech.speee.jp/", + FeedSiteURL: "https://tech.speee.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech.speee.jp/icon/favicon", + IsEng: false, + }, + { + PlatformName: "Gunosy", + FeedName: "Gunosy", + seedCategoryID: 1, + RssURL: "https://tech.gunosy.io/rss", + PlatformSiteURL: "https://tech.gunosy.io/", + FeedSiteURL: "https://tech.gunosy.io/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech.gunosy.io/icon/favicon", + IsEng: false, + }, + { + PlatformName: "クックパッド", + FeedName: "クックパッド", + seedCategoryID: 1, + RssURL: "https://techlife.cookpad.com/rss", + PlatformSiteURL: "https://techlife.cookpad.com/", + FeedSiteURL: "https://techlife.cookpad.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://techlife.cookpad.com/icon/favicon", + IsEng: false, + }, + { + PlatformName: "wantedly", + FeedName: "wantedly", + seedCategoryID: 1, + RssURL: "https://www.wantedly.com/stories/s/wantedly_engineers/rss.xml", + PlatformSiteURL: "https://www.wantedly.com/stories/s/wantedly_engineers", + FeedSiteURL: "https://www.wantedly.com/stories/s/wantedly_engineers", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://www.wantedly.com//favicon.ico", + IsEng: false, + }, + { + PlatformName: "ABEJA", + FeedName: "ABEJA", + seedCategoryID: 1, + RssURL: "https://tech-blog.abeja.asia/rss", + PlatformSiteURL: "https://tech-blog.abeja.asia/", + FeedSiteURL: "https://tech-blog.abeja.asia/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech-blog.abeja.asia/icon/favicon", + IsEng: false, + }, + { + PlatformName: "AppBrew", + FeedName: "AppBrew", + seedCategoryID: 1, + RssURL: "https://tech.appbrew.io/rss", + PlatformSiteURL: "https://tech.appbrew.io/", + FeedSiteURL: "https://tech.appbrew.io/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech.appbrew.io/icon/favicon", + IsEng: false, + }, + { + PlatformName: "エウレカ", + FeedName: "エウレカ", + seedCategoryID: 1, + RssURL: "https://medium.com/feed/eureka-engineering", + PlatformSiteURL: "https://medium.com/eureka-engineering", + FeedSiteURL: "https://medium.com/eureka-engineering", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", + IsEng: false, + }, + { + PlatformName: "Airbnb", + FeedName: "Airbnb", + seedCategoryID: 1, + RssURL: "https://medium.com/feed/airbnb-engineering", + PlatformSiteURL: "https://medium.com/airbnb-engineering", + FeedSiteURL: "https://medium.com/airbnb-engineering", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", + IsEng: true, + }, + { + PlatformName: "Atlassian", + FeedName: "Atlassian", + seedCategoryID: 1, + RssURL: "https://blog.developer.atlassian.com/feed/", + PlatformSiteURL: "https://blog.developer.atlassian.com/", + FeedSiteURL: "https://blog.developer.atlassian.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://blog.developer.atlassian.com/wp-content/uploads/2019/02/cropped-Atlassian-Developer@2x-blue-rgb-32x32.png", + IsEng: true, + }, + { + PlatformName: "Docker", + FeedName: "Docker", + seedCategoryID: 1, + RssURL: "https://www.docker.com/feed/", + PlatformSiteURL: "https://www.docker.com/blog/", + FeedSiteURL: "https://www.docker.com/blog/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://www.docker.com/wp-content/uploads/2024/02/cropped-docker-logo-favicon-32x32.png", + IsEng: true, + }, + { + PlatformName: "Facebook", + FeedName: "Facebook", + seedCategoryID: 1, + RssURL: "https://engineering.fb.com/feed/", + PlatformSiteURL: "https://engineering.fb.com/", + FeedSiteURL: "https://engineering.fb.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://engineering.fb.com/wp-content/themes/code-fb-com/favicon.ico", + IsEng: true, + }, + { + PlatformName: "GitHub", + FeedName: "GitHub", + seedCategoryID: 1, + RssURL: "https://github.blog/category/engineering/feed/", + PlatformSiteURL: "https://github.blog/category/engineering/", + FeedSiteURL: "https://github.blog/category/engineering/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://github.githubassets.com/favicon.ico", + IsEng: true, + }, + { + PlatformName: "Google", + FeedName: "Google", + seedCategoryID: 1, + RssURL: "https://www.blogger.com/feeds/596098824972435195/posts/default", + PlatformSiteURL: "https://developers.googleblog.com/", + FeedSiteURL: "https://developers.googleblog.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://developers.googleblog.com/favicon.ico", + IsEng: true, + }, + { + PlatformName: "Instagram", + FeedName: "Instagram", + seedCategoryID: 1, + RssURL: "https://instagram-engineering.com/feed", + PlatformSiteURL: "https://instagram-engineering.com/", + FeedSiteURL: "https://instagram-engineering.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", + IsEng: true, + }, + { + PlatformName: "Netflix", + FeedName: "Netflix", + seedCategoryID: 1, + RssURL: "https://netflixtechblog.com/feed", + PlatformSiteURL: "https://netflixtechblog.com/", + FeedSiteURL: "https://netflixtechblog.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", + IsEng: true, + }, + { + PlatformName: "PayPal", + FeedName: "PayPal", + seedCategoryID: 1, + RssURL: "https://medium.com/feed/paypal-tech", + PlatformSiteURL: "https://medium.com/paypal-tech", + FeedSiteURL: "https://medium.com/paypal-tech", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", + IsEng: true, + }, + { + PlatformName: "Salesforce", + FeedName: "Salesforce", + seedCategoryID: 1, + RssURL: "https://engineering.salesforce.com/feed/", + PlatformSiteURL: "https://engineering.salesforce.com/", + FeedSiteURL: "https://engineering.salesforce.com/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://engineering.salesforce.com/wp-content/uploads/2022/05/salesforce-icon.png?w=32", + IsEng: true, + }, + { + PlatformName: "Zoom", + FeedName: "Zoom", + seedCategoryID: 1, + RssURL: "https://medium.com/feed/zoom-developer-blog", + PlatformSiteURL: "https://medium.com/zoom-developer-blog", + FeedSiteURL: "https://medium.com/zoom-developer-blog", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://miro.medium.com/1*m-R_BkNf1Qjr1YbyOIJY2w.png", + IsEng: true, + }, + { + PlatformName: "Asana", + FeedName: "Asana", + seedCategoryID: 1, + RssURL: "https://blog.asana.com/category/eng/feed/", + PlatformSiteURL: "https://blog.asana.com/category/eng/", + FeedSiteURL: "https://blog.asana.com/category/eng/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://d1gwm4cf8hecp4.cloudfront.net/images/favicons/apple-touch-icon-57x57.png", + IsEng: true, + }, + { + PlatformName: "mercari", + FeedName: "mercari", + seedCategoryID: 1, + RssURL: "https://engineering.mercari.com/en/blog/feed.xml", + PlatformSiteURL: "https://engineering.mercari.com/en/blog/", + FeedSiteURL: "https://engineering.mercari.com/en/blog/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://engineering.mercari.com/favicon.ico", + IsEng: true, + }, + { + PlatformName: "ROUTE 06", + FeedName: "ROUTE 06", + seedCategoryID: 1, + RssURL: "https://tech.route06.co.jp/feed", + PlatformSiteURL: "https://tech.route06.co.jp/", + FeedSiteURL: "https://tech.route06.co.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://tech.route06.co.jp/icon/favicon", + IsEng: false, + }, + { + PlatformName: "スタディサプリ", + FeedName: "スタディサプリ", + seedCategoryID: 1, + RssURL: "https://blog.studysapuri.jp/rss", + PlatformSiteURL: "https://blog.studysapuri.jp/", + FeedSiteURL: "https://blog.studysapuri.jp/", + PlatformType: domain.PlatformTypeCompany, + FaviconURL: "https://blog.studysapuri.jp/icon/favicon", + IsEng: false, + }, + { + PlatformName: "Menthas", + FeedName: "Menthas", + seedCategoryID: 1, + RssURL: "https://menthas.com/all/rss", + PlatformSiteURL: "https://menthas.com", + FeedSiteURL: "https://menthas.com", + PlatformType: domain.PlatformTypeSummary, + FaviconURL: "https://menthas.com/apple-touch-icon.png", + IsEng: false, + }, + { + PlatformName: "Menthas", + FeedName: "Menthas programing", + seedCategoryID: 4, + RssURL: "https://menthas.com/programming/rss", + PlatformSiteURL: "https://menthas.com", + FeedSiteURL: "https://menthas.com/programming", + PlatformType: domain.PlatformTypeSummary, + FaviconURL: "https://menthas.com/apple-touch-icon.png", + IsEng: false, + }, + { + PlatformName: "Menthas", + FeedName: "Menthas javascript", + seedCategoryID: 5, + RssURL: "https://menthas.com/javascript/rss", + PlatformSiteURL: "https://menthas.com", + FeedSiteURL: "https://menthas.com/javascript", + PlatformType: domain.PlatformTypeSummary, + FaviconURL: "https://menthas.com/apple-touch-icon.png", + IsEng: false, + }, + { + PlatformName: "Menthas", + FeedName: "Menthas infrastructure", + seedCategoryID: 25, + RssURL: "https://menthas.com/infrastructure/rss", + PlatformSiteURL: "https://menthas.com", + FeedSiteURL: "https://menthas.com/infrastructure", + PlatformType: domain.PlatformTypeSummary, + FaviconURL: "https://menthas.com/apple-touch-icon.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn React", + seedCategoryID: 18, + RssURL: "https://zenn.dev/topics/react/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/react", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn Next.js", + seedCategoryID: 18, + RssURL: "https://zenn.dev/topics/nextjs/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/nextjs", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn React Native", + seedCategoryID: 26, + RssURL: "https://zenn.dev/topics/reactnative/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/reactnative", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn JavaScript", + seedCategoryID: 5, + RssURL: "https://zenn.dev/topics/javascript/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/javascript", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn TypeScript", + seedCategoryID: 6, + RssURL: "https://zenn.dev/topics/typescript/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/typescript", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn Node.js", + seedCategoryID: 22, + RssURL: "https://zenn.dev/topics/nodejs/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/nodejs", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn Golang", + seedCategoryID: 9, + RssURL: "https://zenn.dev/topics/go/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/go", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn AWS", + seedCategoryID: 28, + RssURL: "https://zenn.dev/topics/aws/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/aws", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn GCP", + seedCategoryID: 29, + RssURL: "https://zenn.dev/topics/gcp/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/gcp", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn Docker", + seedCategoryID: 31, + RssURL: "https://zenn.dev/topics/docker/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/docker", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn GraphQL", + seedCategoryID: 36, + RssURL: "https://zenn.dev/topics/graphql/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/graphql", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn GitHub", + seedCategoryID: 37, + RssURL: "https://zenn.dev/topics/github/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/github", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn GitHub Actions", + seedCategoryID: 40, + RssURL: "https://zenn.dev/topics/githubactions/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/githubactions", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn GitHub Actions", + seedCategoryID: 41, + RssURL: "https://zenn.dev/topics/chatgpt/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/chatgpt", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn 個人開発", + seedCategoryID: 42, + RssURL: "https://zenn.dev/topics/個人開発/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/個人開発", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn Frontend", + seedCategoryID: 43, + RssURL: "https://zenn.dev/topics/frontend/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/frontend", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Zenn", + FeedName: "Zenn Test", + seedCategoryID: 44, + RssURL: "https://zenn.dev/topics/test/feed", + PlatformSiteURL: "https://zenn.dev", + FeedSiteURL: "https://zenn.dev/topics/test", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://static.zenn.studio/images/logo-transparent.png", + IsEng: false, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode React", + seedCategoryID: 18, + RssURL: "https://hashnode.com/n/reactjs/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/reactjs", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode Next.js", + seedCategoryID: 20, + RssURL: "https://hashnode.com/n/nextjs/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/nextjs", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode React Native", + seedCategoryID: 26, + RssURL: "https://hashnode.com/n/react-native/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/react-native", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode Expo", + seedCategoryID: 45, + RssURL: "https://hashnode.com/n/expo/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/expo", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode Node.js", + seedCategoryID: 22, + RssURL: "https://hashnode.com/n/nodejs/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/nodejs", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode TypeScript", + seedCategoryID: 6, + RssURL: "https://hashnode.com/n/typescript/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/typescript", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode Golang", + seedCategoryID: 9, + RssURL: "https://hashnode.com/n/go/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/go", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + + { + PlatformName: "Hashnode", + FeedName: "Hashnode AWS", + seedCategoryID: 28, + RssURL: "https://hashnode.com/n/aws/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/aws", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode GCP", + seedCategoryID: 29, + RssURL: "https://hashnode.com/n/gcp/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/gcp", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode Docker", + seedCategoryID: 31, + RssURL: "https://hashnode.com/n/docker/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/docker", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode Testing", + seedCategoryID: 44, + RssURL: "https://hashnode.com/n/testing/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/testing", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode GraphQL", + seedCategoryID: 36, + RssURL: "https://hashnode.com/n/graphql/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/graphql", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode Frontend Development", + seedCategoryID: 43, + RssURL: "https://hashnode.com/n/frontend-development/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/frontend-development", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode Web Development", + seedCategoryID: 4, + RssURL: "https://hashnode.com/n/web-development/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/web-development", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode ChatGPT", + seedCategoryID: 41, + RssURL: "https://hashnode.com/n/chatgpt/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/chatgpt", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode Developer", + seedCategoryID: 4, + RssURL: "https://hashnode.com/n/developer/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/developer", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + { + PlatformName: "Hashnode", + FeedName: "Hashnode Devops", + seedCategoryID: 46, + RssURL: "https://hashnode.com/n/devops/rss", + PlatformSiteURL: "https://hashnode.com", + FeedSiteURL: "https://hashnode.com/n/devops", + PlatformType: domain.PlatformTypeSite, + FaviconURL: "https://cdn.hashnode.com/res/hashnode/image/upload/v1611242155728/W3_BYVVVh.png", + IsEng: true, + }, + } +} diff --git a/batch-service/database/seed/seeders/platform_seed.go b/batch-service/database/seed/seeders/platform_seed.go deleted file mode 100644 index 73784372..00000000 --- a/batch-service/database/seed/seeders/platform_seed.go +++ /dev/null @@ -1,928 +0,0 @@ -package seeders - -import ( - "context" - "fmt" - "time" - - "cloud.google.com/go/firestore" - "github.com/YukiOnishi1129/techpicks/batch-service/domain" - goose "github.com/advancedlogic/GoOse" - "github.com/google/uuid" -) - -type PlatformSeedInterface interface { - SeedPlatform(ctx context.Context) error -} - -type PlatformSeed struct { - Client *firestore.Client -} - -func NewPlatformSeed(client *firestore.Client) *PlatformSeed { - return &PlatformSeed{Client: client} -} - -func (ps *PlatformSeed) SeedPlatform(ctx context.Context) error { - batch := ps.Client.BulkWriter(ctx) - iter := ps.Client.Collection("platforms").Documents(ctx) - - platforms := getPlatformDatas() - for _, p := range platforms { - isSkip := false - for { - doc, err := iter.Next() - if err != nil { - break - } - data := doc.Data() - if data["site_url"].(string) == p.SiteURL { - isSkip = true - break - } - } - if isSkip { - fmt.Printf("skip: %s\n", p.Name) - continue - } - - platformID, err := uuid.NewUUID() - if err != nil { - return err - } - now := time.Now().Unix() - faviconURL, ogpImageURL, err := getMetaData(p.SiteURL) - if err != nil { - fmt.Printf("getMetaData err: skiped url: %s\n, error: %s\n", p.SiteURL, err) - continue - } - ref := ps.Client.Collection("platforms").Doc(platformID.String()) - - platforms := domain.PlatformFirestore{ - Name: p.Name, - CategoryName: p.CategoryName, - RssURL: p.RssURL, - SiteURL: p.SiteURL, - PlatformType: p.PlatformType, - IsEng: p.IsEng, - ThumbnailImageURL: ogpImageURL, - FaviconURL: faviconURL, - CreatedAt: int(now), - UpdatedAt: int(now), - DeletedAt: nil, - } - - if p.DeletedAt != nil { - platforms.DeletedAt = p.DeletedAt - } - _, err = batch.Set(ref, platforms) - if err != nil { - return err - } - } - batch.Flush() - return nil -} - -func getMetaData(url string) (faviconURL, ogpImageURL string, err error) { - g := goose.New() - article, err := g.ExtractFromURL(url) - if err != nil { - return "", "", err - } - faviconURL = article.MetaFavicon - ogpImageURL = article.TopImage - return faviconURL, ogpImageURL, nil -} - -func getPlatformDatas() []domain.PlatformFirestore { - deletedAt := int(time.Now().Unix()) - return []domain.PlatformFirestore{ - { - Name: "Qiita", - CategoryName: "trend", - RssURL: "https://qiita.com/popular-items/feed.atom", - SiteURL: "https://qiita.com/", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "all", - RssURL: "https://zenn.dev/feed", - SiteURL: "https://zenn.dev/", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "はてなブックマーク", - CategoryName: "technology", - RssURL: "https://b.hatena.ne.jp/hotentry/it.rss", - SiteURL: "https://b.hatena.ne.jp/hotentry/it", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "dev.to", - CategoryName: "all", - RssURL: "https://dev.to/feed", - SiteURL: "https://dev.to/", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "A List Apart", - CategoryName: "", - RssURL: "https://alistapart.com/main/feed/", - SiteURL: "https://alistapart.com/", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "David Walsh Blog", - CategoryName: "", - RssURL: "https://davidwalsh.name/feed/atom", - SiteURL: "https://davidwalsh.name/", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "JavaScript Playground", - CategoryName: "", - RssURL: "https://www.jackfranklin.co.uk/feed.xml", - SiteURL: "https://www.jackfranklin.co.uk/blog/", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Stack Overflow", - CategoryName: "", - RssURL: "https://stackoverflow.com/feeds", - SiteURL: "https://stackoverflow.com/", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - DeletedAt: &deletedAt, - }, - { - Name: "free code camp", - CategoryName: "all", - RssURL: "https://www.freecodecamp.org/news/rss/", - SiteURL: "https://www.freecodecamp.org/news/", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Developer.io", - CategoryName: "", - RssURL: "https://dev.classmethod.jp/feed/", - SiteURL: "https://dev.classmethod.jp/", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "google japan", - CategoryName: "", - RssURL: "https://developers-jp.googleblog.com/atom.xml", - SiteURL: "https://developers-jp.googleblog.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "楽天 ラクマ事業部", - CategoryName: "", - RssURL: "https://www.wantedly.com/stories/s/rakuma/rss.xml", - SiteURL: "https://www.wantedly.com/stories/s/rakuma", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "CyberAgent", - CategoryName: "", - RssURL: "https://developers.cyberagent.co.jp/blog/feed/", - SiteURL: "https://developers.cyberagent.co.jp/blog/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "paypay", - CategoryName: "", - RssURL: "https://blog.paypay.ne.jp/category/engineering/feed/", - SiteURL: "https://blog.paypay.ne.jp/category/engineering/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "メルカリ", - CategoryName: "", - RssURL: "https://engineering.mercari.com/blog/feed.xml", - SiteURL: "https://engineering.mercari.com/blog/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "NTT", - CategoryName: "", - RssURL: "https://engineers.ntt.com/feed", - SiteURL: "https://engineers.ntt.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "Qiita (企業)", - CategoryName: "", - RssURL: "https://blog.qiita.com/feed/", - SiteURL: "https://blog.qiita.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "Cybozu", - CategoryName: "", - RssURL: "https://blog.cybozu.io/feed", - SiteURL: "https://blog.cybozu.io/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "mixi", - CategoryName: "", - RssURL: "https://mixi-developers.mixi.co.jp/feed", - SiteURL: "https://mixi-developers.mixi.co.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "GREE", - CategoryName: "", - RssURL: "https://labs.gree.jp/blog/feed/", - SiteURL: "https://labs.gree.jp/blog/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "ZOZO", - CategoryName: "", - RssURL: "https://techblog.zozo.com/rss", - SiteURL: "https://techblog.zozo.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "DeNA", - CategoryName: "", - RssURL: "https://engineering.dena.com/index.xml", - SiteURL: "https://engineering.dena.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "リクルートテクノロジーズ", - CategoryName: "", - RssURL: "https://blog.recruit.co.jp/rtc/feed/", - SiteURL: "https://blog.recruit.co.jp/rtc/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "dwango on GitHub", - CategoryName: "", - RssURL: "https://dwango.github.io/index.xml", - SiteURL: "https://dwango.github.io/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "SanSan", - CategoryName: "", - RssURL: "https://buildersbox.corp-sansan.com/rss", - SiteURL: "https://buildersbox.corp-sansan.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "HRBrain", - CategoryName: "", - RssURL: "https://times.hrbrain.co.jp/rss", - SiteURL: "https://times.hrbrain.co.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "Lineヤフー", - CategoryName: "", - RssURL: "https://techblog.lycorp.co.jp/ja/feed/index.xml", - SiteURL: "https://techblog.lycorp.co.jp/ja", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "Sony Music", - CategoryName: "", - RssURL: "https://tech.sme.co.jp/rss", - SiteURL: "https://tech.sme.co.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "IBM", - CategoryName: "", - RssURL: "https://www.ibm.com/blogs/solutions/jp-ja/feed/atom/", - SiteURL: "https://www.ibm.com/blogs/solutions/jp-ja/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "カミナシ", - CategoryName: "", - RssURL: "https://kaminashi-developer.hatenablog.jp/rss", - SiteURL: "https://kaminashi-developer.hatenablog.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "ANDPAD", - CategoryName: "", - RssURL: "https://tech.andpad.co.jp/rss", - SiteURL: "https://tech.andpad.co.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "gaudiy", - CategoryName: "", - RssURL: "https://techblog.gaudiy.com/rss", - SiteURL: "https://techblog.gaudiy.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "aws amazon web services", - CategoryName: "", - RssURL: "https://aws.amazon.com/jp/blogs/news/feed/", - SiteURL: "https://aws.amazon.com/jp/blogs/news/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "aws startup", - CategoryName: "", - RssURL: "https://aws.amazon.com/jp/blogs/startup/feed/", - SiteURL: "https://aws.amazon.com/jp/blogs/startup/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "LayerX", - CategoryName: "", - RssURL: "https://tech.layerx.co.jp/rss", - SiteURL: "https://tech.layerx.co.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "UPSIDER", - CategoryName: "", - RssURL: "https://tech.up-sider.com/rss", - SiteURL: "https://tech.up-sider.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "CADDI", - CategoryName: "", - RssURL: "https://caddi.tech/rss", - SiteURL: "https://caddi.tech/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "UZABASE", - CategoryName: "", - RssURL: "https://tech.uzabase.com/rss/category/Blog", - SiteURL: "https://tech.uzabase.com/archive/category/Blog", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "BASE", - CategoryName: "", - RssURL: "https://devblog.thebase.in/rss", - SiteURL: "https://devblog.thebase.in/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "タイミー", - CategoryName: "", - RssURL: "https://tech.timee.co.jp/rss", - SiteURL: "https://tech.timee.co.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "はてな開発者ブログ", - CategoryName: "", - RssURL: "https://developer.hatenastaff.com/rss", - SiteURL: "https://developer.hatenastaff.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "Money Forward", - CategoryName: "", - RssURL: "https://moneyforward-dev.jp/rss", - SiteURL: "https://moneyforward-dev.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "pixiv", - CategoryName: "", - RssURL: "https://inside.pixiv.blog/rss", - SiteURL: "https://inside.pixiv.blog/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "speee", - CategoryName: "", - RssURL: "https://tech.speee.jp/rss", - SiteURL: "https://tech.speee.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "Gunosy", - CategoryName: "", - RssURL: "https://tech.gunosy.io/rss", - SiteURL: "https://tech.gunosy.io/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "クックパッド", - CategoryName: "", - RssURL: "https://techlife.cookpad.com/rss", - SiteURL: "https://techlife.cookpad.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "wantedly", - CategoryName: "", - RssURL: "https://www.wantedly.com/stories/s/wantedly_engineers/rss.xml", - SiteURL: "https://www.wantedly.com/stories/s/wantedly_engineers", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "ABEJA", - CategoryName: "", - RssURL: "https://tech-blog.abeja.asia/rss", - SiteURL: "https://tech-blog.abeja.asia/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "AppBrew", - CategoryName: "", - RssURL: "https://tech.appbrew.io/rss", - SiteURL: "https://tech.appbrew.io/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "エウレカ", - CategoryName: "", - RssURL: "https://medium.com/feed/eureka-engineering", - SiteURL: "https://medium.com/eureka-engineering", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "Airbnb", - CategoryName: "", - RssURL: "https://medium.com/feed/airbnb-engineering", - SiteURL: "https://medium.com/airbnb-engineering", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "Atlassian", - CategoryName: "", - RssURL: "https://blog.developer.atlassian.com/feed/", - SiteURL: "https://blog.developer.atlassian.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "Docker", - CategoryName: "", - RssURL: "https://www.docker.com/feed/", - SiteURL: "https://www.docker.com/blog/", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "Facebook", - CategoryName: "", - RssURL: "https://engineering.fb.com/feed/", - SiteURL: "https://engineering.fb.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "GitHub", - CategoryName: "", - RssURL: "https://github.blog/category/engineering/feed/", - SiteURL: "https://github.blog/category/engineering/", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "Google", - CategoryName: "", - RssURL: "https://www.blogger.com/feeds/596098824972435195/posts/default", - SiteURL: "https://developers.googleblog.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "Instagram", - CategoryName: "", - RssURL: "https://instagram-engineering.com/feed", - SiteURL: "https://instagram-engineering.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "Netflix", - CategoryName: "", - RssURL: "https://netflixtechblog.com/feed", - SiteURL: "https://netflixtechblog.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "PayPal", - CategoryName: "", - RssURL: "https://medium.com/feed/paypal-tech", - SiteURL: "https://medium.com/paypal-tech", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "Salesforce", - CategoryName: "", - RssURL: "https://engineering.salesforce.com/feed/", - SiteURL: "https://engineering.salesforce.com/", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "Zoom", - CategoryName: "", - RssURL: "https://medium.com/feed/zoom-developer-blog", - SiteURL: "https://medium.com/zoom-developer-blog", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "Asana", - CategoryName: "", - RssURL: "https://blog.asana.com/category/eng/feed/", - SiteURL: "https://blog.asana.com/category/eng/", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "mercari", - CategoryName: "", - RssURL: "https://engineering.mercari.com/en/blog/feed.xml", - SiteURL: "https://engineering.mercari.com/en/blog/", - PlatformType: domain.PlatformTypeCompany, - IsEng: true, - }, - { - Name: "ROUTE 06", - CategoryName: "", - RssURL: "https://tech.route06.co.jp/feed", - SiteURL: "https://tech.route06.co.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "スタディサプリ", - CategoryName: "", - RssURL: "https://blog.studysapuri.jp/rss", - SiteURL: "https://blog.studysapuri.jp/", - PlatformType: domain.PlatformTypeCompany, - IsEng: false, - }, - { - Name: "Menthas", - CategoryName: "all", - RssURL: "https://menthas.com/all/rss", - SiteURL: "https://menthas.com/", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Menthas", - CategoryName: "programming", - RssURL: "https://menthas.com/programming/rss", - SiteURL: "https://menthas.com/programming", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Menthas", - CategoryName: "javascript", - RssURL: "https://menthas.com/javascript/rss", - SiteURL: "https://menthas.com/javascript", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Menthas", - CategoryName: "infrastructure", - RssURL: "https://menthas.com/infrastructure/rss", - SiteURL: "https://menthas.com/infrastructure", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "React", - RssURL: "https://zenn.dev/topics/react/feed", - SiteURL: "https://zenn.dev/topics/react", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "Next.js", - RssURL: "https://zenn.dev/topics/nextjs/feed", - SiteURL: "https://zenn.dev/topics/nextjs", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "React Native", - RssURL: "https://zenn.dev/topics/reactnative/feed", - SiteURL: "https://zenn.dev/topics/reactnative", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "JavaScript", - RssURL: "https://zenn.dev/topics/javascript/feed", - SiteURL: "https://zenn.dev/topics/javascript", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "TypeScript", - RssURL: "https://zenn.dev/topics/typescript/feed", - SiteURL: "https://zenn.dev/topics/typescript", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "Node.js", - RssURL: "https://zenn.dev/topics/nodejs/feed", - SiteURL: "https://zenn.dev/topics/nodejs", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "Golang", - RssURL: "https://zenn.dev/topics/go/feed", - SiteURL: "https://zenn.dev/topics/go", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "AWS", - RssURL: "https://zenn.dev/topics/aws/feed", - SiteURL: "https://zenn.dev/topics/aws", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "GCP", - RssURL: "https://zenn.dev/topics/gcp/feed", - SiteURL: "https://zenn.dev/topics/gcp", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "Docker", - RssURL: "https://zenn.dev/topics/docker/feed", - SiteURL: "https://zenn.dev/topics/docker", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "GraphQL", - RssURL: "https://zenn.dev/topics/graphql/feed", - SiteURL: "https://zenn.dev/topics/graphql", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "GitHub", - RssURL: "https://zenn.dev/topics/github/feed", - SiteURL: "https://zenn.dev/topics/github", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "GitHub Actions", - RssURL: "https://zenn.dev/topics/githubactions/feed", - SiteURL: "https://zenn.dev/topics/githubactions", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "ChatGPT", - RssURL: "https://zenn.dev/topics/chatgpt/feed", - SiteURL: "https://zenn.dev/topics/chatgpt", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "個人開発", - RssURL: "https://zenn.dev/topics/個人開発/feed", - SiteURL: "https://zenn.dev/topics/個人開発", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "frontend", - RssURL: "https://zenn.dev/topics/frontend/feed", - SiteURL: "https://zenn.dev/topics/frontend", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Zenn", - CategoryName: "Test", - RssURL: "https://zenn.dev/topics/test/feed", - SiteURL: "https://zenn.dev/topics/test", - PlatformType: domain.PlatformTypeSite, - IsEng: false, - }, - { - Name: "Hashnode", - CategoryName: "React", - RssURL: "https://hashnode.com/n/reactjs/rss", - SiteURL: "https://hashnode.com/n/reactjs", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "Next.js", - RssURL: "https://hashnode.com/n/nextjs/rss", - SiteURL: "https://hashnode.com/n/nextjs", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "React Native", - RssURL: "https://hashnode.com/n/react-native/rss", - SiteURL: "https://hashnode.com/n/react-native", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "Expo", - RssURL: "https://hashnode.com/n/expo/rss", - SiteURL: "https://hashnode.com/n/expo", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "Node.js", - RssURL: "https://hashnode.com/n/nodejs/rss", - SiteURL: "https://hashnode.com/n/nodejs", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "TypeScript", - RssURL: "https://hashnode.com/n/typescript/rss", - SiteURL: "https://hashnode.com/n/typescript", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "Golang", - RssURL: "https://hashnode.com/n/go/rss", - SiteURL: "https://hashnode.com/n/go", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - - { - Name: "Hashnode", - CategoryName: "AWS", - RssURL: "https://hashnode.com/n/aws/rss", - SiteURL: "https://hashnode.com/n/aws", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "GCP", - RssURL: "https://hashnode.com/n/gcp/rss", - SiteURL: "https://hashnode.com/n/gcp", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "Docker", - RssURL: "https://hashnode.com/n/docker/rss", - SiteURL: "https://hashnode.com/n/docker", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "Testing", - RssURL: "https://hashnode.com/n/testing/rss", - SiteURL: "https://hashnode.com/n/testing", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "GraphQL", - RssURL: "https://hashnode.com/n/graphql/rss", - SiteURL: "https://hashnode.com/n/graphql", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "Frontend Development", - RssURL: "https://hashnode.com/n/frontend-development/rss", - SiteURL: "https://hashnode.com/n/frontend-development", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "Web Development", - RssURL: "https://hashnode.com/n/web-development/rss", - SiteURL: "https://hashnode.com/n/web-development", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "chatgpt", - RssURL: "https://hashnode.com/n/chatgpt/rss", - SiteURL: "https://hashnode.com/n/chatgpt", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "Developer", - RssURL: "https://hashnode.com/n/developer/rss", - SiteURL: "https://hashnode.com/n/developer", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - { - Name: "Hashnode", - CategoryName: "Devops", - RssURL: "https://hashnode.com/n/devops/rss", - SiteURL: "https://hashnode.com/n/devops", - PlatformType: domain.PlatformTypeSite, - IsEng: true, - }, - } -} diff --git a/batch-service/database/sqlboiler.toml b/batch-service/database/sqlboiler.toml new file mode 100644 index 00000000..5913d3a3 --- /dev/null +++ b/batch-service/database/sqlboiler.toml @@ -0,0 +1,9 @@ +[psql] +dbname = "postgres" +host = "localhost" +port = 54322 +user = "postgres" +pass = "postgres" +sslmode = "disable" +schema = "public" +blacklist = ["migrations", "other"] \ No newline at end of file diff --git a/batch-service/domain/article.go b/batch-service/domain/article.go index 866d1dea..6253f7d8 100644 --- a/batch-service/domain/article.go +++ b/batch-service/domain/article.go @@ -1,27 +1,44 @@ package domain +import "time" + type Article struct { ID string Title string Description string ThumbnailURL string ArticleURL string - PublishedAt int - Platform ArticlePlatform - IsEng bool + PublishedAt time.Time IsPrivate bool - CreatedAt int - UpdatedAt int - DeletedAt *int + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time +} + +type GetArticlesInputDTO struct { + Title *string + ArticleURL *string + StartedAt *time.Time + EndedAt *time.Time +} + +type CreateArticleInputDTO struct { + Title string + Description string + ThumbnailURL string + ArticleURL string + PublishedAt time.Time + IsPrivate *bool } -type ArticlePlatform struct { - ID string - Name string - PlatformCategoryName string - PlatformType PlatformType - SiteURL string - FaviconURL string +type UpdateArticleInputDTO struct { + ID string + Title string + Description string + ThumbnailURL string + ArticleURL string + PublishedAt time.Time + IsPrivate *bool } type ArticleFirestore struct { diff --git a/batch-service/domain/category.go b/batch-service/domain/category.go new file mode 100644 index 00000000..1f6efa45 --- /dev/null +++ b/batch-service/domain/category.go @@ -0,0 +1,47 @@ +package domain + +import ( + "time" +) + +type CategoryType int + +const ( + CategoryTypeAll CategoryType = iota + CategoryTypeTrend + CategoryTypeLanguage + CategoryTypeFrontend + CategoryTypeBackend + CategoryTypeMobile + CategoryTypeCloud + CategoryTypeLibrary + CategoryTypeTool + CategoryTypeDatabase + CategoryTypeInfrastructure + CategoryTypeMachineLearning + CategoryTypeSecurity + CategoryTypeNetwork + CategoryTypeDevOps + CategoryTypeDesign + CategoryTypeOthers +) + +type Category struct { + ID string + Name string + Type CategoryType + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time +} + +type CreateCategoryInputDTO struct { + Name string `json:"name"` + Type int `json:"type"` +} + +type UpdateCategoryInputDTO struct { + ID string `json:"id"` + Name string `json:"name"` + Type int `json:"type"` +} diff --git a/batch-service/domain/feed.go b/batch-service/domain/feed.go new file mode 100644 index 00000000..bb729491 --- /dev/null +++ b/batch-service/domain/feed.go @@ -0,0 +1,29 @@ +package domain + +import "time" + +type Feed struct { + ID string + Name string + RssURL string + Platform Platform + Category Category + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time +} + +type CreateFeedInputDTO struct { + Name string `json:"name"` + RssURL string `json:"rss_url"` + PlatformID string `json:"platform_id"` + CategoryID string `json:"category_id"` +} + +type UpdateFeedInputDTO struct { + ID string `json:"id"` + Name string `json:"name"` + RssURL string `json:"rss_url"` + PlatformID string `json:"platform_id"` + CategoryID string `json:"category_id"` +} diff --git a/batch-service/domain/feed_article_relations.go b/batch-service/domain/feed_article_relations.go new file mode 100644 index 00000000..c3a9b6ae --- /dev/null +++ b/batch-service/domain/feed_article_relations.go @@ -0,0 +1,27 @@ +package domain + +import "time" + +type FeedArticleRelation struct { + ID string + Feed Feed + Article Article + CreatedAt time.Time + UpdatedAt time.Time +} + +type GetFeedArticleRelationsInputDTO struct { + FeedID *string + ArticleID *string +} + +type CreateFeedArticleRelationInputDTO struct { + FeedID string + ArticleID string +} + +type UpdateFeedArticleRelationInputDTO struct { + ID string + FeedID string + ArticleID string +} diff --git a/batch-service/domain/platform.go b/batch-service/domain/platform.go index 8a0b6c61..70be8523 100644 --- a/batch-service/domain/platform.go +++ b/batch-service/domain/platform.go @@ -1,25 +1,27 @@ package domain +import ( + "time" +) + type PlatformType int const ( PlatformTypeSite PlatformType = iota PlatformTypeCompany + PlatformTypeSummary ) type Platform struct { - ID string - Name string - CategoryName string - RssURL string - SiteURL string - PlatformType PlatformType - IsEng bool - ThumbnailImageURL string - FaviconURL string - CreatedAt int - UpdatedAt int - DeletedAt *int + ID string + Name string + SiteURL string + PlatformType PlatformType + IsEng bool + FaviconURL string + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt *time.Time } type PlatformFirestore struct { diff --git a/batch-service/entity/articles.go b/batch-service/entity/articles.go new file mode 100644 index 00000000..dfed21a1 --- /dev/null +++ b/batch-service/entity/articles.go @@ -0,0 +1,1249 @@ +// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package entity + +import ( + "context" + "database/sql" + "fmt" + "reflect" + "strconv" + "strings" + "sync" + "time" + + "github.com/friendsofgo/errors" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" + "github.com/volatiletech/sqlboiler/v4/queries/qmhelper" + "github.com/volatiletech/strmangle" +) + +// Article is an object representing the database table. +type Article struct { + ID string `boil:"id" json:"id" toml:"id" yaml:"id"` + Title string `boil:"title" json:"title" toml:"title" yaml:"title"` + Description string `boil:"description" json:"description" toml:"description" yaml:"description"` + ArticleURL string `boil:"article_url" json:"article_url" toml:"article_url" yaml:"article_url"` + PublishedAt time.Time `boil:"published_at" json:"published_at" toml:"published_at" yaml:"published_at"` + ThumbnailURL string `boil:"thumbnail_url" json:"thumbnail_url" toml:"thumbnail_url" yaml:"thumbnail_url"` + IsPrivate bool `boil:"is_private" json:"is_private" toml:"is_private" yaml:"is_private"` + CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` + UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` + + R *articleR `boil:"-" json:"-" toml:"-" yaml:"-"` + L articleL `boil:"-" json:"-" toml:"-" yaml:"-"` +} + +var ArticleColumns = struct { + ID string + Title string + Description string + ArticleURL string + PublishedAt string + ThumbnailURL string + IsPrivate string + CreatedAt string + UpdatedAt string +}{ + ID: "id", + Title: "title", + Description: "description", + ArticleURL: "article_url", + PublishedAt: "published_at", + ThumbnailURL: "thumbnail_url", + IsPrivate: "is_private", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +var ArticleTableColumns = struct { + ID string + Title string + Description string + ArticleURL string + PublishedAt string + ThumbnailURL string + IsPrivate string + CreatedAt string + UpdatedAt string +}{ + ID: "articles.id", + Title: "articles.title", + Description: "articles.description", + ArticleURL: "articles.article_url", + PublishedAt: "articles.published_at", + ThumbnailURL: "articles.thumbnail_url", + IsPrivate: "articles.is_private", + CreatedAt: "articles.created_at", + UpdatedAt: "articles.updated_at", +} + +// Generated where + +type whereHelperstring struct{ field string } + +func (w whereHelperstring) EQ(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.EQ, x) } +func (w whereHelperstring) NEQ(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) } +func (w whereHelperstring) LT(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LT, x) } +func (w whereHelperstring) LTE(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) } +func (w whereHelperstring) GT(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GT, x) } +func (w whereHelperstring) GTE(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) } +func (w whereHelperstring) LIKE(x string) qm.QueryMod { return qm.Where(w.field+" LIKE ?", x) } +func (w whereHelperstring) NLIKE(x string) qm.QueryMod { return qm.Where(w.field+" NOT LIKE ?", x) } +func (w whereHelperstring) ILIKE(x string) qm.QueryMod { return qm.Where(w.field+" ILIKE ?", x) } +func (w whereHelperstring) NILIKE(x string) qm.QueryMod { return qm.Where(w.field+" NOT ILIKE ?", x) } +func (w whereHelperstring) IN(slice []string) qm.QueryMod { + values := make([]interface{}, 0, len(slice)) + for _, value := range slice { + values = append(values, value) + } + return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...) +} +func (w whereHelperstring) NIN(slice []string) qm.QueryMod { + values := make([]interface{}, 0, len(slice)) + for _, value := range slice { + values = append(values, value) + } + return qm.WhereNotIn(fmt.Sprintf("%s NOT IN ?", w.field), values...) +} + +type whereHelpertime_Time struct{ field string } + +func (w whereHelpertime_Time) EQ(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.EQ, x) +} +func (w whereHelpertime_Time) NEQ(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.NEQ, x) +} +func (w whereHelpertime_Time) LT(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.LT, x) +} +func (w whereHelpertime_Time) LTE(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.LTE, x) +} +func (w whereHelpertime_Time) GT(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.GT, x) +} +func (w whereHelpertime_Time) GTE(x time.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.GTE, x) +} + +type whereHelperbool struct{ field string } + +func (w whereHelperbool) EQ(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.EQ, x) } +func (w whereHelperbool) NEQ(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) } +func (w whereHelperbool) LT(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LT, x) } +func (w whereHelperbool) LTE(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) } +func (w whereHelperbool) GT(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GT, x) } +func (w whereHelperbool) GTE(x bool) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) } + +var ArticleWhere = struct { + ID whereHelperstring + Title whereHelperstring + Description whereHelperstring + ArticleURL whereHelperstring + PublishedAt whereHelpertime_Time + ThumbnailURL whereHelperstring + IsPrivate whereHelperbool + CreatedAt whereHelpertime_Time + UpdatedAt whereHelpertime_Time +}{ + ID: whereHelperstring{field: "\"articles\".\"id\""}, + Title: whereHelperstring{field: "\"articles\".\"title\""}, + Description: whereHelperstring{field: "\"articles\".\"description\""}, + ArticleURL: whereHelperstring{field: "\"articles\".\"article_url\""}, + PublishedAt: whereHelpertime_Time{field: "\"articles\".\"published_at\""}, + ThumbnailURL: whereHelperstring{field: "\"articles\".\"thumbnail_url\""}, + IsPrivate: whereHelperbool{field: "\"articles\".\"is_private\""}, + CreatedAt: whereHelpertime_Time{field: "\"articles\".\"created_at\""}, + UpdatedAt: whereHelpertime_Time{field: "\"articles\".\"updated_at\""}, +} + +// ArticleRels is where relationship names are stored. +var ArticleRels = struct { + FeedArticleRelations string +}{ + FeedArticleRelations: "FeedArticleRelations", +} + +// articleR is where relationships are stored. +type articleR struct { + FeedArticleRelations FeedArticleRelationSlice `boil:"FeedArticleRelations" json:"FeedArticleRelations" toml:"FeedArticleRelations" yaml:"FeedArticleRelations"` +} + +// NewStruct creates a new relationship struct +func (*articleR) NewStruct() *articleR { + return &articleR{} +} + +func (r *articleR) GetFeedArticleRelations() FeedArticleRelationSlice { + if r == nil { + return nil + } + return r.FeedArticleRelations +} + +// articleL is where Load methods for each relationship are stored. +type articleL struct{} + +var ( + articleAllColumns = []string{"id", "title", "description", "article_url", "published_at", "thumbnail_url", "is_private", "created_at", "updated_at"} + articleColumnsWithoutDefault = []string{"title", "description", "article_url", "published_at", "thumbnail_url"} + articleColumnsWithDefault = []string{"id", "is_private", "created_at", "updated_at"} + articlePrimaryKeyColumns = []string{"id"} + articleGeneratedColumns = []string{} +) + +type ( + // ArticleSlice is an alias for a slice of pointers to Article. + // This should almost always be used instead of []Article. + ArticleSlice []*Article + // ArticleHook is the signature for custom Article hook methods + ArticleHook func(context.Context, boil.ContextExecutor, *Article) error + + articleQuery struct { + *queries.Query + } +) + +// Cache for insert, update and upsert +var ( + articleType = reflect.TypeOf(&Article{}) + articleMapping = queries.MakeStructMapping(articleType) + articlePrimaryKeyMapping, _ = queries.BindMapping(articleType, articleMapping, articlePrimaryKeyColumns) + articleInsertCacheMut sync.RWMutex + articleInsertCache = make(map[string]insertCache) + articleUpdateCacheMut sync.RWMutex + articleUpdateCache = make(map[string]updateCache) + articleUpsertCacheMut sync.RWMutex + articleUpsertCache = make(map[string]insertCache) +) + +var ( + // Force time package dependency for automated UpdatedAt/CreatedAt. + _ = time.Second + // Force qmhelper dependency for where clause generation (which doesn't + // always happen) + _ = qmhelper.Where +) + +var articleAfterSelectMu sync.Mutex +var articleAfterSelectHooks []ArticleHook + +var articleBeforeInsertMu sync.Mutex +var articleBeforeInsertHooks []ArticleHook +var articleAfterInsertMu sync.Mutex +var articleAfterInsertHooks []ArticleHook + +var articleBeforeUpdateMu sync.Mutex +var articleBeforeUpdateHooks []ArticleHook +var articleAfterUpdateMu sync.Mutex +var articleAfterUpdateHooks []ArticleHook + +var articleBeforeDeleteMu sync.Mutex +var articleBeforeDeleteHooks []ArticleHook +var articleAfterDeleteMu sync.Mutex +var articleAfterDeleteHooks []ArticleHook + +var articleBeforeUpsertMu sync.Mutex +var articleBeforeUpsertHooks []ArticleHook +var articleAfterUpsertMu sync.Mutex +var articleAfterUpsertHooks []ArticleHook + +// doAfterSelectHooks executes all "after Select" hooks. +func (o *Article) doAfterSelectHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range articleAfterSelectHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeInsertHooks executes all "before insert" hooks. +func (o *Article) doBeforeInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range articleBeforeInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterInsertHooks executes all "after Insert" hooks. +func (o *Article) doAfterInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range articleAfterInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpdateHooks executes all "before Update" hooks. +func (o *Article) doBeforeUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range articleBeforeUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpdateHooks executes all "after Update" hooks. +func (o *Article) doAfterUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range articleAfterUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeDeleteHooks executes all "before Delete" hooks. +func (o *Article) doBeforeDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range articleBeforeDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterDeleteHooks executes all "after Delete" hooks. +func (o *Article) doAfterDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range articleAfterDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpsertHooks executes all "before Upsert" hooks. +func (o *Article) doBeforeUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range articleBeforeUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpsertHooks executes all "after Upsert" hooks. +func (o *Article) doAfterUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range articleAfterUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// AddArticleHook registers your hook function for all future operations. +func AddArticleHook(hookPoint boil.HookPoint, articleHook ArticleHook) { + switch hookPoint { + case boil.AfterSelectHook: + articleAfterSelectMu.Lock() + articleAfterSelectHooks = append(articleAfterSelectHooks, articleHook) + articleAfterSelectMu.Unlock() + case boil.BeforeInsertHook: + articleBeforeInsertMu.Lock() + articleBeforeInsertHooks = append(articleBeforeInsertHooks, articleHook) + articleBeforeInsertMu.Unlock() + case boil.AfterInsertHook: + articleAfterInsertMu.Lock() + articleAfterInsertHooks = append(articleAfterInsertHooks, articleHook) + articleAfterInsertMu.Unlock() + case boil.BeforeUpdateHook: + articleBeforeUpdateMu.Lock() + articleBeforeUpdateHooks = append(articleBeforeUpdateHooks, articleHook) + articleBeforeUpdateMu.Unlock() + case boil.AfterUpdateHook: + articleAfterUpdateMu.Lock() + articleAfterUpdateHooks = append(articleAfterUpdateHooks, articleHook) + articleAfterUpdateMu.Unlock() + case boil.BeforeDeleteHook: + articleBeforeDeleteMu.Lock() + articleBeforeDeleteHooks = append(articleBeforeDeleteHooks, articleHook) + articleBeforeDeleteMu.Unlock() + case boil.AfterDeleteHook: + articleAfterDeleteMu.Lock() + articleAfterDeleteHooks = append(articleAfterDeleteHooks, articleHook) + articleAfterDeleteMu.Unlock() + case boil.BeforeUpsertHook: + articleBeforeUpsertMu.Lock() + articleBeforeUpsertHooks = append(articleBeforeUpsertHooks, articleHook) + articleBeforeUpsertMu.Unlock() + case boil.AfterUpsertHook: + articleAfterUpsertMu.Lock() + articleAfterUpsertHooks = append(articleAfterUpsertHooks, articleHook) + articleAfterUpsertMu.Unlock() + } +} + +// One returns a single article record from the query. +func (q articleQuery) One(ctx context.Context, exec boil.ContextExecutor) (*Article, error) { + o := &Article{} + + queries.SetLimit(q.Query, 1) + + err := q.Bind(ctx, exec, o) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "entity: failed to execute a one query for articles") + } + + if err := o.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + + return o, nil +} + +// All returns all Article records from the query. +func (q articleQuery) All(ctx context.Context, exec boil.ContextExecutor) (ArticleSlice, error) { + var o []*Article + + err := q.Bind(ctx, exec, &o) + if err != nil { + return nil, errors.Wrap(err, "entity: failed to assign all query results to Article slice") + } + + if len(articleAfterSelectHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + } + } + + return o, nil +} + +// Count returns the count of all Article records in the query. +func (q articleQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return 0, errors.Wrap(err, "entity: failed to count articles rows") + } + + return count, nil +} + +// Exists checks if the row exists in the table. +func (q articleQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + queries.SetLimit(q.Query, 1) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return false, errors.Wrap(err, "entity: failed to check if articles exists") + } + + return count > 0, nil +} + +// FeedArticleRelations retrieves all the feed_article_relation's FeedArticleRelations with an executor. +func (o *Article) FeedArticleRelations(mods ...qm.QueryMod) feedArticleRelationQuery { + var queryMods []qm.QueryMod + if len(mods) != 0 { + queryMods = append(queryMods, mods...) + } + + queryMods = append(queryMods, + qm.Where("\"feed_article_relations\".\"article_id\"=?", o.ID), + ) + + return FeedArticleRelations(queryMods...) +} + +// LoadFeedArticleRelations allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for a 1-M or N-M relationship. +func (articleL) LoadFeedArticleRelations(ctx context.Context, e boil.ContextExecutor, singular bool, maybeArticle interface{}, mods queries.Applicator) error { + var slice []*Article + var object *Article + + if singular { + var ok bool + object, ok = maybeArticle.(*Article) + if !ok { + object = new(Article) + ok = queries.SetFromEmbeddedStruct(&object, &maybeArticle) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeArticle)) + } + } + } else { + s, ok := maybeArticle.(*[]*Article) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeArticle) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeArticle)) + } + } + } + + args := make(map[interface{}]struct{}) + if singular { + if object.R == nil { + object.R = &articleR{} + } + args[object.ID] = struct{}{} + } else { + for _, obj := range slice { + if obj.R == nil { + obj.R = &articleR{} + } + args[obj.ID] = struct{}{} + } + } + + if len(args) == 0 { + return nil + } + + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + + query := NewQuery( + qm.From(`feed_article_relations`), + qm.WhereIn(`feed_article_relations.article_id in ?`, argsSlice...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load feed_article_relations") + } + + var resultSlice []*FeedArticleRelation + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice feed_article_relations") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results in eager load on feed_article_relations") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for feed_article_relations") + } + + if len(feedArticleRelationAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + if singular { + object.R.FeedArticleRelations = resultSlice + for _, foreign := range resultSlice { + if foreign.R == nil { + foreign.R = &feedArticleRelationR{} + } + foreign.R.Article = object + } + return nil + } + + for _, foreign := range resultSlice { + for _, local := range slice { + if local.ID == foreign.ArticleID { + local.R.FeedArticleRelations = append(local.R.FeedArticleRelations, foreign) + if foreign.R == nil { + foreign.R = &feedArticleRelationR{} + } + foreign.R.Article = local + break + } + } + } + + return nil +} + +// AddFeedArticleRelations adds the given related objects to the existing relationships +// of the article, optionally inserting them as new records. +// Appends related to o.R.FeedArticleRelations. +// Sets related.R.Article appropriately. +func (o *Article) AddFeedArticleRelations(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*FeedArticleRelation) error { + var err error + for _, rel := range related { + if insert { + rel.ArticleID = o.ID + if err = rel.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } else { + updateQuery := fmt.Sprintf( + "UPDATE \"feed_article_relations\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, []string{"article_id"}), + strmangle.WhereClause("\"", "\"", 2, feedArticleRelationPrimaryKeyColumns), + ) + values := []interface{}{o.ID, rel.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update foreign table") + } + + rel.ArticleID = o.ID + } + } + + if o.R == nil { + o.R = &articleR{ + FeedArticleRelations: related, + } + } else { + o.R.FeedArticleRelations = append(o.R.FeedArticleRelations, related...) + } + + for _, rel := range related { + if rel.R == nil { + rel.R = &feedArticleRelationR{ + Article: o, + } + } else { + rel.R.Article = o + } + } + return nil +} + +// Articles retrieves all the records using an executor. +func Articles(mods ...qm.QueryMod) articleQuery { + mods = append(mods, qm.From("\"articles\"")) + q := NewQuery(mods...) + if len(queries.GetSelect(q)) == 0 { + queries.SetSelect(q, []string{"\"articles\".*"}) + } + + return articleQuery{q} +} + +// FindArticle retrieves a single record by ID with an executor. +// If selectCols is empty Find will return all columns. +func FindArticle(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Article, error) { + articleObj := &Article{} + + sel := "*" + if len(selectCols) > 0 { + sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",") + } + query := fmt.Sprintf( + "select %s from \"articles\" where \"id\"=$1", sel, + ) + + q := queries.Raw(query, iD) + + err := q.Bind(ctx, exec, articleObj) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "entity: unable to select from articles") + } + + if err = articleObj.doAfterSelectHooks(ctx, exec); err != nil { + return articleObj, err + } + + return articleObj, nil +} + +// Insert a single record using an executor. +// See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts. +func (o *Article) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error { + if o == nil { + return errors.New("entity: no articles provided for insertion") + } + + var err error + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + if o.UpdatedAt.IsZero() { + o.UpdatedAt = currTime + } + } + + if err := o.doBeforeInsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(articleColumnsWithDefault, o) + + key := makeCacheKey(columns, nzDefaults) + articleInsertCacheMut.RLock() + cache, cached := articleInsertCache[key] + articleInsertCacheMut.RUnlock() + + if !cached { + wl, returnColumns := columns.InsertColumnSet( + articleAllColumns, + articleColumnsWithDefault, + articleColumnsWithoutDefault, + nzDefaults, + ) + + cache.valueMapping, err = queries.BindMapping(articleType, articleMapping, wl) + if err != nil { + return err + } + cache.retMapping, err = queries.BindMapping(articleType, articleMapping, returnColumns) + if err != nil { + return err + } + if len(wl) != 0 { + cache.query = fmt.Sprintf("INSERT INTO \"articles\" (\"%s\") %%sVALUES (%s)%%s", strings.Join(wl, "\",\""), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1)) + } else { + cache.query = "INSERT INTO \"articles\" %sDEFAULT VALUES%s" + } + + var queryOutput, queryReturning string + + if len(cache.retMapping) != 0 { + queryReturning = fmt.Sprintf(" RETURNING \"%s\"", strings.Join(returnColumns, "\",\"")) + } + + cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning) + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + + if len(cache.retMapping) != 0 { + err = exec.QueryRowContext(ctx, cache.query, vals...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...) + } else { + _, err = exec.ExecContext(ctx, cache.query, vals...) + } + + if err != nil { + return errors.Wrap(err, "entity: unable to insert into articles") + } + + if !cached { + articleInsertCacheMut.Lock() + articleInsertCache[key] = cache + articleInsertCacheMut.Unlock() + } + + return o.doAfterInsertHooks(ctx, exec) +} + +// Update uses an executor to update the Article. +// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. +// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records. +func (o *Article) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) { + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + o.UpdatedAt = currTime + } + + var err error + if err = o.doBeforeUpdateHooks(ctx, exec); err != nil { + return 0, err + } + key := makeCacheKey(columns, nil) + articleUpdateCacheMut.RLock() + cache, cached := articleUpdateCache[key] + articleUpdateCacheMut.RUnlock() + + if !cached { + wl := columns.UpdateColumnSet( + articleAllColumns, + articlePrimaryKeyColumns, + ) + + if !columns.IsWhitelist() { + wl = strmangle.SetComplement(wl, []string{"created_at"}) + } + if len(wl) == 0 { + return 0, errors.New("entity: unable to update articles, could not build whitelist") + } + + cache.query = fmt.Sprintf("UPDATE \"articles\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, wl), + strmangle.WhereClause("\"", "\"", len(wl)+1, articlePrimaryKeyColumns), + ) + cache.valueMapping, err = queries.BindMapping(articleType, articleMapping, append(wl, articlePrimaryKeyColumns...)) + if err != nil { + return 0, err + } + } + + values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, values) + } + var result sql.Result + result, err = exec.ExecContext(ctx, cache.query, values...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update articles row") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by update for articles") + } + + if !cached { + articleUpdateCacheMut.Lock() + articleUpdateCache[key] = cache + articleUpdateCacheMut.Unlock() + } + + return rowsAff, o.doAfterUpdateHooks(ctx, exec) +} + +// UpdateAll updates all rows with the specified column values. +func (q articleQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + queries.SetUpdate(q.Query, cols) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update all for articles") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: unable to retrieve rows affected for articles") + } + + return rowsAff, nil +} + +// UpdateAll updates all rows with the specified column values, using an executor. +func (o ArticleSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + ln := int64(len(o)) + if ln == 0 { + return 0, nil + } + + if len(cols) == 0 { + return 0, errors.New("entity: update all requires at least one column argument") + } + + colNames := make([]string, len(cols)) + args := make([]interface{}, len(cols)) + + i := 0 + for name, value := range cols { + colNames[i] = name + args[i] = value + i++ + } + + // Append all of the primary key values for each column + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), articlePrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := fmt.Sprintf("UPDATE \"articles\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, colNames), + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, articlePrimaryKeyColumns, len(o))) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update all in article slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: unable to retrieve rows affected all in update all article") + } + return rowsAff, nil +} + +// Upsert attempts an insert using an executor, and does an update or ignore on conflict. +// See boil.Columns documentation for how to properly use updateColumns and insertColumns. +func (o *Article) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error { + if o == nil { + return errors.New("entity: no articles provided for upsert") + } + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + o.UpdatedAt = currTime + } + + if err := o.doBeforeUpsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(articleColumnsWithDefault, o) + + // Build cache key in-line uglily - mysql vs psql problems + buf := strmangle.GetBuffer() + if updateOnConflict { + buf.WriteByte('t') + } else { + buf.WriteByte('f') + } + buf.WriteByte('.') + for _, c := range conflictColumns { + buf.WriteString(c) + } + buf.WriteByte('.') + buf.WriteString(strconv.Itoa(updateColumns.Kind)) + for _, c := range updateColumns.Cols { + buf.WriteString(c) + } + buf.WriteByte('.') + buf.WriteString(strconv.Itoa(insertColumns.Kind)) + for _, c := range insertColumns.Cols { + buf.WriteString(c) + } + buf.WriteByte('.') + for _, c := range nzDefaults { + buf.WriteString(c) + } + key := buf.String() + strmangle.PutBuffer(buf) + + articleUpsertCacheMut.RLock() + cache, cached := articleUpsertCache[key] + articleUpsertCacheMut.RUnlock() + + var err error + + if !cached { + insert, _ := insertColumns.InsertColumnSet( + articleAllColumns, + articleColumnsWithDefault, + articleColumnsWithoutDefault, + nzDefaults, + ) + + update := updateColumns.UpdateColumnSet( + articleAllColumns, + articlePrimaryKeyColumns, + ) + + if updateOnConflict && len(update) == 0 { + return errors.New("entity: unable to upsert articles, could not build update column list") + } + + ret := strmangle.SetComplement(articleAllColumns, strmangle.SetIntersect(insert, update)) + + conflict := conflictColumns + if len(conflict) == 0 && updateOnConflict && len(update) != 0 { + if len(articlePrimaryKeyColumns) == 0 { + return errors.New("entity: unable to upsert articles, could not build conflict column list") + } + + conflict = make([]string, len(articlePrimaryKeyColumns)) + copy(conflict, articlePrimaryKeyColumns) + } + cache.query = buildUpsertQueryPostgres(dialect, "\"articles\"", updateOnConflict, ret, update, conflict, insert, opts...) + + cache.valueMapping, err = queries.BindMapping(articleType, articleMapping, insert) + if err != nil { + return err + } + if len(ret) != 0 { + cache.retMapping, err = queries.BindMapping(articleType, articleMapping, ret) + if err != nil { + return err + } + } + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + var returns []interface{} + if len(cache.retMapping) != 0 { + returns = queries.PtrsFromMapping(value, cache.retMapping) + } + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + if len(cache.retMapping) != 0 { + err = exec.QueryRowContext(ctx, cache.query, vals...).Scan(returns...) + if errors.Is(err, sql.ErrNoRows) { + err = nil // Postgres doesn't return anything when there's no update + } + } else { + _, err = exec.ExecContext(ctx, cache.query, vals...) + } + if err != nil { + return errors.Wrap(err, "entity: unable to upsert articles") + } + + if !cached { + articleUpsertCacheMut.Lock() + articleUpsertCache[key] = cache + articleUpsertCacheMut.Unlock() + } + + return o.doAfterUpsertHooks(ctx, exec) +} + +// Delete deletes a single Article record with an executor. +// Delete will match against the primary key column to find the record to delete. +func (o *Article) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if o == nil { + return 0, errors.New("entity: no Article provided for delete") + } + + if err := o.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), articlePrimaryKeyMapping) + sql := "DELETE FROM \"articles\" WHERE \"id\"=$1" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete from articles") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by delete for articles") + } + + if err := o.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + return rowsAff, nil +} + +// DeleteAll deletes all matching rows. +func (q articleQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if q.Query == nil { + return 0, errors.New("entity: no articleQuery provided for delete all") + } + + queries.SetDelete(q.Query) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete all from articles") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by deleteall for articles") + } + + return rowsAff, nil +} + +// DeleteAll deletes all rows in the slice, using an executor. +func (o ArticleSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if len(o) == 0 { + return 0, nil + } + + if len(articleBeforeDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + var args []interface{} + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), articlePrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "DELETE FROM \"articles\" WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, articlePrimaryKeyColumns, len(o)) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete all from article slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by deleteall for articles") + } + + if len(articleAfterDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + return rowsAff, nil +} + +// Reload refetches the object from the database +// using the primary keys with an executor. +func (o *Article) Reload(ctx context.Context, exec boil.ContextExecutor) error { + ret, err := FindArticle(ctx, exec, o.ID) + if err != nil { + return err + } + + *o = *ret + return nil +} + +// ReloadAll refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *ArticleSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error { + if o == nil || len(*o) == 0 { + return nil + } + + slice := ArticleSlice{} + var args []interface{} + for _, obj := range *o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), articlePrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "SELECT \"articles\".* FROM \"articles\" WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, articlePrimaryKeyColumns, len(*o)) + + q := queries.Raw(sql, args...) + + err := q.Bind(ctx, exec, &slice) + if err != nil { + return errors.Wrap(err, "entity: unable to reload all in ArticleSlice") + } + + *o = slice + + return nil +} + +// ArticleExists checks if the Article row exists. +func ArticleExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error) { + var exists bool + sql := "select exists(select 1 from \"articles\" where \"id\"=$1 limit 1)" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, iD) + } + row := exec.QueryRowContext(ctx, sql, iD) + + err := row.Scan(&exists) + if err != nil { + return false, errors.Wrap(err, "entity: unable to check if articles exists") + } + + return exists, nil +} + +// Exists checks if the Article row exists. +func (o *Article) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + return ArticleExists(ctx, exec, o.ID) +} diff --git a/batch-service/entity/boil_queries.go b/batch-service/entity/boil_queries.go new file mode 100644 index 00000000..8c2a6e3c --- /dev/null +++ b/batch-service/entity/boil_queries.go @@ -0,0 +1,38 @@ +// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package entity + +import ( + "regexp" + + "github.com/volatiletech/sqlboiler/v4/drivers" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" +) + +var dialect = drivers.Dialect{ + LQ: 0x22, + RQ: 0x22, + + UseIndexPlaceholders: true, + UseLastInsertID: false, + UseSchema: false, + UseDefaultKeyword: true, + UseAutoColumns: false, + UseTopClause: false, + UseOutputClause: false, + UseCaseWhenExistsClause: false, +} + +// This is a dummy variable to prevent unused regexp import error +var _ = ®exp.Regexp{} + +// NewQuery initializes a new Query using the passed in QueryMods +func NewQuery(mods ...qm.QueryMod) *queries.Query { + q := &queries.Query{} + queries.SetDialect(q, &dialect) + qm.Apply(q, mods...) + + return q +} diff --git a/batch-service/entity/boil_table_names.go b/batch-service/entity/boil_table_names.go new file mode 100644 index 00000000..6f38b6c5 --- /dev/null +++ b/batch-service/entity/boil_table_names.go @@ -0,0 +1,18 @@ +// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package entity + +var TableNames = struct { + Articles string + Categories string + FeedArticleRelations string + Feeds string + Platforms string +}{ + Articles: "articles", + Categories: "categories", + FeedArticleRelations: "feed_article_relations", + Feeds: "feeds", + Platforms: "platforms", +} diff --git a/batch-service/entity/boil_types.go b/batch-service/entity/boil_types.go new file mode 100644 index 00000000..64f2123d --- /dev/null +++ b/batch-service/entity/boil_types.go @@ -0,0 +1,52 @@ +// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package entity + +import ( + "strconv" + + "github.com/friendsofgo/errors" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/strmangle" +) + +// M type is for providing columns and column values to UpdateAll. +type M map[string]interface{} + +// ErrSyncFail occurs during insert when the record could not be retrieved in +// order to populate default value information. This usually happens when LastInsertId +// fails or there was a primary key configuration that was not resolvable. +var ErrSyncFail = errors.New("entity: failed to synchronize data after insert") + +type insertCache struct { + query string + retQuery string + valueMapping []uint64 + retMapping []uint64 +} + +type updateCache struct { + query string + valueMapping []uint64 +} + +func makeCacheKey(cols boil.Columns, nzDefaults []string) string { + buf := strmangle.GetBuffer() + + buf.WriteString(strconv.Itoa(cols.Kind)) + for _, w := range cols.Cols { + buf.WriteString(w) + } + + if len(nzDefaults) != 0 { + buf.WriteByte('.') + } + for _, nz := range nzDefaults { + buf.WriteString(nz) + } + + str := buf.String() + strmangle.PutBuffer(buf) + return str +} diff --git a/batch-service/entity/boil_view_names.go b/batch-service/entity/boil_view_names.go new file mode 100644 index 00000000..80192044 --- /dev/null +++ b/batch-service/entity/boil_view_names.go @@ -0,0 +1,7 @@ +// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package entity + +var ViewNames = struct { +}{} diff --git a/batch-service/entity/categories.go b/batch-service/entity/categories.go new file mode 100644 index 00000000..c9ca6bf0 --- /dev/null +++ b/batch-service/entity/categories.go @@ -0,0 +1,1219 @@ +// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package entity + +import ( + "context" + "database/sql" + "fmt" + "reflect" + "strconv" + "strings" + "sync" + "time" + + "github.com/friendsofgo/errors" + "github.com/volatiletech/null/v8" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" + "github.com/volatiletech/sqlboiler/v4/queries/qmhelper" + "github.com/volatiletech/strmangle" +) + +// Category is an object representing the database table. +type Category struct { + ID string `boil:"id" json:"id" toml:"id" yaml:"id"` + Name string `boil:"name" json:"name" toml:"name" yaml:"name"` + Type int `boil:"type" json:"type" toml:"type" yaml:"type"` + CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` + UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` + DeletedAt null.Time `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"` + + R *categoryR `boil:"-" json:"-" toml:"-" yaml:"-"` + L categoryL `boil:"-" json:"-" toml:"-" yaml:"-"` +} + +var CategoryColumns = struct { + ID string + Name string + Type string + CreatedAt string + UpdatedAt string + DeletedAt string +}{ + ID: "id", + Name: "name", + Type: "type", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +var CategoryTableColumns = struct { + ID string + Name string + Type string + CreatedAt string + UpdatedAt string + DeletedAt string +}{ + ID: "categories.id", + Name: "categories.name", + Type: "categories.type", + CreatedAt: "categories.created_at", + UpdatedAt: "categories.updated_at", + DeletedAt: "categories.deleted_at", +} + +// Generated where + +type whereHelperint struct{ field string } + +func (w whereHelperint) EQ(x int) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.EQ, x) } +func (w whereHelperint) NEQ(x int) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) } +func (w whereHelperint) LT(x int) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LT, x) } +func (w whereHelperint) LTE(x int) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) } +func (w whereHelperint) GT(x int) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GT, x) } +func (w whereHelperint) GTE(x int) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) } +func (w whereHelperint) IN(slice []int) qm.QueryMod { + values := make([]interface{}, 0, len(slice)) + for _, value := range slice { + values = append(values, value) + } + return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...) +} +func (w whereHelperint) NIN(slice []int) qm.QueryMod { + values := make([]interface{}, 0, len(slice)) + for _, value := range slice { + values = append(values, value) + } + return qm.WhereNotIn(fmt.Sprintf("%s NOT IN ?", w.field), values...) +} + +type whereHelpernull_Time struct{ field string } + +func (w whereHelpernull_Time) EQ(x null.Time) qm.QueryMod { + return qmhelper.WhereNullEQ(w.field, false, x) +} +func (w whereHelpernull_Time) NEQ(x null.Time) qm.QueryMod { + return qmhelper.WhereNullEQ(w.field, true, x) +} +func (w whereHelpernull_Time) LT(x null.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.LT, x) +} +func (w whereHelpernull_Time) LTE(x null.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.LTE, x) +} +func (w whereHelpernull_Time) GT(x null.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.GT, x) +} +func (w whereHelpernull_Time) GTE(x null.Time) qm.QueryMod { + return qmhelper.Where(w.field, qmhelper.GTE, x) +} + +func (w whereHelpernull_Time) IsNull() qm.QueryMod { return qmhelper.WhereIsNull(w.field) } +func (w whereHelpernull_Time) IsNotNull() qm.QueryMod { return qmhelper.WhereIsNotNull(w.field) } + +var CategoryWhere = struct { + ID whereHelperstring + Name whereHelperstring + Type whereHelperint + CreatedAt whereHelpertime_Time + UpdatedAt whereHelpertime_Time + DeletedAt whereHelpernull_Time +}{ + ID: whereHelperstring{field: "\"categories\".\"id\""}, + Name: whereHelperstring{field: "\"categories\".\"name\""}, + Type: whereHelperint{field: "\"categories\".\"type\""}, + CreatedAt: whereHelpertime_Time{field: "\"categories\".\"created_at\""}, + UpdatedAt: whereHelpertime_Time{field: "\"categories\".\"updated_at\""}, + DeletedAt: whereHelpernull_Time{field: "\"categories\".\"deleted_at\""}, +} + +// CategoryRels is where relationship names are stored. +var CategoryRels = struct { + Feeds string +}{ + Feeds: "Feeds", +} + +// categoryR is where relationships are stored. +type categoryR struct { + Feeds FeedSlice `boil:"Feeds" json:"Feeds" toml:"Feeds" yaml:"Feeds"` +} + +// NewStruct creates a new relationship struct +func (*categoryR) NewStruct() *categoryR { + return &categoryR{} +} + +func (r *categoryR) GetFeeds() FeedSlice { + if r == nil { + return nil + } + return r.Feeds +} + +// categoryL is where Load methods for each relationship are stored. +type categoryL struct{} + +var ( + categoryAllColumns = []string{"id", "name", "type", "created_at", "updated_at", "deleted_at"} + categoryColumnsWithoutDefault = []string{"name", "type"} + categoryColumnsWithDefault = []string{"id", "created_at", "updated_at", "deleted_at"} + categoryPrimaryKeyColumns = []string{"id"} + categoryGeneratedColumns = []string{} +) + +type ( + // CategorySlice is an alias for a slice of pointers to Category. + // This should almost always be used instead of []Category. + CategorySlice []*Category + // CategoryHook is the signature for custom Category hook methods + CategoryHook func(context.Context, boil.ContextExecutor, *Category) error + + categoryQuery struct { + *queries.Query + } +) + +// Cache for insert, update and upsert +var ( + categoryType = reflect.TypeOf(&Category{}) + categoryMapping = queries.MakeStructMapping(categoryType) + categoryPrimaryKeyMapping, _ = queries.BindMapping(categoryType, categoryMapping, categoryPrimaryKeyColumns) + categoryInsertCacheMut sync.RWMutex + categoryInsertCache = make(map[string]insertCache) + categoryUpdateCacheMut sync.RWMutex + categoryUpdateCache = make(map[string]updateCache) + categoryUpsertCacheMut sync.RWMutex + categoryUpsertCache = make(map[string]insertCache) +) + +var ( + // Force time package dependency for automated UpdatedAt/CreatedAt. + _ = time.Second + // Force qmhelper dependency for where clause generation (which doesn't + // always happen) + _ = qmhelper.Where +) + +var categoryAfterSelectMu sync.Mutex +var categoryAfterSelectHooks []CategoryHook + +var categoryBeforeInsertMu sync.Mutex +var categoryBeforeInsertHooks []CategoryHook +var categoryAfterInsertMu sync.Mutex +var categoryAfterInsertHooks []CategoryHook + +var categoryBeforeUpdateMu sync.Mutex +var categoryBeforeUpdateHooks []CategoryHook +var categoryAfterUpdateMu sync.Mutex +var categoryAfterUpdateHooks []CategoryHook + +var categoryBeforeDeleteMu sync.Mutex +var categoryBeforeDeleteHooks []CategoryHook +var categoryAfterDeleteMu sync.Mutex +var categoryAfterDeleteHooks []CategoryHook + +var categoryBeforeUpsertMu sync.Mutex +var categoryBeforeUpsertHooks []CategoryHook +var categoryAfterUpsertMu sync.Mutex +var categoryAfterUpsertHooks []CategoryHook + +// doAfterSelectHooks executes all "after Select" hooks. +func (o *Category) doAfterSelectHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range categoryAfterSelectHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeInsertHooks executes all "before insert" hooks. +func (o *Category) doBeforeInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range categoryBeforeInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterInsertHooks executes all "after Insert" hooks. +func (o *Category) doAfterInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range categoryAfterInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpdateHooks executes all "before Update" hooks. +func (o *Category) doBeforeUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range categoryBeforeUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpdateHooks executes all "after Update" hooks. +func (o *Category) doAfterUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range categoryAfterUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeDeleteHooks executes all "before Delete" hooks. +func (o *Category) doBeforeDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range categoryBeforeDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterDeleteHooks executes all "after Delete" hooks. +func (o *Category) doAfterDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range categoryAfterDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpsertHooks executes all "before Upsert" hooks. +func (o *Category) doBeforeUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range categoryBeforeUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpsertHooks executes all "after Upsert" hooks. +func (o *Category) doAfterUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range categoryAfterUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// AddCategoryHook registers your hook function for all future operations. +func AddCategoryHook(hookPoint boil.HookPoint, categoryHook CategoryHook) { + switch hookPoint { + case boil.AfterSelectHook: + categoryAfterSelectMu.Lock() + categoryAfterSelectHooks = append(categoryAfterSelectHooks, categoryHook) + categoryAfterSelectMu.Unlock() + case boil.BeforeInsertHook: + categoryBeforeInsertMu.Lock() + categoryBeforeInsertHooks = append(categoryBeforeInsertHooks, categoryHook) + categoryBeforeInsertMu.Unlock() + case boil.AfterInsertHook: + categoryAfterInsertMu.Lock() + categoryAfterInsertHooks = append(categoryAfterInsertHooks, categoryHook) + categoryAfterInsertMu.Unlock() + case boil.BeforeUpdateHook: + categoryBeforeUpdateMu.Lock() + categoryBeforeUpdateHooks = append(categoryBeforeUpdateHooks, categoryHook) + categoryBeforeUpdateMu.Unlock() + case boil.AfterUpdateHook: + categoryAfterUpdateMu.Lock() + categoryAfterUpdateHooks = append(categoryAfterUpdateHooks, categoryHook) + categoryAfterUpdateMu.Unlock() + case boil.BeforeDeleteHook: + categoryBeforeDeleteMu.Lock() + categoryBeforeDeleteHooks = append(categoryBeforeDeleteHooks, categoryHook) + categoryBeforeDeleteMu.Unlock() + case boil.AfterDeleteHook: + categoryAfterDeleteMu.Lock() + categoryAfterDeleteHooks = append(categoryAfterDeleteHooks, categoryHook) + categoryAfterDeleteMu.Unlock() + case boil.BeforeUpsertHook: + categoryBeforeUpsertMu.Lock() + categoryBeforeUpsertHooks = append(categoryBeforeUpsertHooks, categoryHook) + categoryBeforeUpsertMu.Unlock() + case boil.AfterUpsertHook: + categoryAfterUpsertMu.Lock() + categoryAfterUpsertHooks = append(categoryAfterUpsertHooks, categoryHook) + categoryAfterUpsertMu.Unlock() + } +} + +// One returns a single category record from the query. +func (q categoryQuery) One(ctx context.Context, exec boil.ContextExecutor) (*Category, error) { + o := &Category{} + + queries.SetLimit(q.Query, 1) + + err := q.Bind(ctx, exec, o) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "entity: failed to execute a one query for categories") + } + + if err := o.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + + return o, nil +} + +// All returns all Category records from the query. +func (q categoryQuery) All(ctx context.Context, exec boil.ContextExecutor) (CategorySlice, error) { + var o []*Category + + err := q.Bind(ctx, exec, &o) + if err != nil { + return nil, errors.Wrap(err, "entity: failed to assign all query results to Category slice") + } + + if len(categoryAfterSelectHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + } + } + + return o, nil +} + +// Count returns the count of all Category records in the query. +func (q categoryQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return 0, errors.Wrap(err, "entity: failed to count categories rows") + } + + return count, nil +} + +// Exists checks if the row exists in the table. +func (q categoryQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + queries.SetLimit(q.Query, 1) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return false, errors.Wrap(err, "entity: failed to check if categories exists") + } + + return count > 0, nil +} + +// Feeds retrieves all the feed's Feeds with an executor. +func (o *Category) Feeds(mods ...qm.QueryMod) feedQuery { + var queryMods []qm.QueryMod + if len(mods) != 0 { + queryMods = append(queryMods, mods...) + } + + queryMods = append(queryMods, + qm.Where("\"feeds\".\"category_id\"=?", o.ID), + ) + + return Feeds(queryMods...) +} + +// LoadFeeds allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for a 1-M or N-M relationship. +func (categoryL) LoadFeeds(ctx context.Context, e boil.ContextExecutor, singular bool, maybeCategory interface{}, mods queries.Applicator) error { + var slice []*Category + var object *Category + + if singular { + var ok bool + object, ok = maybeCategory.(*Category) + if !ok { + object = new(Category) + ok = queries.SetFromEmbeddedStruct(&object, &maybeCategory) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeCategory)) + } + } + } else { + s, ok := maybeCategory.(*[]*Category) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeCategory) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeCategory)) + } + } + } + + args := make(map[interface{}]struct{}) + if singular { + if object.R == nil { + object.R = &categoryR{} + } + args[object.ID] = struct{}{} + } else { + for _, obj := range slice { + if obj.R == nil { + obj.R = &categoryR{} + } + args[obj.ID] = struct{}{} + } + } + + if len(args) == 0 { + return nil + } + + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + + query := NewQuery( + qm.From(`feeds`), + qm.WhereIn(`feeds.category_id in ?`, argsSlice...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load feeds") + } + + var resultSlice []*Feed + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice feeds") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results in eager load on feeds") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for feeds") + } + + if len(feedAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + if singular { + object.R.Feeds = resultSlice + for _, foreign := range resultSlice { + if foreign.R == nil { + foreign.R = &feedR{} + } + foreign.R.Category = object + } + return nil + } + + for _, foreign := range resultSlice { + for _, local := range slice { + if local.ID == foreign.CategoryID { + local.R.Feeds = append(local.R.Feeds, foreign) + if foreign.R == nil { + foreign.R = &feedR{} + } + foreign.R.Category = local + break + } + } + } + + return nil +} + +// AddFeeds adds the given related objects to the existing relationships +// of the category, optionally inserting them as new records. +// Appends related to o.R.Feeds. +// Sets related.R.Category appropriately. +func (o *Category) AddFeeds(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Feed) error { + var err error + for _, rel := range related { + if insert { + rel.CategoryID = o.ID + if err = rel.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } else { + updateQuery := fmt.Sprintf( + "UPDATE \"feeds\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, []string{"category_id"}), + strmangle.WhereClause("\"", "\"", 2, feedPrimaryKeyColumns), + ) + values := []interface{}{o.ID, rel.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update foreign table") + } + + rel.CategoryID = o.ID + } + } + + if o.R == nil { + o.R = &categoryR{ + Feeds: related, + } + } else { + o.R.Feeds = append(o.R.Feeds, related...) + } + + for _, rel := range related { + if rel.R == nil { + rel.R = &feedR{ + Category: o, + } + } else { + rel.R.Category = o + } + } + return nil +} + +// Categories retrieves all the records using an executor. +func Categories(mods ...qm.QueryMod) categoryQuery { + mods = append(mods, qm.From("\"categories\"")) + q := NewQuery(mods...) + if len(queries.GetSelect(q)) == 0 { + queries.SetSelect(q, []string{"\"categories\".*"}) + } + + return categoryQuery{q} +} + +// FindCategory retrieves a single record by ID with an executor. +// If selectCols is empty Find will return all columns. +func FindCategory(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Category, error) { + categoryObj := &Category{} + + sel := "*" + if len(selectCols) > 0 { + sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",") + } + query := fmt.Sprintf( + "select %s from \"categories\" where \"id\"=$1", sel, + ) + + q := queries.Raw(query, iD) + + err := q.Bind(ctx, exec, categoryObj) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "entity: unable to select from categories") + } + + if err = categoryObj.doAfterSelectHooks(ctx, exec); err != nil { + return categoryObj, err + } + + return categoryObj, nil +} + +// Insert a single record using an executor. +// See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts. +func (o *Category) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error { + if o == nil { + return errors.New("entity: no categories provided for insertion") + } + + var err error + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + if o.UpdatedAt.IsZero() { + o.UpdatedAt = currTime + } + } + + if err := o.doBeforeInsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(categoryColumnsWithDefault, o) + + key := makeCacheKey(columns, nzDefaults) + categoryInsertCacheMut.RLock() + cache, cached := categoryInsertCache[key] + categoryInsertCacheMut.RUnlock() + + if !cached { + wl, returnColumns := columns.InsertColumnSet( + categoryAllColumns, + categoryColumnsWithDefault, + categoryColumnsWithoutDefault, + nzDefaults, + ) + + cache.valueMapping, err = queries.BindMapping(categoryType, categoryMapping, wl) + if err != nil { + return err + } + cache.retMapping, err = queries.BindMapping(categoryType, categoryMapping, returnColumns) + if err != nil { + return err + } + if len(wl) != 0 { + cache.query = fmt.Sprintf("INSERT INTO \"categories\" (\"%s\") %%sVALUES (%s)%%s", strings.Join(wl, "\",\""), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1)) + } else { + cache.query = "INSERT INTO \"categories\" %sDEFAULT VALUES%s" + } + + var queryOutput, queryReturning string + + if len(cache.retMapping) != 0 { + queryReturning = fmt.Sprintf(" RETURNING \"%s\"", strings.Join(returnColumns, "\",\"")) + } + + cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning) + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + + if len(cache.retMapping) != 0 { + err = exec.QueryRowContext(ctx, cache.query, vals...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...) + } else { + _, err = exec.ExecContext(ctx, cache.query, vals...) + } + + if err != nil { + return errors.Wrap(err, "entity: unable to insert into categories") + } + + if !cached { + categoryInsertCacheMut.Lock() + categoryInsertCache[key] = cache + categoryInsertCacheMut.Unlock() + } + + return o.doAfterInsertHooks(ctx, exec) +} + +// Update uses an executor to update the Category. +// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. +// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records. +func (o *Category) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) { + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + o.UpdatedAt = currTime + } + + var err error + if err = o.doBeforeUpdateHooks(ctx, exec); err != nil { + return 0, err + } + key := makeCacheKey(columns, nil) + categoryUpdateCacheMut.RLock() + cache, cached := categoryUpdateCache[key] + categoryUpdateCacheMut.RUnlock() + + if !cached { + wl := columns.UpdateColumnSet( + categoryAllColumns, + categoryPrimaryKeyColumns, + ) + + if !columns.IsWhitelist() { + wl = strmangle.SetComplement(wl, []string{"created_at"}) + } + if len(wl) == 0 { + return 0, errors.New("entity: unable to update categories, could not build whitelist") + } + + cache.query = fmt.Sprintf("UPDATE \"categories\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, wl), + strmangle.WhereClause("\"", "\"", len(wl)+1, categoryPrimaryKeyColumns), + ) + cache.valueMapping, err = queries.BindMapping(categoryType, categoryMapping, append(wl, categoryPrimaryKeyColumns...)) + if err != nil { + return 0, err + } + } + + values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, values) + } + var result sql.Result + result, err = exec.ExecContext(ctx, cache.query, values...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update categories row") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by update for categories") + } + + if !cached { + categoryUpdateCacheMut.Lock() + categoryUpdateCache[key] = cache + categoryUpdateCacheMut.Unlock() + } + + return rowsAff, o.doAfterUpdateHooks(ctx, exec) +} + +// UpdateAll updates all rows with the specified column values. +func (q categoryQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + queries.SetUpdate(q.Query, cols) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update all for categories") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: unable to retrieve rows affected for categories") + } + + return rowsAff, nil +} + +// UpdateAll updates all rows with the specified column values, using an executor. +func (o CategorySlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + ln := int64(len(o)) + if ln == 0 { + return 0, nil + } + + if len(cols) == 0 { + return 0, errors.New("entity: update all requires at least one column argument") + } + + colNames := make([]string, len(cols)) + args := make([]interface{}, len(cols)) + + i := 0 + for name, value := range cols { + colNames[i] = name + args[i] = value + i++ + } + + // Append all of the primary key values for each column + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), categoryPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := fmt.Sprintf("UPDATE \"categories\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, colNames), + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, categoryPrimaryKeyColumns, len(o))) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update all in category slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: unable to retrieve rows affected all in update all category") + } + return rowsAff, nil +} + +// Upsert attempts an insert using an executor, and does an update or ignore on conflict. +// See boil.Columns documentation for how to properly use updateColumns and insertColumns. +func (o *Category) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error { + if o == nil { + return errors.New("entity: no categories provided for upsert") + } + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + o.UpdatedAt = currTime + } + + if err := o.doBeforeUpsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(categoryColumnsWithDefault, o) + + // Build cache key in-line uglily - mysql vs psql problems + buf := strmangle.GetBuffer() + if updateOnConflict { + buf.WriteByte('t') + } else { + buf.WriteByte('f') + } + buf.WriteByte('.') + for _, c := range conflictColumns { + buf.WriteString(c) + } + buf.WriteByte('.') + buf.WriteString(strconv.Itoa(updateColumns.Kind)) + for _, c := range updateColumns.Cols { + buf.WriteString(c) + } + buf.WriteByte('.') + buf.WriteString(strconv.Itoa(insertColumns.Kind)) + for _, c := range insertColumns.Cols { + buf.WriteString(c) + } + buf.WriteByte('.') + for _, c := range nzDefaults { + buf.WriteString(c) + } + key := buf.String() + strmangle.PutBuffer(buf) + + categoryUpsertCacheMut.RLock() + cache, cached := categoryUpsertCache[key] + categoryUpsertCacheMut.RUnlock() + + var err error + + if !cached { + insert, _ := insertColumns.InsertColumnSet( + categoryAllColumns, + categoryColumnsWithDefault, + categoryColumnsWithoutDefault, + nzDefaults, + ) + + update := updateColumns.UpdateColumnSet( + categoryAllColumns, + categoryPrimaryKeyColumns, + ) + + if updateOnConflict && len(update) == 0 { + return errors.New("entity: unable to upsert categories, could not build update column list") + } + + ret := strmangle.SetComplement(categoryAllColumns, strmangle.SetIntersect(insert, update)) + + conflict := conflictColumns + if len(conflict) == 0 && updateOnConflict && len(update) != 0 { + if len(categoryPrimaryKeyColumns) == 0 { + return errors.New("entity: unable to upsert categories, could not build conflict column list") + } + + conflict = make([]string, len(categoryPrimaryKeyColumns)) + copy(conflict, categoryPrimaryKeyColumns) + } + cache.query = buildUpsertQueryPostgres(dialect, "\"categories\"", updateOnConflict, ret, update, conflict, insert, opts...) + + cache.valueMapping, err = queries.BindMapping(categoryType, categoryMapping, insert) + if err != nil { + return err + } + if len(ret) != 0 { + cache.retMapping, err = queries.BindMapping(categoryType, categoryMapping, ret) + if err != nil { + return err + } + } + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + var returns []interface{} + if len(cache.retMapping) != 0 { + returns = queries.PtrsFromMapping(value, cache.retMapping) + } + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + if len(cache.retMapping) != 0 { + err = exec.QueryRowContext(ctx, cache.query, vals...).Scan(returns...) + if errors.Is(err, sql.ErrNoRows) { + err = nil // Postgres doesn't return anything when there's no update + } + } else { + _, err = exec.ExecContext(ctx, cache.query, vals...) + } + if err != nil { + return errors.Wrap(err, "entity: unable to upsert categories") + } + + if !cached { + categoryUpsertCacheMut.Lock() + categoryUpsertCache[key] = cache + categoryUpsertCacheMut.Unlock() + } + + return o.doAfterUpsertHooks(ctx, exec) +} + +// Delete deletes a single Category record with an executor. +// Delete will match against the primary key column to find the record to delete. +func (o *Category) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if o == nil { + return 0, errors.New("entity: no Category provided for delete") + } + + if err := o.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), categoryPrimaryKeyMapping) + sql := "DELETE FROM \"categories\" WHERE \"id\"=$1" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete from categories") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by delete for categories") + } + + if err := o.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + return rowsAff, nil +} + +// DeleteAll deletes all matching rows. +func (q categoryQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if q.Query == nil { + return 0, errors.New("entity: no categoryQuery provided for delete all") + } + + queries.SetDelete(q.Query) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete all from categories") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by deleteall for categories") + } + + return rowsAff, nil +} + +// DeleteAll deletes all rows in the slice, using an executor. +func (o CategorySlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if len(o) == 0 { + return 0, nil + } + + if len(categoryBeforeDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + var args []interface{} + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), categoryPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "DELETE FROM \"categories\" WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, categoryPrimaryKeyColumns, len(o)) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete all from category slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by deleteall for categories") + } + + if len(categoryAfterDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + return rowsAff, nil +} + +// Reload refetches the object from the database +// using the primary keys with an executor. +func (o *Category) Reload(ctx context.Context, exec boil.ContextExecutor) error { + ret, err := FindCategory(ctx, exec, o.ID) + if err != nil { + return err + } + + *o = *ret + return nil +} + +// ReloadAll refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *CategorySlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error { + if o == nil || len(*o) == 0 { + return nil + } + + slice := CategorySlice{} + var args []interface{} + for _, obj := range *o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), categoryPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "SELECT \"categories\".* FROM \"categories\" WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, categoryPrimaryKeyColumns, len(*o)) + + q := queries.Raw(sql, args...) + + err := q.Bind(ctx, exec, &slice) + if err != nil { + return errors.Wrap(err, "entity: unable to reload all in CategorySlice") + } + + *o = slice + + return nil +} + +// CategoryExists checks if the Category row exists. +func CategoryExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error) { + var exists bool + sql := "select exists(select 1 from \"categories\" where \"id\"=$1 limit 1)" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, iD) + } + row := exec.QueryRowContext(ctx, sql, iD) + + err := row.Scan(&exists) + if err != nil { + return false, errors.Wrap(err, "entity: unable to check if categories exists") + } + + return exists, nil +} + +// Exists checks if the Category row exists. +func (o *Category) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + return CategoryExists(ctx, exec, o.ID) +} diff --git a/batch-service/entity/feed_article_relations.go b/batch-service/entity/feed_article_relations.go new file mode 100644 index 00000000..1477b2b5 --- /dev/null +++ b/batch-service/entity/feed_article_relations.go @@ -0,0 +1,1350 @@ +// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package entity + +import ( + "context" + "database/sql" + "fmt" + "reflect" + "strconv" + "strings" + "sync" + "time" + + "github.com/friendsofgo/errors" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" + "github.com/volatiletech/sqlboiler/v4/queries/qmhelper" + "github.com/volatiletech/strmangle" +) + +// FeedArticleRelation is an object representing the database table. +type FeedArticleRelation struct { + ID string `boil:"id" json:"id" toml:"id" yaml:"id"` + FeedID string `boil:"feed_id" json:"feed_id" toml:"feed_id" yaml:"feed_id"` + ArticleID string `boil:"article_id" json:"article_id" toml:"article_id" yaml:"article_id"` + CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` + UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` + + R *feedArticleRelationR `boil:"-" json:"-" toml:"-" yaml:"-"` + L feedArticleRelationL `boil:"-" json:"-" toml:"-" yaml:"-"` +} + +var FeedArticleRelationColumns = struct { + ID string + FeedID string + ArticleID string + CreatedAt string + UpdatedAt string +}{ + ID: "id", + FeedID: "feed_id", + ArticleID: "article_id", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +var FeedArticleRelationTableColumns = struct { + ID string + FeedID string + ArticleID string + CreatedAt string + UpdatedAt string +}{ + ID: "feed_article_relations.id", + FeedID: "feed_article_relations.feed_id", + ArticleID: "feed_article_relations.article_id", + CreatedAt: "feed_article_relations.created_at", + UpdatedAt: "feed_article_relations.updated_at", +} + +// Generated where + +var FeedArticleRelationWhere = struct { + ID whereHelperstring + FeedID whereHelperstring + ArticleID whereHelperstring + CreatedAt whereHelpertime_Time + UpdatedAt whereHelpertime_Time +}{ + ID: whereHelperstring{field: "\"feed_article_relations\".\"id\""}, + FeedID: whereHelperstring{field: "\"feed_article_relations\".\"feed_id\""}, + ArticleID: whereHelperstring{field: "\"feed_article_relations\".\"article_id\""}, + CreatedAt: whereHelpertime_Time{field: "\"feed_article_relations\".\"created_at\""}, + UpdatedAt: whereHelpertime_Time{field: "\"feed_article_relations\".\"updated_at\""}, +} + +// FeedArticleRelationRels is where relationship names are stored. +var FeedArticleRelationRels = struct { + Article string + Feed string +}{ + Article: "Article", + Feed: "Feed", +} + +// feedArticleRelationR is where relationships are stored. +type feedArticleRelationR struct { + Article *Article `boil:"Article" json:"Article" toml:"Article" yaml:"Article"` + Feed *Feed `boil:"Feed" json:"Feed" toml:"Feed" yaml:"Feed"` +} + +// NewStruct creates a new relationship struct +func (*feedArticleRelationR) NewStruct() *feedArticleRelationR { + return &feedArticleRelationR{} +} + +func (r *feedArticleRelationR) GetArticle() *Article { + if r == nil { + return nil + } + return r.Article +} + +func (r *feedArticleRelationR) GetFeed() *Feed { + if r == nil { + return nil + } + return r.Feed +} + +// feedArticleRelationL is where Load methods for each relationship are stored. +type feedArticleRelationL struct{} + +var ( + feedArticleRelationAllColumns = []string{"id", "feed_id", "article_id", "created_at", "updated_at"} + feedArticleRelationColumnsWithoutDefault = []string{"feed_id", "article_id"} + feedArticleRelationColumnsWithDefault = []string{"id", "created_at", "updated_at"} + feedArticleRelationPrimaryKeyColumns = []string{"id"} + feedArticleRelationGeneratedColumns = []string{} +) + +type ( + // FeedArticleRelationSlice is an alias for a slice of pointers to FeedArticleRelation. + // This should almost always be used instead of []FeedArticleRelation. + FeedArticleRelationSlice []*FeedArticleRelation + // FeedArticleRelationHook is the signature for custom FeedArticleRelation hook methods + FeedArticleRelationHook func(context.Context, boil.ContextExecutor, *FeedArticleRelation) error + + feedArticleRelationQuery struct { + *queries.Query + } +) + +// Cache for insert, update and upsert +var ( + feedArticleRelationType = reflect.TypeOf(&FeedArticleRelation{}) + feedArticleRelationMapping = queries.MakeStructMapping(feedArticleRelationType) + feedArticleRelationPrimaryKeyMapping, _ = queries.BindMapping(feedArticleRelationType, feedArticleRelationMapping, feedArticleRelationPrimaryKeyColumns) + feedArticleRelationInsertCacheMut sync.RWMutex + feedArticleRelationInsertCache = make(map[string]insertCache) + feedArticleRelationUpdateCacheMut sync.RWMutex + feedArticleRelationUpdateCache = make(map[string]updateCache) + feedArticleRelationUpsertCacheMut sync.RWMutex + feedArticleRelationUpsertCache = make(map[string]insertCache) +) + +var ( + // Force time package dependency for automated UpdatedAt/CreatedAt. + _ = time.Second + // Force qmhelper dependency for where clause generation (which doesn't + // always happen) + _ = qmhelper.Where +) + +var feedArticleRelationAfterSelectMu sync.Mutex +var feedArticleRelationAfterSelectHooks []FeedArticleRelationHook + +var feedArticleRelationBeforeInsertMu sync.Mutex +var feedArticleRelationBeforeInsertHooks []FeedArticleRelationHook +var feedArticleRelationAfterInsertMu sync.Mutex +var feedArticleRelationAfterInsertHooks []FeedArticleRelationHook + +var feedArticleRelationBeforeUpdateMu sync.Mutex +var feedArticleRelationBeforeUpdateHooks []FeedArticleRelationHook +var feedArticleRelationAfterUpdateMu sync.Mutex +var feedArticleRelationAfterUpdateHooks []FeedArticleRelationHook + +var feedArticleRelationBeforeDeleteMu sync.Mutex +var feedArticleRelationBeforeDeleteHooks []FeedArticleRelationHook +var feedArticleRelationAfterDeleteMu sync.Mutex +var feedArticleRelationAfterDeleteHooks []FeedArticleRelationHook + +var feedArticleRelationBeforeUpsertMu sync.Mutex +var feedArticleRelationBeforeUpsertHooks []FeedArticleRelationHook +var feedArticleRelationAfterUpsertMu sync.Mutex +var feedArticleRelationAfterUpsertHooks []FeedArticleRelationHook + +// doAfterSelectHooks executes all "after Select" hooks. +func (o *FeedArticleRelation) doAfterSelectHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedArticleRelationAfterSelectHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeInsertHooks executes all "before insert" hooks. +func (o *FeedArticleRelation) doBeforeInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedArticleRelationBeforeInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterInsertHooks executes all "after Insert" hooks. +func (o *FeedArticleRelation) doAfterInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedArticleRelationAfterInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpdateHooks executes all "before Update" hooks. +func (o *FeedArticleRelation) doBeforeUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedArticleRelationBeforeUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpdateHooks executes all "after Update" hooks. +func (o *FeedArticleRelation) doAfterUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedArticleRelationAfterUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeDeleteHooks executes all "before Delete" hooks. +func (o *FeedArticleRelation) doBeforeDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedArticleRelationBeforeDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterDeleteHooks executes all "after Delete" hooks. +func (o *FeedArticleRelation) doAfterDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedArticleRelationAfterDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpsertHooks executes all "before Upsert" hooks. +func (o *FeedArticleRelation) doBeforeUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedArticleRelationBeforeUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpsertHooks executes all "after Upsert" hooks. +func (o *FeedArticleRelation) doAfterUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedArticleRelationAfterUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// AddFeedArticleRelationHook registers your hook function for all future operations. +func AddFeedArticleRelationHook(hookPoint boil.HookPoint, feedArticleRelationHook FeedArticleRelationHook) { + switch hookPoint { + case boil.AfterSelectHook: + feedArticleRelationAfterSelectMu.Lock() + feedArticleRelationAfterSelectHooks = append(feedArticleRelationAfterSelectHooks, feedArticleRelationHook) + feedArticleRelationAfterSelectMu.Unlock() + case boil.BeforeInsertHook: + feedArticleRelationBeforeInsertMu.Lock() + feedArticleRelationBeforeInsertHooks = append(feedArticleRelationBeforeInsertHooks, feedArticleRelationHook) + feedArticleRelationBeforeInsertMu.Unlock() + case boil.AfterInsertHook: + feedArticleRelationAfterInsertMu.Lock() + feedArticleRelationAfterInsertHooks = append(feedArticleRelationAfterInsertHooks, feedArticleRelationHook) + feedArticleRelationAfterInsertMu.Unlock() + case boil.BeforeUpdateHook: + feedArticleRelationBeforeUpdateMu.Lock() + feedArticleRelationBeforeUpdateHooks = append(feedArticleRelationBeforeUpdateHooks, feedArticleRelationHook) + feedArticleRelationBeforeUpdateMu.Unlock() + case boil.AfterUpdateHook: + feedArticleRelationAfterUpdateMu.Lock() + feedArticleRelationAfterUpdateHooks = append(feedArticleRelationAfterUpdateHooks, feedArticleRelationHook) + feedArticleRelationAfterUpdateMu.Unlock() + case boil.BeforeDeleteHook: + feedArticleRelationBeforeDeleteMu.Lock() + feedArticleRelationBeforeDeleteHooks = append(feedArticleRelationBeforeDeleteHooks, feedArticleRelationHook) + feedArticleRelationBeforeDeleteMu.Unlock() + case boil.AfterDeleteHook: + feedArticleRelationAfterDeleteMu.Lock() + feedArticleRelationAfterDeleteHooks = append(feedArticleRelationAfterDeleteHooks, feedArticleRelationHook) + feedArticleRelationAfterDeleteMu.Unlock() + case boil.BeforeUpsertHook: + feedArticleRelationBeforeUpsertMu.Lock() + feedArticleRelationBeforeUpsertHooks = append(feedArticleRelationBeforeUpsertHooks, feedArticleRelationHook) + feedArticleRelationBeforeUpsertMu.Unlock() + case boil.AfterUpsertHook: + feedArticleRelationAfterUpsertMu.Lock() + feedArticleRelationAfterUpsertHooks = append(feedArticleRelationAfterUpsertHooks, feedArticleRelationHook) + feedArticleRelationAfterUpsertMu.Unlock() + } +} + +// One returns a single feedArticleRelation record from the query. +func (q feedArticleRelationQuery) One(ctx context.Context, exec boil.ContextExecutor) (*FeedArticleRelation, error) { + o := &FeedArticleRelation{} + + queries.SetLimit(q.Query, 1) + + err := q.Bind(ctx, exec, o) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "entity: failed to execute a one query for feed_article_relations") + } + + if err := o.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + + return o, nil +} + +// All returns all FeedArticleRelation records from the query. +func (q feedArticleRelationQuery) All(ctx context.Context, exec boil.ContextExecutor) (FeedArticleRelationSlice, error) { + var o []*FeedArticleRelation + + err := q.Bind(ctx, exec, &o) + if err != nil { + return nil, errors.Wrap(err, "entity: failed to assign all query results to FeedArticleRelation slice") + } + + if len(feedArticleRelationAfterSelectHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + } + } + + return o, nil +} + +// Count returns the count of all FeedArticleRelation records in the query. +func (q feedArticleRelationQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return 0, errors.Wrap(err, "entity: failed to count feed_article_relations rows") + } + + return count, nil +} + +// Exists checks if the row exists in the table. +func (q feedArticleRelationQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + queries.SetLimit(q.Query, 1) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return false, errors.Wrap(err, "entity: failed to check if feed_article_relations exists") + } + + return count > 0, nil +} + +// Article pointed to by the foreign key. +func (o *FeedArticleRelation) Article(mods ...qm.QueryMod) articleQuery { + queryMods := []qm.QueryMod{ + qm.Where("\"id\" = ?", o.ArticleID), + } + + queryMods = append(queryMods, mods...) + + return Articles(queryMods...) +} + +// Feed pointed to by the foreign key. +func (o *FeedArticleRelation) Feed(mods ...qm.QueryMod) feedQuery { + queryMods := []qm.QueryMod{ + qm.Where("\"id\" = ?", o.FeedID), + } + + queryMods = append(queryMods, mods...) + + return Feeds(queryMods...) +} + +// LoadArticle allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for an N-1 relationship. +func (feedArticleRelationL) LoadArticle(ctx context.Context, e boil.ContextExecutor, singular bool, maybeFeedArticleRelation interface{}, mods queries.Applicator) error { + var slice []*FeedArticleRelation + var object *FeedArticleRelation + + if singular { + var ok bool + object, ok = maybeFeedArticleRelation.(*FeedArticleRelation) + if !ok { + object = new(FeedArticleRelation) + ok = queries.SetFromEmbeddedStruct(&object, &maybeFeedArticleRelation) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeFeedArticleRelation)) + } + } + } else { + s, ok := maybeFeedArticleRelation.(*[]*FeedArticleRelation) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeFeedArticleRelation) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeFeedArticleRelation)) + } + } + } + + args := make(map[interface{}]struct{}) + if singular { + if object.R == nil { + object.R = &feedArticleRelationR{} + } + args[object.ArticleID] = struct{}{} + + } else { + for _, obj := range slice { + if obj.R == nil { + obj.R = &feedArticleRelationR{} + } + + args[obj.ArticleID] = struct{}{} + + } + } + + if len(args) == 0 { + return nil + } + + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + + query := NewQuery( + qm.From(`articles`), + qm.WhereIn(`articles.id in ?`, argsSlice...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load Article") + } + + var resultSlice []*Article + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice Article") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results of eager load for articles") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for articles") + } + + if len(articleAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + + if len(resultSlice) == 0 { + return nil + } + + if singular { + foreign := resultSlice[0] + object.R.Article = foreign + if foreign.R == nil { + foreign.R = &articleR{} + } + foreign.R.FeedArticleRelations = append(foreign.R.FeedArticleRelations, object) + return nil + } + + for _, local := range slice { + for _, foreign := range resultSlice { + if local.ArticleID == foreign.ID { + local.R.Article = foreign + if foreign.R == nil { + foreign.R = &articleR{} + } + foreign.R.FeedArticleRelations = append(foreign.R.FeedArticleRelations, local) + break + } + } + } + + return nil +} + +// LoadFeed allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for an N-1 relationship. +func (feedArticleRelationL) LoadFeed(ctx context.Context, e boil.ContextExecutor, singular bool, maybeFeedArticleRelation interface{}, mods queries.Applicator) error { + var slice []*FeedArticleRelation + var object *FeedArticleRelation + + if singular { + var ok bool + object, ok = maybeFeedArticleRelation.(*FeedArticleRelation) + if !ok { + object = new(FeedArticleRelation) + ok = queries.SetFromEmbeddedStruct(&object, &maybeFeedArticleRelation) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeFeedArticleRelation)) + } + } + } else { + s, ok := maybeFeedArticleRelation.(*[]*FeedArticleRelation) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeFeedArticleRelation) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeFeedArticleRelation)) + } + } + } + + args := make(map[interface{}]struct{}) + if singular { + if object.R == nil { + object.R = &feedArticleRelationR{} + } + args[object.FeedID] = struct{}{} + + } else { + for _, obj := range slice { + if obj.R == nil { + obj.R = &feedArticleRelationR{} + } + + args[obj.FeedID] = struct{}{} + + } + } + + if len(args) == 0 { + return nil + } + + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + + query := NewQuery( + qm.From(`feeds`), + qm.WhereIn(`feeds.id in ?`, argsSlice...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load Feed") + } + + var resultSlice []*Feed + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice Feed") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results of eager load for feeds") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for feeds") + } + + if len(feedAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + + if len(resultSlice) == 0 { + return nil + } + + if singular { + foreign := resultSlice[0] + object.R.Feed = foreign + if foreign.R == nil { + foreign.R = &feedR{} + } + foreign.R.FeedArticleRelations = append(foreign.R.FeedArticleRelations, object) + return nil + } + + for _, local := range slice { + for _, foreign := range resultSlice { + if local.FeedID == foreign.ID { + local.R.Feed = foreign + if foreign.R == nil { + foreign.R = &feedR{} + } + foreign.R.FeedArticleRelations = append(foreign.R.FeedArticleRelations, local) + break + } + } + } + + return nil +} + +// SetArticle of the feedArticleRelation to the related item. +// Sets o.R.Article to related. +// Adds o to related.R.FeedArticleRelations. +func (o *FeedArticleRelation) SetArticle(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Article) error { + var err error + if insert { + if err = related.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } + + updateQuery := fmt.Sprintf( + "UPDATE \"feed_article_relations\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, []string{"article_id"}), + strmangle.WhereClause("\"", "\"", 2, feedArticleRelationPrimaryKeyColumns), + ) + values := []interface{}{related.ID, o.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update local table") + } + + o.ArticleID = related.ID + if o.R == nil { + o.R = &feedArticleRelationR{ + Article: related, + } + } else { + o.R.Article = related + } + + if related.R == nil { + related.R = &articleR{ + FeedArticleRelations: FeedArticleRelationSlice{o}, + } + } else { + related.R.FeedArticleRelations = append(related.R.FeedArticleRelations, o) + } + + return nil +} + +// SetFeed of the feedArticleRelation to the related item. +// Sets o.R.Feed to related. +// Adds o to related.R.FeedArticleRelations. +func (o *FeedArticleRelation) SetFeed(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Feed) error { + var err error + if insert { + if err = related.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } + + updateQuery := fmt.Sprintf( + "UPDATE \"feed_article_relations\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, []string{"feed_id"}), + strmangle.WhereClause("\"", "\"", 2, feedArticleRelationPrimaryKeyColumns), + ) + values := []interface{}{related.ID, o.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update local table") + } + + o.FeedID = related.ID + if o.R == nil { + o.R = &feedArticleRelationR{ + Feed: related, + } + } else { + o.R.Feed = related + } + + if related.R == nil { + related.R = &feedR{ + FeedArticleRelations: FeedArticleRelationSlice{o}, + } + } else { + related.R.FeedArticleRelations = append(related.R.FeedArticleRelations, o) + } + + return nil +} + +// FeedArticleRelations retrieves all the records using an executor. +func FeedArticleRelations(mods ...qm.QueryMod) feedArticleRelationQuery { + mods = append(mods, qm.From("\"feed_article_relations\"")) + q := NewQuery(mods...) + if len(queries.GetSelect(q)) == 0 { + queries.SetSelect(q, []string{"\"feed_article_relations\".*"}) + } + + return feedArticleRelationQuery{q} +} + +// FindFeedArticleRelation retrieves a single record by ID with an executor. +// If selectCols is empty Find will return all columns. +func FindFeedArticleRelation(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*FeedArticleRelation, error) { + feedArticleRelationObj := &FeedArticleRelation{} + + sel := "*" + if len(selectCols) > 0 { + sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",") + } + query := fmt.Sprintf( + "select %s from \"feed_article_relations\" where \"id\"=$1", sel, + ) + + q := queries.Raw(query, iD) + + err := q.Bind(ctx, exec, feedArticleRelationObj) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "entity: unable to select from feed_article_relations") + } + + if err = feedArticleRelationObj.doAfterSelectHooks(ctx, exec); err != nil { + return feedArticleRelationObj, err + } + + return feedArticleRelationObj, nil +} + +// Insert a single record using an executor. +// See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts. +func (o *FeedArticleRelation) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error { + if o == nil { + return errors.New("entity: no feed_article_relations provided for insertion") + } + + var err error + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + if o.UpdatedAt.IsZero() { + o.UpdatedAt = currTime + } + } + + if err := o.doBeforeInsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(feedArticleRelationColumnsWithDefault, o) + + key := makeCacheKey(columns, nzDefaults) + feedArticleRelationInsertCacheMut.RLock() + cache, cached := feedArticleRelationInsertCache[key] + feedArticleRelationInsertCacheMut.RUnlock() + + if !cached { + wl, returnColumns := columns.InsertColumnSet( + feedArticleRelationAllColumns, + feedArticleRelationColumnsWithDefault, + feedArticleRelationColumnsWithoutDefault, + nzDefaults, + ) + + cache.valueMapping, err = queries.BindMapping(feedArticleRelationType, feedArticleRelationMapping, wl) + if err != nil { + return err + } + cache.retMapping, err = queries.BindMapping(feedArticleRelationType, feedArticleRelationMapping, returnColumns) + if err != nil { + return err + } + if len(wl) != 0 { + cache.query = fmt.Sprintf("INSERT INTO \"feed_article_relations\" (\"%s\") %%sVALUES (%s)%%s", strings.Join(wl, "\",\""), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1)) + } else { + cache.query = "INSERT INTO \"feed_article_relations\" %sDEFAULT VALUES%s" + } + + var queryOutput, queryReturning string + + if len(cache.retMapping) != 0 { + queryReturning = fmt.Sprintf(" RETURNING \"%s\"", strings.Join(returnColumns, "\",\"")) + } + + cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning) + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + + if len(cache.retMapping) != 0 { + err = exec.QueryRowContext(ctx, cache.query, vals...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...) + } else { + _, err = exec.ExecContext(ctx, cache.query, vals...) + } + + if err != nil { + return errors.Wrap(err, "entity: unable to insert into feed_article_relations") + } + + if !cached { + feedArticleRelationInsertCacheMut.Lock() + feedArticleRelationInsertCache[key] = cache + feedArticleRelationInsertCacheMut.Unlock() + } + + return o.doAfterInsertHooks(ctx, exec) +} + +// Update uses an executor to update the FeedArticleRelation. +// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. +// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records. +func (o *FeedArticleRelation) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) { + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + o.UpdatedAt = currTime + } + + var err error + if err = o.doBeforeUpdateHooks(ctx, exec); err != nil { + return 0, err + } + key := makeCacheKey(columns, nil) + feedArticleRelationUpdateCacheMut.RLock() + cache, cached := feedArticleRelationUpdateCache[key] + feedArticleRelationUpdateCacheMut.RUnlock() + + if !cached { + wl := columns.UpdateColumnSet( + feedArticleRelationAllColumns, + feedArticleRelationPrimaryKeyColumns, + ) + + if !columns.IsWhitelist() { + wl = strmangle.SetComplement(wl, []string{"created_at"}) + } + if len(wl) == 0 { + return 0, errors.New("entity: unable to update feed_article_relations, could not build whitelist") + } + + cache.query = fmt.Sprintf("UPDATE \"feed_article_relations\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, wl), + strmangle.WhereClause("\"", "\"", len(wl)+1, feedArticleRelationPrimaryKeyColumns), + ) + cache.valueMapping, err = queries.BindMapping(feedArticleRelationType, feedArticleRelationMapping, append(wl, feedArticleRelationPrimaryKeyColumns...)) + if err != nil { + return 0, err + } + } + + values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, values) + } + var result sql.Result + result, err = exec.ExecContext(ctx, cache.query, values...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update feed_article_relations row") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by update for feed_article_relations") + } + + if !cached { + feedArticleRelationUpdateCacheMut.Lock() + feedArticleRelationUpdateCache[key] = cache + feedArticleRelationUpdateCacheMut.Unlock() + } + + return rowsAff, o.doAfterUpdateHooks(ctx, exec) +} + +// UpdateAll updates all rows with the specified column values. +func (q feedArticleRelationQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + queries.SetUpdate(q.Query, cols) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update all for feed_article_relations") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: unable to retrieve rows affected for feed_article_relations") + } + + return rowsAff, nil +} + +// UpdateAll updates all rows with the specified column values, using an executor. +func (o FeedArticleRelationSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + ln := int64(len(o)) + if ln == 0 { + return 0, nil + } + + if len(cols) == 0 { + return 0, errors.New("entity: update all requires at least one column argument") + } + + colNames := make([]string, len(cols)) + args := make([]interface{}, len(cols)) + + i := 0 + for name, value := range cols { + colNames[i] = name + args[i] = value + i++ + } + + // Append all of the primary key values for each column + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), feedArticleRelationPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := fmt.Sprintf("UPDATE \"feed_article_relations\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, colNames), + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, feedArticleRelationPrimaryKeyColumns, len(o))) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update all in feedArticleRelation slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: unable to retrieve rows affected all in update all feedArticleRelation") + } + return rowsAff, nil +} + +// Upsert attempts an insert using an executor, and does an update or ignore on conflict. +// See boil.Columns documentation for how to properly use updateColumns and insertColumns. +func (o *FeedArticleRelation) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error { + if o == nil { + return errors.New("entity: no feed_article_relations provided for upsert") + } + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + o.UpdatedAt = currTime + } + + if err := o.doBeforeUpsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(feedArticleRelationColumnsWithDefault, o) + + // Build cache key in-line uglily - mysql vs psql problems + buf := strmangle.GetBuffer() + if updateOnConflict { + buf.WriteByte('t') + } else { + buf.WriteByte('f') + } + buf.WriteByte('.') + for _, c := range conflictColumns { + buf.WriteString(c) + } + buf.WriteByte('.') + buf.WriteString(strconv.Itoa(updateColumns.Kind)) + for _, c := range updateColumns.Cols { + buf.WriteString(c) + } + buf.WriteByte('.') + buf.WriteString(strconv.Itoa(insertColumns.Kind)) + for _, c := range insertColumns.Cols { + buf.WriteString(c) + } + buf.WriteByte('.') + for _, c := range nzDefaults { + buf.WriteString(c) + } + key := buf.String() + strmangle.PutBuffer(buf) + + feedArticleRelationUpsertCacheMut.RLock() + cache, cached := feedArticleRelationUpsertCache[key] + feedArticleRelationUpsertCacheMut.RUnlock() + + var err error + + if !cached { + insert, _ := insertColumns.InsertColumnSet( + feedArticleRelationAllColumns, + feedArticleRelationColumnsWithDefault, + feedArticleRelationColumnsWithoutDefault, + nzDefaults, + ) + + update := updateColumns.UpdateColumnSet( + feedArticleRelationAllColumns, + feedArticleRelationPrimaryKeyColumns, + ) + + if updateOnConflict && len(update) == 0 { + return errors.New("entity: unable to upsert feed_article_relations, could not build update column list") + } + + ret := strmangle.SetComplement(feedArticleRelationAllColumns, strmangle.SetIntersect(insert, update)) + + conflict := conflictColumns + if len(conflict) == 0 && updateOnConflict && len(update) != 0 { + if len(feedArticleRelationPrimaryKeyColumns) == 0 { + return errors.New("entity: unable to upsert feed_article_relations, could not build conflict column list") + } + + conflict = make([]string, len(feedArticleRelationPrimaryKeyColumns)) + copy(conflict, feedArticleRelationPrimaryKeyColumns) + } + cache.query = buildUpsertQueryPostgres(dialect, "\"feed_article_relations\"", updateOnConflict, ret, update, conflict, insert, opts...) + + cache.valueMapping, err = queries.BindMapping(feedArticleRelationType, feedArticleRelationMapping, insert) + if err != nil { + return err + } + if len(ret) != 0 { + cache.retMapping, err = queries.BindMapping(feedArticleRelationType, feedArticleRelationMapping, ret) + if err != nil { + return err + } + } + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + var returns []interface{} + if len(cache.retMapping) != 0 { + returns = queries.PtrsFromMapping(value, cache.retMapping) + } + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + if len(cache.retMapping) != 0 { + err = exec.QueryRowContext(ctx, cache.query, vals...).Scan(returns...) + if errors.Is(err, sql.ErrNoRows) { + err = nil // Postgres doesn't return anything when there's no update + } + } else { + _, err = exec.ExecContext(ctx, cache.query, vals...) + } + if err != nil { + return errors.Wrap(err, "entity: unable to upsert feed_article_relations") + } + + if !cached { + feedArticleRelationUpsertCacheMut.Lock() + feedArticleRelationUpsertCache[key] = cache + feedArticleRelationUpsertCacheMut.Unlock() + } + + return o.doAfterUpsertHooks(ctx, exec) +} + +// Delete deletes a single FeedArticleRelation record with an executor. +// Delete will match against the primary key column to find the record to delete. +func (o *FeedArticleRelation) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if o == nil { + return 0, errors.New("entity: no FeedArticleRelation provided for delete") + } + + if err := o.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), feedArticleRelationPrimaryKeyMapping) + sql := "DELETE FROM \"feed_article_relations\" WHERE \"id\"=$1" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete from feed_article_relations") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by delete for feed_article_relations") + } + + if err := o.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + return rowsAff, nil +} + +// DeleteAll deletes all matching rows. +func (q feedArticleRelationQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if q.Query == nil { + return 0, errors.New("entity: no feedArticleRelationQuery provided for delete all") + } + + queries.SetDelete(q.Query) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete all from feed_article_relations") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by deleteall for feed_article_relations") + } + + return rowsAff, nil +} + +// DeleteAll deletes all rows in the slice, using an executor. +func (o FeedArticleRelationSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if len(o) == 0 { + return 0, nil + } + + if len(feedArticleRelationBeforeDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + var args []interface{} + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), feedArticleRelationPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "DELETE FROM \"feed_article_relations\" WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, feedArticleRelationPrimaryKeyColumns, len(o)) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete all from feedArticleRelation slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by deleteall for feed_article_relations") + } + + if len(feedArticleRelationAfterDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + return rowsAff, nil +} + +// Reload refetches the object from the database +// using the primary keys with an executor. +func (o *FeedArticleRelation) Reload(ctx context.Context, exec boil.ContextExecutor) error { + ret, err := FindFeedArticleRelation(ctx, exec, o.ID) + if err != nil { + return err + } + + *o = *ret + return nil +} + +// ReloadAll refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *FeedArticleRelationSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error { + if o == nil || len(*o) == 0 { + return nil + } + + slice := FeedArticleRelationSlice{} + var args []interface{} + for _, obj := range *o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), feedArticleRelationPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "SELECT \"feed_article_relations\".* FROM \"feed_article_relations\" WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, feedArticleRelationPrimaryKeyColumns, len(*o)) + + q := queries.Raw(sql, args...) + + err := q.Bind(ctx, exec, &slice) + if err != nil { + return errors.Wrap(err, "entity: unable to reload all in FeedArticleRelationSlice") + } + + *o = slice + + return nil +} + +// FeedArticleRelationExists checks if the FeedArticleRelation row exists. +func FeedArticleRelationExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error) { + var exists bool + sql := "select exists(select 1 from \"feed_article_relations\" where \"id\"=$1 limit 1)" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, iD) + } + row := exec.QueryRowContext(ctx, sql, iD) + + err := row.Scan(&exists) + if err != nil { + return false, errors.Wrap(err, "entity: unable to check if feed_article_relations exists") + } + + return exists, nil +} + +// Exists checks if the FeedArticleRelation row exists. +func (o *FeedArticleRelation) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + return FeedArticleRelationExists(ctx, exec, o.ID) +} diff --git a/batch-service/entity/feeds.go b/batch-service/entity/feeds.go new file mode 100644 index 00000000..445d4aa7 --- /dev/null +++ b/batch-service/entity/feeds.go @@ -0,0 +1,1569 @@ +// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package entity + +import ( + "context" + "database/sql" + "fmt" + "reflect" + "strconv" + "strings" + "sync" + "time" + + "github.com/friendsofgo/errors" + "github.com/volatiletech/null/v8" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" + "github.com/volatiletech/sqlboiler/v4/queries/qmhelper" + "github.com/volatiletech/strmangle" +) + +// Feed is an object representing the database table. +type Feed struct { + ID string `boil:"id" json:"id" toml:"id" yaml:"id"` + Name string `boil:"name" json:"name" toml:"name" yaml:"name"` + PlatformID string `boil:"platform_id" json:"platform_id" toml:"platform_id" yaml:"platform_id"` + CategoryID string `boil:"category_id" json:"category_id" toml:"category_id" yaml:"category_id"` + SiteURL string `boil:"site_url" json:"site_url" toml:"site_url" yaml:"site_url"` + RSSURL string `boil:"rss_url" json:"rss_url" toml:"rss_url" yaml:"rss_url"` + CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` + UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` + DeletedAt null.Time `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"` + + R *feedR `boil:"-" json:"-" toml:"-" yaml:"-"` + L feedL `boil:"-" json:"-" toml:"-" yaml:"-"` +} + +var FeedColumns = struct { + ID string + Name string + PlatformID string + CategoryID string + SiteURL string + RSSURL string + CreatedAt string + UpdatedAt string + DeletedAt string +}{ + ID: "id", + Name: "name", + PlatformID: "platform_id", + CategoryID: "category_id", + SiteURL: "site_url", + RSSURL: "rss_url", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +var FeedTableColumns = struct { + ID string + Name string + PlatformID string + CategoryID string + SiteURL string + RSSURL string + CreatedAt string + UpdatedAt string + DeletedAt string +}{ + ID: "feeds.id", + Name: "feeds.name", + PlatformID: "feeds.platform_id", + CategoryID: "feeds.category_id", + SiteURL: "feeds.site_url", + RSSURL: "feeds.rss_url", + CreatedAt: "feeds.created_at", + UpdatedAt: "feeds.updated_at", + DeletedAt: "feeds.deleted_at", +} + +// Generated where + +var FeedWhere = struct { + ID whereHelperstring + Name whereHelperstring + PlatformID whereHelperstring + CategoryID whereHelperstring + SiteURL whereHelperstring + RSSURL whereHelperstring + CreatedAt whereHelpertime_Time + UpdatedAt whereHelpertime_Time + DeletedAt whereHelpernull_Time +}{ + ID: whereHelperstring{field: "\"feeds\".\"id\""}, + Name: whereHelperstring{field: "\"feeds\".\"name\""}, + PlatformID: whereHelperstring{field: "\"feeds\".\"platform_id\""}, + CategoryID: whereHelperstring{field: "\"feeds\".\"category_id\""}, + SiteURL: whereHelperstring{field: "\"feeds\".\"site_url\""}, + RSSURL: whereHelperstring{field: "\"feeds\".\"rss_url\""}, + CreatedAt: whereHelpertime_Time{field: "\"feeds\".\"created_at\""}, + UpdatedAt: whereHelpertime_Time{field: "\"feeds\".\"updated_at\""}, + DeletedAt: whereHelpernull_Time{field: "\"feeds\".\"deleted_at\""}, +} + +// FeedRels is where relationship names are stored. +var FeedRels = struct { + Category string + Platform string + FeedArticleRelations string +}{ + Category: "Category", + Platform: "Platform", + FeedArticleRelations: "FeedArticleRelations", +} + +// feedR is where relationships are stored. +type feedR struct { + Category *Category `boil:"Category" json:"Category" toml:"Category" yaml:"Category"` + Platform *Platform `boil:"Platform" json:"Platform" toml:"Platform" yaml:"Platform"` + FeedArticleRelations FeedArticleRelationSlice `boil:"FeedArticleRelations" json:"FeedArticleRelations" toml:"FeedArticleRelations" yaml:"FeedArticleRelations"` +} + +// NewStruct creates a new relationship struct +func (*feedR) NewStruct() *feedR { + return &feedR{} +} + +func (r *feedR) GetCategory() *Category { + if r == nil { + return nil + } + return r.Category +} + +func (r *feedR) GetPlatform() *Platform { + if r == nil { + return nil + } + return r.Platform +} + +func (r *feedR) GetFeedArticleRelations() FeedArticleRelationSlice { + if r == nil { + return nil + } + return r.FeedArticleRelations +} + +// feedL is where Load methods for each relationship are stored. +type feedL struct{} + +var ( + feedAllColumns = []string{"id", "name", "platform_id", "category_id", "site_url", "rss_url", "created_at", "updated_at", "deleted_at"} + feedColumnsWithoutDefault = []string{"name", "platform_id", "category_id", "site_url", "rss_url"} + feedColumnsWithDefault = []string{"id", "created_at", "updated_at", "deleted_at"} + feedPrimaryKeyColumns = []string{"id"} + feedGeneratedColumns = []string{} +) + +type ( + // FeedSlice is an alias for a slice of pointers to Feed. + // This should almost always be used instead of []Feed. + FeedSlice []*Feed + // FeedHook is the signature for custom Feed hook methods + FeedHook func(context.Context, boil.ContextExecutor, *Feed) error + + feedQuery struct { + *queries.Query + } +) + +// Cache for insert, update and upsert +var ( + feedType = reflect.TypeOf(&Feed{}) + feedMapping = queries.MakeStructMapping(feedType) + feedPrimaryKeyMapping, _ = queries.BindMapping(feedType, feedMapping, feedPrimaryKeyColumns) + feedInsertCacheMut sync.RWMutex + feedInsertCache = make(map[string]insertCache) + feedUpdateCacheMut sync.RWMutex + feedUpdateCache = make(map[string]updateCache) + feedUpsertCacheMut sync.RWMutex + feedUpsertCache = make(map[string]insertCache) +) + +var ( + // Force time package dependency for automated UpdatedAt/CreatedAt. + _ = time.Second + // Force qmhelper dependency for where clause generation (which doesn't + // always happen) + _ = qmhelper.Where +) + +var feedAfterSelectMu sync.Mutex +var feedAfterSelectHooks []FeedHook + +var feedBeforeInsertMu sync.Mutex +var feedBeforeInsertHooks []FeedHook +var feedAfterInsertMu sync.Mutex +var feedAfterInsertHooks []FeedHook + +var feedBeforeUpdateMu sync.Mutex +var feedBeforeUpdateHooks []FeedHook +var feedAfterUpdateMu sync.Mutex +var feedAfterUpdateHooks []FeedHook + +var feedBeforeDeleteMu sync.Mutex +var feedBeforeDeleteHooks []FeedHook +var feedAfterDeleteMu sync.Mutex +var feedAfterDeleteHooks []FeedHook + +var feedBeforeUpsertMu sync.Mutex +var feedBeforeUpsertHooks []FeedHook +var feedAfterUpsertMu sync.Mutex +var feedAfterUpsertHooks []FeedHook + +// doAfterSelectHooks executes all "after Select" hooks. +func (o *Feed) doAfterSelectHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedAfterSelectHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeInsertHooks executes all "before insert" hooks. +func (o *Feed) doBeforeInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedBeforeInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterInsertHooks executes all "after Insert" hooks. +func (o *Feed) doAfterInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedAfterInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpdateHooks executes all "before Update" hooks. +func (o *Feed) doBeforeUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedBeforeUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpdateHooks executes all "after Update" hooks. +func (o *Feed) doAfterUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedAfterUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeDeleteHooks executes all "before Delete" hooks. +func (o *Feed) doBeforeDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedBeforeDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterDeleteHooks executes all "after Delete" hooks. +func (o *Feed) doAfterDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedAfterDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpsertHooks executes all "before Upsert" hooks. +func (o *Feed) doBeforeUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedBeforeUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpsertHooks executes all "after Upsert" hooks. +func (o *Feed) doAfterUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range feedAfterUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// AddFeedHook registers your hook function for all future operations. +func AddFeedHook(hookPoint boil.HookPoint, feedHook FeedHook) { + switch hookPoint { + case boil.AfterSelectHook: + feedAfterSelectMu.Lock() + feedAfterSelectHooks = append(feedAfterSelectHooks, feedHook) + feedAfterSelectMu.Unlock() + case boil.BeforeInsertHook: + feedBeforeInsertMu.Lock() + feedBeforeInsertHooks = append(feedBeforeInsertHooks, feedHook) + feedBeforeInsertMu.Unlock() + case boil.AfterInsertHook: + feedAfterInsertMu.Lock() + feedAfterInsertHooks = append(feedAfterInsertHooks, feedHook) + feedAfterInsertMu.Unlock() + case boil.BeforeUpdateHook: + feedBeforeUpdateMu.Lock() + feedBeforeUpdateHooks = append(feedBeforeUpdateHooks, feedHook) + feedBeforeUpdateMu.Unlock() + case boil.AfterUpdateHook: + feedAfterUpdateMu.Lock() + feedAfterUpdateHooks = append(feedAfterUpdateHooks, feedHook) + feedAfterUpdateMu.Unlock() + case boil.BeforeDeleteHook: + feedBeforeDeleteMu.Lock() + feedBeforeDeleteHooks = append(feedBeforeDeleteHooks, feedHook) + feedBeforeDeleteMu.Unlock() + case boil.AfterDeleteHook: + feedAfterDeleteMu.Lock() + feedAfterDeleteHooks = append(feedAfterDeleteHooks, feedHook) + feedAfterDeleteMu.Unlock() + case boil.BeforeUpsertHook: + feedBeforeUpsertMu.Lock() + feedBeforeUpsertHooks = append(feedBeforeUpsertHooks, feedHook) + feedBeforeUpsertMu.Unlock() + case boil.AfterUpsertHook: + feedAfterUpsertMu.Lock() + feedAfterUpsertHooks = append(feedAfterUpsertHooks, feedHook) + feedAfterUpsertMu.Unlock() + } +} + +// One returns a single feed record from the query. +func (q feedQuery) One(ctx context.Context, exec boil.ContextExecutor) (*Feed, error) { + o := &Feed{} + + queries.SetLimit(q.Query, 1) + + err := q.Bind(ctx, exec, o) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "entity: failed to execute a one query for feeds") + } + + if err := o.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + + return o, nil +} + +// All returns all Feed records from the query. +func (q feedQuery) All(ctx context.Context, exec boil.ContextExecutor) (FeedSlice, error) { + var o []*Feed + + err := q.Bind(ctx, exec, &o) + if err != nil { + return nil, errors.Wrap(err, "entity: failed to assign all query results to Feed slice") + } + + if len(feedAfterSelectHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + } + } + + return o, nil +} + +// Count returns the count of all Feed records in the query. +func (q feedQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return 0, errors.Wrap(err, "entity: failed to count feeds rows") + } + + return count, nil +} + +// Exists checks if the row exists in the table. +func (q feedQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + queries.SetLimit(q.Query, 1) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return false, errors.Wrap(err, "entity: failed to check if feeds exists") + } + + return count > 0, nil +} + +// Category pointed to by the foreign key. +func (o *Feed) Category(mods ...qm.QueryMod) categoryQuery { + queryMods := []qm.QueryMod{ + qm.Where("\"id\" = ?", o.CategoryID), + } + + queryMods = append(queryMods, mods...) + + return Categories(queryMods...) +} + +// Platform pointed to by the foreign key. +func (o *Feed) Platform(mods ...qm.QueryMod) platformQuery { + queryMods := []qm.QueryMod{ + qm.Where("\"id\" = ?", o.PlatformID), + } + + queryMods = append(queryMods, mods...) + + return Platforms(queryMods...) +} + +// FeedArticleRelations retrieves all the feed_article_relation's FeedArticleRelations with an executor. +func (o *Feed) FeedArticleRelations(mods ...qm.QueryMod) feedArticleRelationQuery { + var queryMods []qm.QueryMod + if len(mods) != 0 { + queryMods = append(queryMods, mods...) + } + + queryMods = append(queryMods, + qm.Where("\"feed_article_relations\".\"feed_id\"=?", o.ID), + ) + + return FeedArticleRelations(queryMods...) +} + +// LoadCategory allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for an N-1 relationship. +func (feedL) LoadCategory(ctx context.Context, e boil.ContextExecutor, singular bool, maybeFeed interface{}, mods queries.Applicator) error { + var slice []*Feed + var object *Feed + + if singular { + var ok bool + object, ok = maybeFeed.(*Feed) + if !ok { + object = new(Feed) + ok = queries.SetFromEmbeddedStruct(&object, &maybeFeed) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeFeed)) + } + } + } else { + s, ok := maybeFeed.(*[]*Feed) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeFeed) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeFeed)) + } + } + } + + args := make(map[interface{}]struct{}) + if singular { + if object.R == nil { + object.R = &feedR{} + } + args[object.CategoryID] = struct{}{} + + } else { + for _, obj := range slice { + if obj.R == nil { + obj.R = &feedR{} + } + + args[obj.CategoryID] = struct{}{} + + } + } + + if len(args) == 0 { + return nil + } + + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + + query := NewQuery( + qm.From(`categories`), + qm.WhereIn(`categories.id in ?`, argsSlice...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load Category") + } + + var resultSlice []*Category + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice Category") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results of eager load for categories") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for categories") + } + + if len(categoryAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + + if len(resultSlice) == 0 { + return nil + } + + if singular { + foreign := resultSlice[0] + object.R.Category = foreign + if foreign.R == nil { + foreign.R = &categoryR{} + } + foreign.R.Feeds = append(foreign.R.Feeds, object) + return nil + } + + for _, local := range slice { + for _, foreign := range resultSlice { + if local.CategoryID == foreign.ID { + local.R.Category = foreign + if foreign.R == nil { + foreign.R = &categoryR{} + } + foreign.R.Feeds = append(foreign.R.Feeds, local) + break + } + } + } + + return nil +} + +// LoadPlatform allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for an N-1 relationship. +func (feedL) LoadPlatform(ctx context.Context, e boil.ContextExecutor, singular bool, maybeFeed interface{}, mods queries.Applicator) error { + var slice []*Feed + var object *Feed + + if singular { + var ok bool + object, ok = maybeFeed.(*Feed) + if !ok { + object = new(Feed) + ok = queries.SetFromEmbeddedStruct(&object, &maybeFeed) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeFeed)) + } + } + } else { + s, ok := maybeFeed.(*[]*Feed) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeFeed) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeFeed)) + } + } + } + + args := make(map[interface{}]struct{}) + if singular { + if object.R == nil { + object.R = &feedR{} + } + args[object.PlatformID] = struct{}{} + + } else { + for _, obj := range slice { + if obj.R == nil { + obj.R = &feedR{} + } + + args[obj.PlatformID] = struct{}{} + + } + } + + if len(args) == 0 { + return nil + } + + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + + query := NewQuery( + qm.From(`platforms`), + qm.WhereIn(`platforms.id in ?`, argsSlice...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load Platform") + } + + var resultSlice []*Platform + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice Platform") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results of eager load for platforms") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for platforms") + } + + if len(platformAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + + if len(resultSlice) == 0 { + return nil + } + + if singular { + foreign := resultSlice[0] + object.R.Platform = foreign + if foreign.R == nil { + foreign.R = &platformR{} + } + foreign.R.Feeds = append(foreign.R.Feeds, object) + return nil + } + + for _, local := range slice { + for _, foreign := range resultSlice { + if local.PlatformID == foreign.ID { + local.R.Platform = foreign + if foreign.R == nil { + foreign.R = &platformR{} + } + foreign.R.Feeds = append(foreign.R.Feeds, local) + break + } + } + } + + return nil +} + +// LoadFeedArticleRelations allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for a 1-M or N-M relationship. +func (feedL) LoadFeedArticleRelations(ctx context.Context, e boil.ContextExecutor, singular bool, maybeFeed interface{}, mods queries.Applicator) error { + var slice []*Feed + var object *Feed + + if singular { + var ok bool + object, ok = maybeFeed.(*Feed) + if !ok { + object = new(Feed) + ok = queries.SetFromEmbeddedStruct(&object, &maybeFeed) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybeFeed)) + } + } + } else { + s, ok := maybeFeed.(*[]*Feed) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybeFeed) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybeFeed)) + } + } + } + + args := make(map[interface{}]struct{}) + if singular { + if object.R == nil { + object.R = &feedR{} + } + args[object.ID] = struct{}{} + } else { + for _, obj := range slice { + if obj.R == nil { + obj.R = &feedR{} + } + args[obj.ID] = struct{}{} + } + } + + if len(args) == 0 { + return nil + } + + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + + query := NewQuery( + qm.From(`feed_article_relations`), + qm.WhereIn(`feed_article_relations.feed_id in ?`, argsSlice...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load feed_article_relations") + } + + var resultSlice []*FeedArticleRelation + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice feed_article_relations") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results in eager load on feed_article_relations") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for feed_article_relations") + } + + if len(feedArticleRelationAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + if singular { + object.R.FeedArticleRelations = resultSlice + for _, foreign := range resultSlice { + if foreign.R == nil { + foreign.R = &feedArticleRelationR{} + } + foreign.R.Feed = object + } + return nil + } + + for _, foreign := range resultSlice { + for _, local := range slice { + if local.ID == foreign.FeedID { + local.R.FeedArticleRelations = append(local.R.FeedArticleRelations, foreign) + if foreign.R == nil { + foreign.R = &feedArticleRelationR{} + } + foreign.R.Feed = local + break + } + } + } + + return nil +} + +// SetCategory of the feed to the related item. +// Sets o.R.Category to related. +// Adds o to related.R.Feeds. +func (o *Feed) SetCategory(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Category) error { + var err error + if insert { + if err = related.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } + + updateQuery := fmt.Sprintf( + "UPDATE \"feeds\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, []string{"category_id"}), + strmangle.WhereClause("\"", "\"", 2, feedPrimaryKeyColumns), + ) + values := []interface{}{related.ID, o.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update local table") + } + + o.CategoryID = related.ID + if o.R == nil { + o.R = &feedR{ + Category: related, + } + } else { + o.R.Category = related + } + + if related.R == nil { + related.R = &categoryR{ + Feeds: FeedSlice{o}, + } + } else { + related.R.Feeds = append(related.R.Feeds, o) + } + + return nil +} + +// SetPlatform of the feed to the related item. +// Sets o.R.Platform to related. +// Adds o to related.R.Feeds. +func (o *Feed) SetPlatform(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Platform) error { + var err error + if insert { + if err = related.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } + + updateQuery := fmt.Sprintf( + "UPDATE \"feeds\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, []string{"platform_id"}), + strmangle.WhereClause("\"", "\"", 2, feedPrimaryKeyColumns), + ) + values := []interface{}{related.ID, o.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update local table") + } + + o.PlatformID = related.ID + if o.R == nil { + o.R = &feedR{ + Platform: related, + } + } else { + o.R.Platform = related + } + + if related.R == nil { + related.R = &platformR{ + Feeds: FeedSlice{o}, + } + } else { + related.R.Feeds = append(related.R.Feeds, o) + } + + return nil +} + +// AddFeedArticleRelations adds the given related objects to the existing relationships +// of the feed, optionally inserting them as new records. +// Appends related to o.R.FeedArticleRelations. +// Sets related.R.Feed appropriately. +func (o *Feed) AddFeedArticleRelations(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*FeedArticleRelation) error { + var err error + for _, rel := range related { + if insert { + rel.FeedID = o.ID + if err = rel.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } else { + updateQuery := fmt.Sprintf( + "UPDATE \"feed_article_relations\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, []string{"feed_id"}), + strmangle.WhereClause("\"", "\"", 2, feedArticleRelationPrimaryKeyColumns), + ) + values := []interface{}{o.ID, rel.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update foreign table") + } + + rel.FeedID = o.ID + } + } + + if o.R == nil { + o.R = &feedR{ + FeedArticleRelations: related, + } + } else { + o.R.FeedArticleRelations = append(o.R.FeedArticleRelations, related...) + } + + for _, rel := range related { + if rel.R == nil { + rel.R = &feedArticleRelationR{ + Feed: o, + } + } else { + rel.R.Feed = o + } + } + return nil +} + +// Feeds retrieves all the records using an executor. +func Feeds(mods ...qm.QueryMod) feedQuery { + mods = append(mods, qm.From("\"feeds\"")) + q := NewQuery(mods...) + if len(queries.GetSelect(q)) == 0 { + queries.SetSelect(q, []string{"\"feeds\".*"}) + } + + return feedQuery{q} +} + +// FindFeed retrieves a single record by ID with an executor. +// If selectCols is empty Find will return all columns. +func FindFeed(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Feed, error) { + feedObj := &Feed{} + + sel := "*" + if len(selectCols) > 0 { + sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",") + } + query := fmt.Sprintf( + "select %s from \"feeds\" where \"id\"=$1", sel, + ) + + q := queries.Raw(query, iD) + + err := q.Bind(ctx, exec, feedObj) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "entity: unable to select from feeds") + } + + if err = feedObj.doAfterSelectHooks(ctx, exec); err != nil { + return feedObj, err + } + + return feedObj, nil +} + +// Insert a single record using an executor. +// See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts. +func (o *Feed) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error { + if o == nil { + return errors.New("entity: no feeds provided for insertion") + } + + var err error + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + if o.UpdatedAt.IsZero() { + o.UpdatedAt = currTime + } + } + + if err := o.doBeforeInsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(feedColumnsWithDefault, o) + + key := makeCacheKey(columns, nzDefaults) + feedInsertCacheMut.RLock() + cache, cached := feedInsertCache[key] + feedInsertCacheMut.RUnlock() + + if !cached { + wl, returnColumns := columns.InsertColumnSet( + feedAllColumns, + feedColumnsWithDefault, + feedColumnsWithoutDefault, + nzDefaults, + ) + + cache.valueMapping, err = queries.BindMapping(feedType, feedMapping, wl) + if err != nil { + return err + } + cache.retMapping, err = queries.BindMapping(feedType, feedMapping, returnColumns) + if err != nil { + return err + } + if len(wl) != 0 { + cache.query = fmt.Sprintf("INSERT INTO \"feeds\" (\"%s\") %%sVALUES (%s)%%s", strings.Join(wl, "\",\""), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1)) + } else { + cache.query = "INSERT INTO \"feeds\" %sDEFAULT VALUES%s" + } + + var queryOutput, queryReturning string + + if len(cache.retMapping) != 0 { + queryReturning = fmt.Sprintf(" RETURNING \"%s\"", strings.Join(returnColumns, "\",\"")) + } + + cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning) + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + + if len(cache.retMapping) != 0 { + err = exec.QueryRowContext(ctx, cache.query, vals...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...) + } else { + _, err = exec.ExecContext(ctx, cache.query, vals...) + } + + if err != nil { + return errors.Wrap(err, "entity: unable to insert into feeds") + } + + if !cached { + feedInsertCacheMut.Lock() + feedInsertCache[key] = cache + feedInsertCacheMut.Unlock() + } + + return o.doAfterInsertHooks(ctx, exec) +} + +// Update uses an executor to update the Feed. +// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. +// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records. +func (o *Feed) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) { + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + o.UpdatedAt = currTime + } + + var err error + if err = o.doBeforeUpdateHooks(ctx, exec); err != nil { + return 0, err + } + key := makeCacheKey(columns, nil) + feedUpdateCacheMut.RLock() + cache, cached := feedUpdateCache[key] + feedUpdateCacheMut.RUnlock() + + if !cached { + wl := columns.UpdateColumnSet( + feedAllColumns, + feedPrimaryKeyColumns, + ) + + if !columns.IsWhitelist() { + wl = strmangle.SetComplement(wl, []string{"created_at"}) + } + if len(wl) == 0 { + return 0, errors.New("entity: unable to update feeds, could not build whitelist") + } + + cache.query = fmt.Sprintf("UPDATE \"feeds\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, wl), + strmangle.WhereClause("\"", "\"", len(wl)+1, feedPrimaryKeyColumns), + ) + cache.valueMapping, err = queries.BindMapping(feedType, feedMapping, append(wl, feedPrimaryKeyColumns...)) + if err != nil { + return 0, err + } + } + + values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, values) + } + var result sql.Result + result, err = exec.ExecContext(ctx, cache.query, values...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update feeds row") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by update for feeds") + } + + if !cached { + feedUpdateCacheMut.Lock() + feedUpdateCache[key] = cache + feedUpdateCacheMut.Unlock() + } + + return rowsAff, o.doAfterUpdateHooks(ctx, exec) +} + +// UpdateAll updates all rows with the specified column values. +func (q feedQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + queries.SetUpdate(q.Query, cols) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update all for feeds") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: unable to retrieve rows affected for feeds") + } + + return rowsAff, nil +} + +// UpdateAll updates all rows with the specified column values, using an executor. +func (o FeedSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + ln := int64(len(o)) + if ln == 0 { + return 0, nil + } + + if len(cols) == 0 { + return 0, errors.New("entity: update all requires at least one column argument") + } + + colNames := make([]string, len(cols)) + args := make([]interface{}, len(cols)) + + i := 0 + for name, value := range cols { + colNames[i] = name + args[i] = value + i++ + } + + // Append all of the primary key values for each column + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), feedPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := fmt.Sprintf("UPDATE \"feeds\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, colNames), + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, feedPrimaryKeyColumns, len(o))) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update all in feed slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: unable to retrieve rows affected all in update all feed") + } + return rowsAff, nil +} + +// Upsert attempts an insert using an executor, and does an update or ignore on conflict. +// See boil.Columns documentation for how to properly use updateColumns and insertColumns. +func (o *Feed) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error { + if o == nil { + return errors.New("entity: no feeds provided for upsert") + } + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + o.UpdatedAt = currTime + } + + if err := o.doBeforeUpsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(feedColumnsWithDefault, o) + + // Build cache key in-line uglily - mysql vs psql problems + buf := strmangle.GetBuffer() + if updateOnConflict { + buf.WriteByte('t') + } else { + buf.WriteByte('f') + } + buf.WriteByte('.') + for _, c := range conflictColumns { + buf.WriteString(c) + } + buf.WriteByte('.') + buf.WriteString(strconv.Itoa(updateColumns.Kind)) + for _, c := range updateColumns.Cols { + buf.WriteString(c) + } + buf.WriteByte('.') + buf.WriteString(strconv.Itoa(insertColumns.Kind)) + for _, c := range insertColumns.Cols { + buf.WriteString(c) + } + buf.WriteByte('.') + for _, c := range nzDefaults { + buf.WriteString(c) + } + key := buf.String() + strmangle.PutBuffer(buf) + + feedUpsertCacheMut.RLock() + cache, cached := feedUpsertCache[key] + feedUpsertCacheMut.RUnlock() + + var err error + + if !cached { + insert, _ := insertColumns.InsertColumnSet( + feedAllColumns, + feedColumnsWithDefault, + feedColumnsWithoutDefault, + nzDefaults, + ) + + update := updateColumns.UpdateColumnSet( + feedAllColumns, + feedPrimaryKeyColumns, + ) + + if updateOnConflict && len(update) == 0 { + return errors.New("entity: unable to upsert feeds, could not build update column list") + } + + ret := strmangle.SetComplement(feedAllColumns, strmangle.SetIntersect(insert, update)) + + conflict := conflictColumns + if len(conflict) == 0 && updateOnConflict && len(update) != 0 { + if len(feedPrimaryKeyColumns) == 0 { + return errors.New("entity: unable to upsert feeds, could not build conflict column list") + } + + conflict = make([]string, len(feedPrimaryKeyColumns)) + copy(conflict, feedPrimaryKeyColumns) + } + cache.query = buildUpsertQueryPostgres(dialect, "\"feeds\"", updateOnConflict, ret, update, conflict, insert, opts...) + + cache.valueMapping, err = queries.BindMapping(feedType, feedMapping, insert) + if err != nil { + return err + } + if len(ret) != 0 { + cache.retMapping, err = queries.BindMapping(feedType, feedMapping, ret) + if err != nil { + return err + } + } + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + var returns []interface{} + if len(cache.retMapping) != 0 { + returns = queries.PtrsFromMapping(value, cache.retMapping) + } + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + if len(cache.retMapping) != 0 { + err = exec.QueryRowContext(ctx, cache.query, vals...).Scan(returns...) + if errors.Is(err, sql.ErrNoRows) { + err = nil // Postgres doesn't return anything when there's no update + } + } else { + _, err = exec.ExecContext(ctx, cache.query, vals...) + } + if err != nil { + return errors.Wrap(err, "entity: unable to upsert feeds") + } + + if !cached { + feedUpsertCacheMut.Lock() + feedUpsertCache[key] = cache + feedUpsertCacheMut.Unlock() + } + + return o.doAfterUpsertHooks(ctx, exec) +} + +// Delete deletes a single Feed record with an executor. +// Delete will match against the primary key column to find the record to delete. +func (o *Feed) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if o == nil { + return 0, errors.New("entity: no Feed provided for delete") + } + + if err := o.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), feedPrimaryKeyMapping) + sql := "DELETE FROM \"feeds\" WHERE \"id\"=$1" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete from feeds") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by delete for feeds") + } + + if err := o.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + return rowsAff, nil +} + +// DeleteAll deletes all matching rows. +func (q feedQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if q.Query == nil { + return 0, errors.New("entity: no feedQuery provided for delete all") + } + + queries.SetDelete(q.Query) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete all from feeds") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by deleteall for feeds") + } + + return rowsAff, nil +} + +// DeleteAll deletes all rows in the slice, using an executor. +func (o FeedSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if len(o) == 0 { + return 0, nil + } + + if len(feedBeforeDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + var args []interface{} + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), feedPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "DELETE FROM \"feeds\" WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, feedPrimaryKeyColumns, len(o)) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete all from feed slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by deleteall for feeds") + } + + if len(feedAfterDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + return rowsAff, nil +} + +// Reload refetches the object from the database +// using the primary keys with an executor. +func (o *Feed) Reload(ctx context.Context, exec boil.ContextExecutor) error { + ret, err := FindFeed(ctx, exec, o.ID) + if err != nil { + return err + } + + *o = *ret + return nil +} + +// ReloadAll refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *FeedSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error { + if o == nil || len(*o) == 0 { + return nil + } + + slice := FeedSlice{} + var args []interface{} + for _, obj := range *o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), feedPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "SELECT \"feeds\".* FROM \"feeds\" WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, feedPrimaryKeyColumns, len(*o)) + + q := queries.Raw(sql, args...) + + err := q.Bind(ctx, exec, &slice) + if err != nil { + return errors.Wrap(err, "entity: unable to reload all in FeedSlice") + } + + *o = slice + + return nil +} + +// FeedExists checks if the Feed row exists. +func FeedExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error) { + var exists bool + sql := "select exists(select 1 from \"feeds\" where \"id\"=$1 limit 1)" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, iD) + } + row := exec.QueryRowContext(ctx, sql, iD) + + err := row.Scan(&exists) + if err != nil { + return false, errors.Wrap(err, "entity: unable to check if feeds exists") + } + + return exists, nil +} + +// Exists checks if the Feed row exists. +func (o *Feed) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + return FeedExists(ctx, exec, o.ID) +} diff --git a/batch-service/entity/platforms.go b/batch-service/entity/platforms.go new file mode 100644 index 00000000..0d189266 --- /dev/null +++ b/batch-service/entity/platforms.go @@ -0,0 +1,1193 @@ +// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package entity + +import ( + "context" + "database/sql" + "fmt" + "reflect" + "strconv" + "strings" + "sync" + "time" + + "github.com/friendsofgo/errors" + "github.com/volatiletech/null/v8" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries" + "github.com/volatiletech/sqlboiler/v4/queries/qm" + "github.com/volatiletech/sqlboiler/v4/queries/qmhelper" + "github.com/volatiletech/strmangle" +) + +// Platform is an object representing the database table. +type Platform struct { + ID string `boil:"id" json:"id" toml:"id" yaml:"id"` + Name string `boil:"name" json:"name" toml:"name" yaml:"name"` + SiteURL string `boil:"site_url" json:"site_url" toml:"site_url" yaml:"site_url"` + PlatformType int `boil:"platform_type" json:"platform_type" toml:"platform_type" yaml:"platform_type"` + FaviconURL string `boil:"favicon_url" json:"favicon_url" toml:"favicon_url" yaml:"favicon_url"` + IsEng bool `boil:"is_eng" json:"is_eng" toml:"is_eng" yaml:"is_eng"` + CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` + UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` + DeletedAt null.Time `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"` + + R *platformR `boil:"-" json:"-" toml:"-" yaml:"-"` + L platformL `boil:"-" json:"-" toml:"-" yaml:"-"` +} + +var PlatformColumns = struct { + ID string + Name string + SiteURL string + PlatformType string + FaviconURL string + IsEng string + CreatedAt string + UpdatedAt string + DeletedAt string +}{ + ID: "id", + Name: "name", + SiteURL: "site_url", + PlatformType: "platform_type", + FaviconURL: "favicon_url", + IsEng: "is_eng", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +var PlatformTableColumns = struct { + ID string + Name string + SiteURL string + PlatformType string + FaviconURL string + IsEng string + CreatedAt string + UpdatedAt string + DeletedAt string +}{ + ID: "platforms.id", + Name: "platforms.name", + SiteURL: "platforms.site_url", + PlatformType: "platforms.platform_type", + FaviconURL: "platforms.favicon_url", + IsEng: "platforms.is_eng", + CreatedAt: "platforms.created_at", + UpdatedAt: "platforms.updated_at", + DeletedAt: "platforms.deleted_at", +} + +// Generated where + +var PlatformWhere = struct { + ID whereHelperstring + Name whereHelperstring + SiteURL whereHelperstring + PlatformType whereHelperint + FaviconURL whereHelperstring + IsEng whereHelperbool + CreatedAt whereHelpertime_Time + UpdatedAt whereHelpertime_Time + DeletedAt whereHelpernull_Time +}{ + ID: whereHelperstring{field: "\"platforms\".\"id\""}, + Name: whereHelperstring{field: "\"platforms\".\"name\""}, + SiteURL: whereHelperstring{field: "\"platforms\".\"site_url\""}, + PlatformType: whereHelperint{field: "\"platforms\".\"platform_type\""}, + FaviconURL: whereHelperstring{field: "\"platforms\".\"favicon_url\""}, + IsEng: whereHelperbool{field: "\"platforms\".\"is_eng\""}, + CreatedAt: whereHelpertime_Time{field: "\"platforms\".\"created_at\""}, + UpdatedAt: whereHelpertime_Time{field: "\"platforms\".\"updated_at\""}, + DeletedAt: whereHelpernull_Time{field: "\"platforms\".\"deleted_at\""}, +} + +// PlatformRels is where relationship names are stored. +var PlatformRels = struct { + Feeds string +}{ + Feeds: "Feeds", +} + +// platformR is where relationships are stored. +type platformR struct { + Feeds FeedSlice `boil:"Feeds" json:"Feeds" toml:"Feeds" yaml:"Feeds"` +} + +// NewStruct creates a new relationship struct +func (*platformR) NewStruct() *platformR { + return &platformR{} +} + +func (r *platformR) GetFeeds() FeedSlice { + if r == nil { + return nil + } + return r.Feeds +} + +// platformL is where Load methods for each relationship are stored. +type platformL struct{} + +var ( + platformAllColumns = []string{"id", "name", "site_url", "platform_type", "favicon_url", "is_eng", "created_at", "updated_at", "deleted_at"} + platformColumnsWithoutDefault = []string{"name", "site_url", "platform_type", "favicon_url"} + platformColumnsWithDefault = []string{"id", "is_eng", "created_at", "updated_at", "deleted_at"} + platformPrimaryKeyColumns = []string{"id"} + platformGeneratedColumns = []string{} +) + +type ( + // PlatformSlice is an alias for a slice of pointers to Platform. + // This should almost always be used instead of []Platform. + PlatformSlice []*Platform + // PlatformHook is the signature for custom Platform hook methods + PlatformHook func(context.Context, boil.ContextExecutor, *Platform) error + + platformQuery struct { + *queries.Query + } +) + +// Cache for insert, update and upsert +var ( + platformType = reflect.TypeOf(&Platform{}) + platformMapping = queries.MakeStructMapping(platformType) + platformPrimaryKeyMapping, _ = queries.BindMapping(platformType, platformMapping, platformPrimaryKeyColumns) + platformInsertCacheMut sync.RWMutex + platformInsertCache = make(map[string]insertCache) + platformUpdateCacheMut sync.RWMutex + platformUpdateCache = make(map[string]updateCache) + platformUpsertCacheMut sync.RWMutex + platformUpsertCache = make(map[string]insertCache) +) + +var ( + // Force time package dependency for automated UpdatedAt/CreatedAt. + _ = time.Second + // Force qmhelper dependency for where clause generation (which doesn't + // always happen) + _ = qmhelper.Where +) + +var platformAfterSelectMu sync.Mutex +var platformAfterSelectHooks []PlatformHook + +var platformBeforeInsertMu sync.Mutex +var platformBeforeInsertHooks []PlatformHook +var platformAfterInsertMu sync.Mutex +var platformAfterInsertHooks []PlatformHook + +var platformBeforeUpdateMu sync.Mutex +var platformBeforeUpdateHooks []PlatformHook +var platformAfterUpdateMu sync.Mutex +var platformAfterUpdateHooks []PlatformHook + +var platformBeforeDeleteMu sync.Mutex +var platformBeforeDeleteHooks []PlatformHook +var platformAfterDeleteMu sync.Mutex +var platformAfterDeleteHooks []PlatformHook + +var platformBeforeUpsertMu sync.Mutex +var platformBeforeUpsertHooks []PlatformHook +var platformAfterUpsertMu sync.Mutex +var platformAfterUpsertHooks []PlatformHook + +// doAfterSelectHooks executes all "after Select" hooks. +func (o *Platform) doAfterSelectHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range platformAfterSelectHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeInsertHooks executes all "before insert" hooks. +func (o *Platform) doBeforeInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range platformBeforeInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterInsertHooks executes all "after Insert" hooks. +func (o *Platform) doAfterInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range platformAfterInsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpdateHooks executes all "before Update" hooks. +func (o *Platform) doBeforeUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range platformBeforeUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpdateHooks executes all "after Update" hooks. +func (o *Platform) doAfterUpdateHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range platformAfterUpdateHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeDeleteHooks executes all "before Delete" hooks. +func (o *Platform) doBeforeDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range platformBeforeDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterDeleteHooks executes all "after Delete" hooks. +func (o *Platform) doAfterDeleteHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range platformAfterDeleteHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doBeforeUpsertHooks executes all "before Upsert" hooks. +func (o *Platform) doBeforeUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range platformBeforeUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// doAfterUpsertHooks executes all "after Upsert" hooks. +func (o *Platform) doAfterUpsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) { + if boil.HooksAreSkipped(ctx) { + return nil + } + + for _, hook := range platformAfterUpsertHooks { + if err := hook(ctx, exec, o); err != nil { + return err + } + } + + return nil +} + +// AddPlatformHook registers your hook function for all future operations. +func AddPlatformHook(hookPoint boil.HookPoint, platformHook PlatformHook) { + switch hookPoint { + case boil.AfterSelectHook: + platformAfterSelectMu.Lock() + platformAfterSelectHooks = append(platformAfterSelectHooks, platformHook) + platformAfterSelectMu.Unlock() + case boil.BeforeInsertHook: + platformBeforeInsertMu.Lock() + platformBeforeInsertHooks = append(platformBeforeInsertHooks, platformHook) + platformBeforeInsertMu.Unlock() + case boil.AfterInsertHook: + platformAfterInsertMu.Lock() + platformAfterInsertHooks = append(platformAfterInsertHooks, platformHook) + platformAfterInsertMu.Unlock() + case boil.BeforeUpdateHook: + platformBeforeUpdateMu.Lock() + platformBeforeUpdateHooks = append(platformBeforeUpdateHooks, platformHook) + platformBeforeUpdateMu.Unlock() + case boil.AfterUpdateHook: + platformAfterUpdateMu.Lock() + platformAfterUpdateHooks = append(platformAfterUpdateHooks, platformHook) + platformAfterUpdateMu.Unlock() + case boil.BeforeDeleteHook: + platformBeforeDeleteMu.Lock() + platformBeforeDeleteHooks = append(platformBeforeDeleteHooks, platformHook) + platformBeforeDeleteMu.Unlock() + case boil.AfterDeleteHook: + platformAfterDeleteMu.Lock() + platformAfterDeleteHooks = append(platformAfterDeleteHooks, platformHook) + platformAfterDeleteMu.Unlock() + case boil.BeforeUpsertHook: + platformBeforeUpsertMu.Lock() + platformBeforeUpsertHooks = append(platformBeforeUpsertHooks, platformHook) + platformBeforeUpsertMu.Unlock() + case boil.AfterUpsertHook: + platformAfterUpsertMu.Lock() + platformAfterUpsertHooks = append(platformAfterUpsertHooks, platformHook) + platformAfterUpsertMu.Unlock() + } +} + +// One returns a single platform record from the query. +func (q platformQuery) One(ctx context.Context, exec boil.ContextExecutor) (*Platform, error) { + o := &Platform{} + + queries.SetLimit(q.Query, 1) + + err := q.Bind(ctx, exec, o) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "entity: failed to execute a one query for platforms") + } + + if err := o.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + + return o, nil +} + +// All returns all Platform records from the query. +func (q platformQuery) All(ctx context.Context, exec boil.ContextExecutor) (PlatformSlice, error) { + var o []*Platform + + err := q.Bind(ctx, exec, &o) + if err != nil { + return nil, errors.Wrap(err, "entity: failed to assign all query results to Platform slice") + } + + if len(platformAfterSelectHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterSelectHooks(ctx, exec); err != nil { + return o, err + } + } + } + + return o, nil +} + +// Count returns the count of all Platform records in the query. +func (q platformQuery) Count(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return 0, errors.Wrap(err, "entity: failed to count platforms rows") + } + + return count, nil +} + +// Exists checks if the row exists in the table. +func (q platformQuery) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + var count int64 + + queries.SetSelect(q.Query, nil) + queries.SetCount(q.Query) + queries.SetLimit(q.Query, 1) + + err := q.Query.QueryRowContext(ctx, exec).Scan(&count) + if err != nil { + return false, errors.Wrap(err, "entity: failed to check if platforms exists") + } + + return count > 0, nil +} + +// Feeds retrieves all the feed's Feeds with an executor. +func (o *Platform) Feeds(mods ...qm.QueryMod) feedQuery { + var queryMods []qm.QueryMod + if len(mods) != 0 { + queryMods = append(queryMods, mods...) + } + + queryMods = append(queryMods, + qm.Where("\"feeds\".\"platform_id\"=?", o.ID), + ) + + return Feeds(queryMods...) +} + +// LoadFeeds allows an eager lookup of values, cached into the +// loaded structs of the objects. This is for a 1-M or N-M relationship. +func (platformL) LoadFeeds(ctx context.Context, e boil.ContextExecutor, singular bool, maybePlatform interface{}, mods queries.Applicator) error { + var slice []*Platform + var object *Platform + + if singular { + var ok bool + object, ok = maybePlatform.(*Platform) + if !ok { + object = new(Platform) + ok = queries.SetFromEmbeddedStruct(&object, &maybePlatform) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", object, maybePlatform)) + } + } + } else { + s, ok := maybePlatform.(*[]*Platform) + if ok { + slice = *s + } else { + ok = queries.SetFromEmbeddedStruct(&slice, maybePlatform) + if !ok { + return errors.New(fmt.Sprintf("failed to set %T from embedded struct %T", slice, maybePlatform)) + } + } + } + + args := make(map[interface{}]struct{}) + if singular { + if object.R == nil { + object.R = &platformR{} + } + args[object.ID] = struct{}{} + } else { + for _, obj := range slice { + if obj.R == nil { + obj.R = &platformR{} + } + args[obj.ID] = struct{}{} + } + } + + if len(args) == 0 { + return nil + } + + argsSlice := make([]interface{}, len(args)) + i := 0 + for arg := range args { + argsSlice[i] = arg + i++ + } + + query := NewQuery( + qm.From(`feeds`), + qm.WhereIn(`feeds.platform_id in ?`, argsSlice...), + ) + if mods != nil { + mods.Apply(query) + } + + results, err := query.QueryContext(ctx, e) + if err != nil { + return errors.Wrap(err, "failed to eager load feeds") + } + + var resultSlice []*Feed + if err = queries.Bind(results, &resultSlice); err != nil { + return errors.Wrap(err, "failed to bind eager loaded slice feeds") + } + + if err = results.Close(); err != nil { + return errors.Wrap(err, "failed to close results in eager load on feeds") + } + if err = results.Err(); err != nil { + return errors.Wrap(err, "error occurred during iteration of eager loaded relations for feeds") + } + + if len(feedAfterSelectHooks) != 0 { + for _, obj := range resultSlice { + if err := obj.doAfterSelectHooks(ctx, e); err != nil { + return err + } + } + } + if singular { + object.R.Feeds = resultSlice + for _, foreign := range resultSlice { + if foreign.R == nil { + foreign.R = &feedR{} + } + foreign.R.Platform = object + } + return nil + } + + for _, foreign := range resultSlice { + for _, local := range slice { + if local.ID == foreign.PlatformID { + local.R.Feeds = append(local.R.Feeds, foreign) + if foreign.R == nil { + foreign.R = &feedR{} + } + foreign.R.Platform = local + break + } + } + } + + return nil +} + +// AddFeeds adds the given related objects to the existing relationships +// of the platform, optionally inserting them as new records. +// Appends related to o.R.Feeds. +// Sets related.R.Platform appropriately. +func (o *Platform) AddFeeds(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Feed) error { + var err error + for _, rel := range related { + if insert { + rel.PlatformID = o.ID + if err = rel.Insert(ctx, exec, boil.Infer()); err != nil { + return errors.Wrap(err, "failed to insert into foreign table") + } + } else { + updateQuery := fmt.Sprintf( + "UPDATE \"feeds\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, []string{"platform_id"}), + strmangle.WhereClause("\"", "\"", 2, feedPrimaryKeyColumns), + ) + values := []interface{}{o.ID, rel.ID} + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, updateQuery) + fmt.Fprintln(writer, values) + } + if _, err = exec.ExecContext(ctx, updateQuery, values...); err != nil { + return errors.Wrap(err, "failed to update foreign table") + } + + rel.PlatformID = o.ID + } + } + + if o.R == nil { + o.R = &platformR{ + Feeds: related, + } + } else { + o.R.Feeds = append(o.R.Feeds, related...) + } + + for _, rel := range related { + if rel.R == nil { + rel.R = &feedR{ + Platform: o, + } + } else { + rel.R.Platform = o + } + } + return nil +} + +// Platforms retrieves all the records using an executor. +func Platforms(mods ...qm.QueryMod) platformQuery { + mods = append(mods, qm.From("\"platforms\"")) + q := NewQuery(mods...) + if len(queries.GetSelect(q)) == 0 { + queries.SetSelect(q, []string{"\"platforms\".*"}) + } + + return platformQuery{q} +} + +// FindPlatform retrieves a single record by ID with an executor. +// If selectCols is empty Find will return all columns. +func FindPlatform(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Platform, error) { + platformObj := &Platform{} + + sel := "*" + if len(selectCols) > 0 { + sel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), ",") + } + query := fmt.Sprintf( + "select %s from \"platforms\" where \"id\"=$1", sel, + ) + + q := queries.Raw(query, iD) + + err := q.Bind(ctx, exec, platformObj) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + return nil, sql.ErrNoRows + } + return nil, errors.Wrap(err, "entity: unable to select from platforms") + } + + if err = platformObj.doAfterSelectHooks(ctx, exec); err != nil { + return platformObj, err + } + + return platformObj, nil +} + +// Insert a single record using an executor. +// See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts. +func (o *Platform) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error { + if o == nil { + return errors.New("entity: no platforms provided for insertion") + } + + var err error + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + if o.UpdatedAt.IsZero() { + o.UpdatedAt = currTime + } + } + + if err := o.doBeforeInsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(platformColumnsWithDefault, o) + + key := makeCacheKey(columns, nzDefaults) + platformInsertCacheMut.RLock() + cache, cached := platformInsertCache[key] + platformInsertCacheMut.RUnlock() + + if !cached { + wl, returnColumns := columns.InsertColumnSet( + platformAllColumns, + platformColumnsWithDefault, + platformColumnsWithoutDefault, + nzDefaults, + ) + + cache.valueMapping, err = queries.BindMapping(platformType, platformMapping, wl) + if err != nil { + return err + } + cache.retMapping, err = queries.BindMapping(platformType, platformMapping, returnColumns) + if err != nil { + return err + } + if len(wl) != 0 { + cache.query = fmt.Sprintf("INSERT INTO \"platforms\" (\"%s\") %%sVALUES (%s)%%s", strings.Join(wl, "\",\""), strmangle.Placeholders(dialect.UseIndexPlaceholders, len(wl), 1, 1)) + } else { + cache.query = "INSERT INTO \"platforms\" %sDEFAULT VALUES%s" + } + + var queryOutput, queryReturning string + + if len(cache.retMapping) != 0 { + queryReturning = fmt.Sprintf(" RETURNING \"%s\"", strings.Join(returnColumns, "\",\"")) + } + + cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning) + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + + if len(cache.retMapping) != 0 { + err = exec.QueryRowContext(ctx, cache.query, vals...).Scan(queries.PtrsFromMapping(value, cache.retMapping)...) + } else { + _, err = exec.ExecContext(ctx, cache.query, vals...) + } + + if err != nil { + return errors.Wrap(err, "entity: unable to insert into platforms") + } + + if !cached { + platformInsertCacheMut.Lock() + platformInsertCache[key] = cache + platformInsertCacheMut.Unlock() + } + + return o.doAfterInsertHooks(ctx, exec) +} + +// Update uses an executor to update the Platform. +// See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. +// Update does not automatically update the record in case of default values. Use .Reload() to refresh the records. +func (o *Platform) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) { + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + o.UpdatedAt = currTime + } + + var err error + if err = o.doBeforeUpdateHooks(ctx, exec); err != nil { + return 0, err + } + key := makeCacheKey(columns, nil) + platformUpdateCacheMut.RLock() + cache, cached := platformUpdateCache[key] + platformUpdateCacheMut.RUnlock() + + if !cached { + wl := columns.UpdateColumnSet( + platformAllColumns, + platformPrimaryKeyColumns, + ) + + if !columns.IsWhitelist() { + wl = strmangle.SetComplement(wl, []string{"created_at"}) + } + if len(wl) == 0 { + return 0, errors.New("entity: unable to update platforms, could not build whitelist") + } + + cache.query = fmt.Sprintf("UPDATE \"platforms\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, wl), + strmangle.WhereClause("\"", "\"", len(wl)+1, platformPrimaryKeyColumns), + ) + cache.valueMapping, err = queries.BindMapping(platformType, platformMapping, append(wl, platformPrimaryKeyColumns...)) + if err != nil { + return 0, err + } + } + + values := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, values) + } + var result sql.Result + result, err = exec.ExecContext(ctx, cache.query, values...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update platforms row") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by update for platforms") + } + + if !cached { + platformUpdateCacheMut.Lock() + platformUpdateCache[key] = cache + platformUpdateCacheMut.Unlock() + } + + return rowsAff, o.doAfterUpdateHooks(ctx, exec) +} + +// UpdateAll updates all rows with the specified column values. +func (q platformQuery) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + queries.SetUpdate(q.Query, cols) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update all for platforms") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: unable to retrieve rows affected for platforms") + } + + return rowsAff, nil +} + +// UpdateAll updates all rows with the specified column values, using an executor. +func (o PlatformSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) { + ln := int64(len(o)) + if ln == 0 { + return 0, nil + } + + if len(cols) == 0 { + return 0, errors.New("entity: update all requires at least one column argument") + } + + colNames := make([]string, len(cols)) + args := make([]interface{}, len(cols)) + + i := 0 + for name, value := range cols { + colNames[i] = name + args[i] = value + i++ + } + + // Append all of the primary key values for each column + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), platformPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := fmt.Sprintf("UPDATE \"platforms\" SET %s WHERE %s", + strmangle.SetParamNames("\"", "\"", 1, colNames), + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), len(colNames)+1, platformPrimaryKeyColumns, len(o))) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to update all in platform slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: unable to retrieve rows affected all in update all platform") + } + return rowsAff, nil +} + +// Upsert attempts an insert using an executor, and does an update or ignore on conflict. +// See boil.Columns documentation for how to properly use updateColumns and insertColumns. +func (o *Platform) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error { + if o == nil { + return errors.New("entity: no platforms provided for upsert") + } + if !boil.TimestampsAreSkipped(ctx) { + currTime := time.Now().In(boil.GetLocation()) + + if o.CreatedAt.IsZero() { + o.CreatedAt = currTime + } + o.UpdatedAt = currTime + } + + if err := o.doBeforeUpsertHooks(ctx, exec); err != nil { + return err + } + + nzDefaults := queries.NonZeroDefaultSet(platformColumnsWithDefault, o) + + // Build cache key in-line uglily - mysql vs psql problems + buf := strmangle.GetBuffer() + if updateOnConflict { + buf.WriteByte('t') + } else { + buf.WriteByte('f') + } + buf.WriteByte('.') + for _, c := range conflictColumns { + buf.WriteString(c) + } + buf.WriteByte('.') + buf.WriteString(strconv.Itoa(updateColumns.Kind)) + for _, c := range updateColumns.Cols { + buf.WriteString(c) + } + buf.WriteByte('.') + buf.WriteString(strconv.Itoa(insertColumns.Kind)) + for _, c := range insertColumns.Cols { + buf.WriteString(c) + } + buf.WriteByte('.') + for _, c := range nzDefaults { + buf.WriteString(c) + } + key := buf.String() + strmangle.PutBuffer(buf) + + platformUpsertCacheMut.RLock() + cache, cached := platformUpsertCache[key] + platformUpsertCacheMut.RUnlock() + + var err error + + if !cached { + insert, _ := insertColumns.InsertColumnSet( + platformAllColumns, + platformColumnsWithDefault, + platformColumnsWithoutDefault, + nzDefaults, + ) + + update := updateColumns.UpdateColumnSet( + platformAllColumns, + platformPrimaryKeyColumns, + ) + + if updateOnConflict && len(update) == 0 { + return errors.New("entity: unable to upsert platforms, could not build update column list") + } + + ret := strmangle.SetComplement(platformAllColumns, strmangle.SetIntersect(insert, update)) + + conflict := conflictColumns + if len(conflict) == 0 && updateOnConflict && len(update) != 0 { + if len(platformPrimaryKeyColumns) == 0 { + return errors.New("entity: unable to upsert platforms, could not build conflict column list") + } + + conflict = make([]string, len(platformPrimaryKeyColumns)) + copy(conflict, platformPrimaryKeyColumns) + } + cache.query = buildUpsertQueryPostgres(dialect, "\"platforms\"", updateOnConflict, ret, update, conflict, insert, opts...) + + cache.valueMapping, err = queries.BindMapping(platformType, platformMapping, insert) + if err != nil { + return err + } + if len(ret) != 0 { + cache.retMapping, err = queries.BindMapping(platformType, platformMapping, ret) + if err != nil { + return err + } + } + } + + value := reflect.Indirect(reflect.ValueOf(o)) + vals := queries.ValuesFromMapping(value, cache.valueMapping) + var returns []interface{} + if len(cache.retMapping) != 0 { + returns = queries.PtrsFromMapping(value, cache.retMapping) + } + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, cache.query) + fmt.Fprintln(writer, vals) + } + if len(cache.retMapping) != 0 { + err = exec.QueryRowContext(ctx, cache.query, vals...).Scan(returns...) + if errors.Is(err, sql.ErrNoRows) { + err = nil // Postgres doesn't return anything when there's no update + } + } else { + _, err = exec.ExecContext(ctx, cache.query, vals...) + } + if err != nil { + return errors.Wrap(err, "entity: unable to upsert platforms") + } + + if !cached { + platformUpsertCacheMut.Lock() + platformUpsertCache[key] = cache + platformUpsertCacheMut.Unlock() + } + + return o.doAfterUpsertHooks(ctx, exec) +} + +// Delete deletes a single Platform record with an executor. +// Delete will match against the primary key column to find the record to delete. +func (o *Platform) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if o == nil { + return 0, errors.New("entity: no Platform provided for delete") + } + + if err := o.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + args := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), platformPrimaryKeyMapping) + sql := "DELETE FROM \"platforms\" WHERE \"id\"=$1" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args...) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete from platforms") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by delete for platforms") + } + + if err := o.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + + return rowsAff, nil +} + +// DeleteAll deletes all matching rows. +func (q platformQuery) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if q.Query == nil { + return 0, errors.New("entity: no platformQuery provided for delete all") + } + + queries.SetDelete(q.Query) + + result, err := q.Query.ExecContext(ctx, exec) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete all from platforms") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by deleteall for platforms") + } + + return rowsAff, nil +} + +// DeleteAll deletes all rows in the slice, using an executor. +func (o PlatformSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error) { + if len(o) == 0 { + return 0, nil + } + + if len(platformBeforeDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doBeforeDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + var args []interface{} + for _, obj := range o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), platformPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "DELETE FROM \"platforms\" WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, platformPrimaryKeyColumns, len(o)) + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, args) + } + result, err := exec.ExecContext(ctx, sql, args...) + if err != nil { + return 0, errors.Wrap(err, "entity: unable to delete all from platform slice") + } + + rowsAff, err := result.RowsAffected() + if err != nil { + return 0, errors.Wrap(err, "entity: failed to get rows affected by deleteall for platforms") + } + + if len(platformAfterDeleteHooks) != 0 { + for _, obj := range o { + if err := obj.doAfterDeleteHooks(ctx, exec); err != nil { + return 0, err + } + } + } + + return rowsAff, nil +} + +// Reload refetches the object from the database +// using the primary keys with an executor. +func (o *Platform) Reload(ctx context.Context, exec boil.ContextExecutor) error { + ret, err := FindPlatform(ctx, exec, o.ID) + if err != nil { + return err + } + + *o = *ret + return nil +} + +// ReloadAll refetches every row with matching primary key column values +// and overwrites the original object slice with the newly updated slice. +func (o *PlatformSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error { + if o == nil || len(*o) == 0 { + return nil + } + + slice := PlatformSlice{} + var args []interface{} + for _, obj := range *o { + pkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), platformPrimaryKeyMapping) + args = append(args, pkeyArgs...) + } + + sql := "SELECT \"platforms\".* FROM \"platforms\" WHERE " + + strmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 1, platformPrimaryKeyColumns, len(*o)) + + q := queries.Raw(sql, args...) + + err := q.Bind(ctx, exec, &slice) + if err != nil { + return errors.Wrap(err, "entity: unable to reload all in PlatformSlice") + } + + *o = slice + + return nil +} + +// PlatformExists checks if the Platform row exists. +func PlatformExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error) { + var exists bool + sql := "select exists(select 1 from \"platforms\" where \"id\"=$1 limit 1)" + + if boil.IsDebug(ctx) { + writer := boil.DebugWriterFrom(ctx) + fmt.Fprintln(writer, sql) + fmt.Fprintln(writer, iD) + } + row := exec.QueryRowContext(ctx, sql, iD) + + err := row.Scan(&exists) + if err != nil { + return false, errors.Wrap(err, "entity: unable to check if platforms exists") + } + + return exists, nil +} + +// Exists checks if the Platform row exists. +func (o *Platform) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error) { + return PlatformExists(ctx, exec, o.ID) +} diff --git a/batch-service/entity/psql_upsert.go b/batch-service/entity/psql_upsert.go new file mode 100644 index 00000000..69b98ce0 --- /dev/null +++ b/batch-service/entity/psql_upsert.go @@ -0,0 +1,99 @@ +// Code generated by SQLBoiler 4.16.2 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT. +// This file is meant to be re-generated in place and/or deleted at any time. + +package entity + +import ( + "fmt" + "strings" + + "github.com/volatiletech/sqlboiler/v4/drivers" + "github.com/volatiletech/strmangle" +) + +type UpsertOptions struct { + conflictTarget string + updateSet string +} + +type UpsertOptionFunc func(o *UpsertOptions) + +func UpsertConflictTarget(conflictTarget string) UpsertOptionFunc { + return func(o *UpsertOptions) { + o.conflictTarget = conflictTarget + } +} + +func UpsertUpdateSet(updateSet string) UpsertOptionFunc { + return func(o *UpsertOptions) { + o.updateSet = updateSet + } +} + +// buildUpsertQueryPostgres builds a SQL statement string using the upsertData provided. +func buildUpsertQueryPostgres(dia drivers.Dialect, tableName string, updateOnConflict bool, ret, update, conflict, whitelist []string, opts ...UpsertOptionFunc) string { + conflict = strmangle.IdentQuoteSlice(dia.LQ, dia.RQ, conflict) + whitelist = strmangle.IdentQuoteSlice(dia.LQ, dia.RQ, whitelist) + ret = strmangle.IdentQuoteSlice(dia.LQ, dia.RQ, ret) + + upsertOpts := &UpsertOptions{} + for _, o := range opts { + o(upsertOpts) + } + + buf := strmangle.GetBuffer() + defer strmangle.PutBuffer(buf) + + columns := "DEFAULT VALUES" + if len(whitelist) != 0 { + columns = fmt.Sprintf("(%s) VALUES (%s)", + strings.Join(whitelist, ", "), + strmangle.Placeholders(dia.UseIndexPlaceholders, len(whitelist), 1, 1)) + } + + fmt.Fprintf( + buf, + "INSERT INTO %s %s ON CONFLICT ", + tableName, + columns, + ) + + if upsertOpts.conflictTarget != "" { + buf.WriteString(upsertOpts.conflictTarget) + } else if len(conflict) != 0 { + buf.WriteByte('(') + buf.WriteString(strings.Join(conflict, ", ")) + buf.WriteByte(')') + } + buf.WriteByte(' ') + + if !updateOnConflict || len(update) == 0 { + buf.WriteString("DO NOTHING") + } else { + buf.WriteString("DO UPDATE SET ") + + if upsertOpts.updateSet != "" { + buf.WriteString(upsertOpts.updateSet) + } else { + for i, v := range update { + if len(v) == 0 { + continue + } + if i != 0 { + buf.WriteByte(',') + } + quoted := strmangle.IdentQuote(dia.LQ, dia.RQ, v) + buf.WriteString(quoted) + buf.WriteString(" = EXCLUDED.") + buf.WriteString(quoted) + } + } + } + + if len(ret) != 0 { + buf.WriteString(" RETURNING ") + buf.WriteString(strings.Join(ret, ", ")) + } + + return buf.String() +} diff --git a/batch-service/go.mod b/batch-service/go.mod index 0d0f1724..0427c99b 100644 --- a/batch-service/go.mod +++ b/batch-service/go.mod @@ -7,10 +7,14 @@ require ( firebase.google.com/go v3.13.0+incompatible github.com/Songmu/go-httpdate v1.0.0 github.com/advancedlogic/GoOse v0.0.0-20231203033844-ae6b36caf275 + github.com/friendsofgo/errors v0.9.2 github.com/google/uuid v1.6.0 github.com/joho/godotenv v1.5.1 github.com/mmcdole/gofeed v1.3.0 github.com/otiai10/opengraph v1.1.3 + github.com/volatiletech/null/v8 v8.1.2 + github.com/volatiletech/sqlboiler/v4 v4.16.2 + github.com/volatiletech/strmangle v0.0.6 google.golang.org/api v0.167.0 ) @@ -30,6 +34,7 @@ require ( github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-resty/resty/v2 v2.0.0 // indirect + github.com/gofrs/uuid v4.2.0+incompatible // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/s2a-go v0.1.7 // indirect @@ -37,13 +42,17 @@ require ( github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/lib/pq v1.10.9 // indirect github.com/mattn/go-runewidth v0.0.3 // indirect github.com/mmcdole/goxpp v1.1.1-0.20240225020742-a0c311522b23 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/olekukonko/tablewriter v0.0.0-20180506121414-d4647c9c7a84 // indirect - github.com/pkg/errors v0.8.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/spf13/cast v1.5.0 // indirect github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect + github.com/volatiletech/inflect v0.0.1 // indirect + github.com/volatiletech/randomize v0.0.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect @@ -57,6 +66,7 @@ require ( golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect + golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240304161311-37d4d3c04a78 // indirect diff --git a/batch-service/go.sum b/batch-service/go.sum index e813e071..b8d74ec3 100644 --- a/batch-service/go.sum +++ b/batch-service/go.sum @@ -1,21 +1,88 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/firestore v1.15.0 h1:/k8ppuWOtNuDHt2tsRV42yI21uaGnKDEQnRFeBpbFF8= cloud.google.com/go/firestore v1.15.0/go.mod h1:GWOxFXcv8GZUtYpWHw/w6IuYNux/BtmeVTMmjrm4yhk= cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/longrunning v0.5.5 h1:GOE6pZFdSrTb4KAiKnXsJBtlE6mEyaW44oKyMILWnOg= cloud.google.com/go/longrunning v0.5.5/go.mod h1:WV2LAxD8/rg5Z1cNW6FJ/ZpX4E4VnDnoTk0yawPBB7s= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4= firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DATA-DOG/go-sqlmock v1.4.1 h1:ThlnYciV1iM/V0OSF/dtkqWb6xo5qITT1TJBG1MRDJM= +github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/goquery v1.4.1/go.mod h1:T9ezsOHcCrDCgA8aF1Cqr3sSYbO/xgdy8/R/XiIMAhA= github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U= github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI= @@ -23,32 +90,96 @@ github.com/Songmu/go-httpdate v1.0.0 h1:39S00oyg9q+kMso2ahhK4pvD4EXk4zQWzt/AMqGl github.com/Songmu/go-httpdate v1.0.0/go.mod h1:QPvdlIAR7M8UtklJx5CMOOCIq7hbx2QdxyEPvTF5QVs= github.com/advancedlogic/GoOse v0.0.0-20231203033844-ae6b36caf275 h1:Kuhf+w+ilOGoXaR4O4nZ6Dp+ZS83LdANUjwyMXsPGX4= github.com/advancedlogic/GoOse v0.0.0-20231203033844-ae6b36caf275/go.mod h1:98NztIIMIntZGtQVIs8H85Q5b88fTbwWFbLz/lM9/xU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apmckinlay/gsuneido v0.0.0-20190404155041-0b6cd442a18f/go.mod h1:JU2DOj5Fc6rol0yaT79Csr47QR0vONGwJtBNGRD7jmc= github.com/araddon/dateparse v0.0.0-20180729174819-cfd92a431d0e h1:s05JG2GwtJMHaPcXDpo4V35TFgyYZzNsmBlSkHPEbeg= github.com/araddon/dateparse v0.0.0-20180729174819-cfd92a431d0e/go.mod h1:SLqhdZcd+dF3TEVL2RMoob5bBP5R1P1qkox+HtCBgGI= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= +github.com/ericlagergren/decimal v0.0.0-20190420051523-6335edbaa640/go.mod h1:mdYyfAkzn9kyJ/kMk/7WE9ufl9lflh+2NvecQ5mAghs= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/set v0.2.1 h1:nn2CaJyknWE/6txyUDGwysr3G5QC6xWB/PtVjPBbeaA= github.com/fatih/set v0.2.1/go.mod h1:+RKtMCH+favT2+3YecHGxcc0b4KyVWA1QWWJUs4E0CI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= +github.com/friendsofgo/errors v0.9.2 h1:X6NYxef4efCBdwI7BgS820zFaN7Cphrmb+Pljdzjtgk= +github.com/friendsofgo/errors v0.9.2/go.mod h1:yCvFW5AkDIL9qn7suHVLiI/gH228n7PC4Pn44IGoTOI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gigawattio/window v0.0.0-20180317192513-0f5467e35573 h1:u8AQ9bPa9oC+8/A/jlWouakhIvkFfuxgIIRjiy8av7I= github.com/gigawattio/window v0.0.0-20180317192513-0f5467e35573/go.mod h1:eBvb3i++NHDH4Ugo9qCvMw8t0mTSctaEa5blJbWcNxs= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -56,53 +187,221 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-resty/resty/v2 v2.0.0 h1:9Nq/U+V4xsoDnDa/iTrABDWUCuk3Ne92XFHPe6dKWUc= github.com/go-resty/resty/v2 v2.0.0/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0 h1:xqgexXAGQgY3HAjNPSaCqn5Aahbo5TKsmhp8VRfr1iQ= github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kat-co/vala v0.0.0-20170210184112-42e1d8b61f12/go.mod h1:u9MdXq/QageOOSGp7qG4XAQsYUMP+V5zEel/Vrl6OOc= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.3 h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/microsoft/go-mssqldb v0.17.0/go.mod h1:OkoNGhGEs8EZqchVTtochlXruEhEOaO4S0d2sB5aeGQ= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mmcdole/gofeed v1.3.0 h1:5yn+HeqlcvjMeAI4gu6T+crm7d0anY85+M+v6fIFNG4= github.com/mmcdole/gofeed v1.3.0/go.mod h1:9TGv2LcJhdXePDzxiuMnukhV2/zb6VtnZt1mS+SjkLE= github.com/mmcdole/goxpp v1.1.1-0.20240225020742-a0c311522b23 h1:Zr92CAlFhy2gL+V1F+EyIuzbQNbSgP4xhTODZtrXUtk= @@ -110,8 +409,14 @@ github.com/mmcdole/goxpp v1.1.1-0.20240225020742-a0c311522b23/go.mod h1:v+25+lT2 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/olekukonko/tablewriter v0.0.0-20180506121414-d4647c9c7a84 h1:fiKJgB4JDUd43CApkmCeTSQlWjtTtABrU2qsgbuP0BI= github.com/olekukonko/tablewriter v0.0.0-20180506121414-d4647c9c7a84/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= @@ -121,29 +426,119 @@ github.com/otiai10/mint v1.3.0 h1:Ady6MKVezQwHBkGzLFbrsywyp09Ah7rkmfjV3Bcr5uc= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/opengraph v1.1.3 h1:4RoX4yckU/eaj34XxwoyNFvuPVrmjcUHMyAgjJL1Pwg= github.com/otiai10/opengraph v1.1.3/go.mod h1:ZMbPcfiSRSsg3+yrWZCXrgYL6kEK4KpH4GG1iyIvEXs= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/simplereach/timeutils v1.2.0 h1:btgOAlu9RW6de2r2qQiONhjgxdAG7BL6je0G6J/yPnA= github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo= github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= +github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/volatiletech/inflect v0.0.1 h1:2a6FcMQyhmPZcLa+uet3VJ8gLn/9svWhJxJYwvE8KsU= +github.com/volatiletech/inflect v0.0.1/go.mod h1:IBti31tG6phkHitLlr5j7shC5SOo//x0AjDzaJU1PLA= +github.com/volatiletech/null/v8 v8.1.2 h1:kiTiX1PpwvuugKwfvUNX/SU/5A2KGZMXfGD0DUHdKEI= +github.com/volatiletech/null/v8 v8.1.2/go.mod h1:98DbwNoKEpRrYtGjWFctievIfm4n4MxG0A6EBUcoS5g= +github.com/volatiletech/randomize v0.0.1 h1:eE5yajattWqTB2/eN8df4dw+8jwAzBtbdo5sbWC4nMk= +github.com/volatiletech/randomize v0.0.1/go.mod h1:GN3U0QYqfZ9FOJ67bzax1cqZ5q2xuj2mXrXBjWaRTlY= +github.com/volatiletech/sqlboiler/v4 v4.16.2 h1:PcV2bxjE+S+GwPKCyX7/AjlY3aiTKsOEjciLhpWQImc= +github.com/volatiletech/sqlboiler/v4 v4.16.2/go.mod h1:B14BPBGTrJ2X6l7lwnvV/iXgYR48+ozGSlzHI3frl6U= +github.com/volatiletech/strmangle v0.0.1/go.mod h1:F6RA6IkB5vq0yTG4GQ0UsbbRcl3ni9P76i+JrTBKFFg= +github.com/volatiletech/strmangle v0.0.6 h1:AdOYE3B2ygRDq4rXDij/MMwq6KVK/pWAYxpC7CLrkKQ= +github.com/volatiletech/strmangle v0.0.6/go.mod h1:ycDvbDkjDvhC0NUU8w3fWwl5JEMTV56vTKXzR3GeR+0= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= +go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= +go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 h1:P+/g8GpuJGYbOp2tAdKrIPUX9JO02q8Q0YNlHolpibA= @@ -158,30 +553,115 @@ go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= go.opentelemetry.io/otel/trace v1.23.0 h1:37Ik5Ib7xfYVb4V1UtnT97T1jI+AoIYkJyPkuL4iJgI= go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220826181053-bd7e27e6170d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190926025831-c00fd9afed17/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= @@ -189,24 +669,126 @@ golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -217,8 +799,13 @@ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= @@ -227,29 +814,206 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= google.golang.org/api v0.167.0 h1:CKHrQD1BLRii6xdkatBDXyKzM0mkawt2QP+H3LtPmSE= google.golang.org/api v0.167.0/go.mod h1:4FcBc686KFi7QI/U51/2GKKevfZMpM17sCdibqe/bSA= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= google.golang.org/genproto/googleapis/api v0.0.0-20240304161311-37d4d3c04a78 h1:SzXBGiWM1LNVYLCRP3e0/Gsze804l4jGoJ5lYysEO5I= @@ -257,12 +1021,38 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240304161311-37d4d3c04a78/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78 h1:Xs9lu+tLXxLIfuci70nG4cpwaRC+mRQPUL7LoIeDJC4= google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -271,17 +1061,80 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.2/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/cc/v3 v3.36.3/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= +modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= +modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= +modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.8/go.mod h1:zNjwkizS+fIFDrDjIAgBSCLkWbJuHF+ar3QRn+Z9aws= +modernc.org/ccgo/v3 v3.16.9/go.mod h1:zNMzC9A9xeNUepy6KuZBbugn3c0Mc9TeiJO4lgvkJDo= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= +modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= +modernc.org/libc v1.16.17/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.16.19/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= +modernc.org/libc v1.17.0/go.mod h1:XsgLldpP4aWlPlsjqKRdHPqCxCjISdHfM/yeWC5GyW0= +modernc.org/libc v1.17.1/go.mod h1:FZ23b+8LjxZs7XtFMbSzL/EhPxNbfZbErxEHc7cbD9s= +modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= +modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= +modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= +modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/batch-service/infrastructure/firestore/repository/article_repository.go b/batch-service/infrastructure/firestore/repository/article_repository.go index 8221f8ed..eea22e67 100644 --- a/batch-service/infrastructure/firestore/repository/article_repository.go +++ b/batch-service/infrastructure/firestore/repository/article_repository.go @@ -1,91 +1,85 @@ package repository -import ( - "cloud.google.com/go/firestore" - "context" - "github.com/YukiOnishi1129/techpicks/batch-service/domain" -) - -type ArticleRepositoryInterface interface { - GetArticles(ctx context.Context) ([]domain.Article, error) - GetArticlesByPlatform(ctx context.Context, platformID string) ([]domain.Article, error) - GetCountArticlesByLink(ctx context.Context, link string) (int, error) -} - -type ArticleRepository struct { - Client *firestore.Client -} - -func NewArticleRepository(client *firestore.Client) *ArticleRepository { - return &ArticleRepository{Client: client} -} - -func (ar *ArticleRepository) GetArticles(ctx context.Context) ([]domain.Article, error) { - iter := ar.Client.Collection("articles").Documents(ctx) - var articles []domain.Article - for { - doc, err := iter.Next() - if err != nil { - break - } - articles = append(articles, convertFirestoreToArticle(doc)) - } - return articles, nil -} - -func (ar *ArticleRepository) GetArticlesByPlatform(ctx context.Context, platformID string) ([]domain.Article, error) { - iter := ar.Client.Collection("articles").Where("platform_id", "==", platformID).Documents(ctx) - var articles []domain.Article - for { - doc, err := iter.Next() - if err != nil { - break - } - articles = append(articles, convertFirestoreToArticle(doc)) - } - return articles, nil -} - -func (ar *ArticleRepository) GetCountArticlesByLink(ctx context.Context, link string) (int, error) { - iter := ar.Client.Collection("articles").Where("article_url", "==", link).Documents(ctx) - var count int - for { - _, err := iter.Next() - if err != nil { - break - } - count++ - } - return count, nil -} - -func convertFirestoreToArticle(doc *firestore.DocumentSnapshot) domain.Article { - data := doc.Data() - platformType := data["platform_type"].(int64) - publishedAt := int(data["published_at"].(int64)) - createdAt := int(data["created_at"].(int64)) - updatedAt := int(data["updated_at"].(int64)) - article := domain.Article{ - ID: doc.Ref.ID, - Title: data["title"].(string), - Description: data["description"].(string), - ThumbnailURL: data["thumbnail_url"].(string), - ArticleURL: data["article_url"].(string), - PublishedAt: publishedAt, - Platform: domain.ArticlePlatform{ - ID: data["platform_id"].(string), - Name: data["platform_name"].(string), - PlatformType: domain.PlatformType(platformType), - SiteURL: data["platform_site_url"].(string), - }, - IsEng: data["is_eng"].(bool), - IsPrivate: data["is_private"].(bool), - CreatedAt: createdAt, - UpdatedAt: updatedAt, - } - if data["deleted_at"] != nil { - deletedAt := int(data["deleted_at"].(int64)) - article.DeletedAt = &deletedAt - } - return article -} +//type ArticleRepositoryInterface interface { +// GetArticles(ctx context.Context) ([]domain.Article, error) +// GetArticlesByPlatform(ctx context.Context, platformID string) ([]domain.Article, error) +// GetCountArticlesByLink(ctx context.Context, link string) (int, error) +//} +// +//type ArticleRepository struct { +// Client *firestore.Client +//} +// +//func NewArticleRepository(client *firestore.Client) *ArticleRepository { +// return &ArticleRepository{Client: client} +//} +// +//func (ar *ArticleRepository) GetArticles(ctx context.Context) ([]domain.Article, error) { +// iter := ar.Client.Collection("articles").Documents(ctx) +// var articles []domain.Article +// for { +// doc, err := iter.Next() +// if err != nil { +// break +// } +// articles = append(articles, convertFirestoreToArticle(doc)) +// } +// return articles, nil +//} +// +//func (ar *ArticleRepository) GetArticlesByPlatform(ctx context.Context, platformID string) ([]domain.Article, error) { +// iter := ar.Client.Collection("articles").Where("platform_id", "==", platformID).Documents(ctx) +// var articles []domain.Article +// for { +// doc, err := iter.Next() +// if err != nil { +// break +// } +// articles = append(articles, convertFirestoreToArticle(doc)) +// } +// return articles, nil +//} +// +//func (ar *ArticleRepository) GetCountArticlesByLink(ctx context.Context, link string) (int, error) { +// iter := ar.Client.Collection("articles").Where("article_url", "==", link).Documents(ctx) +// var count int +// for { +// _, err := iter.Next() +// if err != nil { +// break +// } +// count++ +// } +// return count, nil +//} +// +//func convertFirestoreToArticle(doc *firestore.DocumentSnapshot) domain.Article { +// data := doc.Data() +// platformType := data["platform_type"].(int64) +// publishedAt := int(data["published_at"].(int64)) +// createdAt := int(data["created_at"].(int64)) +// updatedAt := int(data["updated_at"].(int64)) +// article := domain.Article{ +// ID: doc.Ref.ID, +// Title: data["title"].(string), +// Description: data["description"].(string), +// ThumbnailURL: data["thumbnail_url"].(string), +// ArticleURL: data["article_url"].(string), +// PublishedAt: publishedAt, +// Platform: domain.ArticlePlatform{ +// ID: data["platform_id"].(string), +// Name: data["platform_name"].(string), +// PlatformType: domain.PlatformType(platformType), +// SiteURL: data["platform_site_url"].(string), +// }, +// IsEng: data["is_eng"].(bool), +// IsPrivate: data["is_private"].(bool), +// CreatedAt: createdAt, +// UpdatedAt: updatedAt, +// } +// if data["deleted_at"] != nil { +// deletedAt := int(data["deleted_at"].(int64)) +// article.DeletedAt = &deletedAt +// } +// return article +//} diff --git a/batch-service/infrastructure/firestore/repository/platform_repository.go b/batch-service/infrastructure/firestore/repository/platform_repository.go index f0d73471..47a77dd3 100644 --- a/batch-service/infrastructure/firestore/repository/platform_repository.go +++ b/batch-service/infrastructure/firestore/repository/platform_repository.go @@ -1,125 +1,119 @@ package repository -import ( - "cloud.google.com/go/firestore" - "context" - "github.com/YukiOnishi1129/techpicks/batch-service/domain" -) - -type PlatformRepositoryInterface interface { - CreatePlatform(ctx context.Context, arg domain.Platform) error - GetPlatforms(ctx context.Context) ([]domain.Platform, error) - GetPlatForm(ctx context.Context, id string) (domain.Platform, error) - UpdatePlatform(ctx context.Context, arg domain.Platform) error - DeletePlatform(ctx context.Context, id string) error -} - -type PlatformRepository struct { - Client *firestore.Client -} - -func NewPlatformRepository(client *firestore.Client) *PlatformRepository { - return &PlatformRepository{Client: client} -} - -// CreatePlatform is a method to create a platform -func (pr *PlatformRepository) CreatePlatform(ctx context.Context, arg domain.Platform) error { - _, err := pr.Client.Collection("platforms").Doc(arg.ID).Set(ctx, domain.PlatformFirestore{ - Name: arg.Name, - RssURL: arg.RssURL, - SiteURL: arg.SiteURL, - PlatformType: arg.PlatformType, - IsEng: arg.IsEng, - CreatedAt: arg.CreatedAt, - UpdatedAt: arg.UpdatedAt, - DeletedAt: arg.DeletedAt, - }) - - if err != nil { - return err - } - return nil -} - -// GetPlatforms is a method to get all platforms -func (pr *PlatformRepository) GetPlatforms(ctx context.Context) ([]domain.Platform, error) { - iter := pr.Client.Collection("platforms").WhereEntity(firestore.OrFilter{ - Filters: []firestore.EntityFilter{ - firestore.PropertyFilter{ - Path: "deleted_at", - Operator: "==", - Value: nil, - }}, - }).Documents(ctx) - var platforms []domain.Platform - for { - doc, err := iter.Next() - if err != nil { - break - } - platforms = append(platforms, convertFirestoreToPlatform(doc)) - } - return platforms, nil -} - -// GetPlatForm is a method to get a platform by id -func (pr *PlatformRepository) GetPlatForm(ctx context.Context, id string) (domain.Platform, error) { - doc, err := pr.Client.Collection("platforms").Doc(id).Get(ctx) - if err != nil { - return domain.Platform{}, err - } - return convertFirestoreToPlatform(doc), nil -} - -// UpdatePlatform is a method to update a platform -func (pr *PlatformRepository) UpdatePlatform(ctx context.Context, arg domain.Platform) error { - _, err := pr.Client.Collection("platforms").Doc(arg.ID).Set(ctx, domain.PlatformFirestore{ - Name: arg.Name, - RssURL: arg.RssURL, - SiteURL: arg.SiteURL, - PlatformType: arg.PlatformType, - IsEng: arg.IsEng, - CreatedAt: arg.CreatedAt, - UpdatedAt: arg.UpdatedAt, - DeletedAt: arg.DeletedAt, - }) - if err != nil { - return err - } - return nil -} - -// DeletePlatform is a method to delete a platform -func (pr *PlatformRepository) DeletePlatform(ctx context.Context, id string) error { - _, err := pr.Client.Collection("platforms").Doc(id).Delete(ctx) - if err != nil { - return err - } - return nil -} - -// convertFirestoreToPlatform is a method to convert firestore data to platform -func convertFirestoreToPlatform(doc *firestore.DocumentSnapshot) domain.Platform { - data := doc.Data() - platformType := data["platform_type"].(int64) - cratedAt := data["created_at"].(int64) - updatedAt := data["updated_at"].(int64) - platform := domain.Platform{ - ID: doc.Ref.ID, - Name: data["name"].(string), - CategoryName: data["category_name"].(string), - RssURL: data["rss_url"].(string), - SiteURL: data["site_url"].(string), - PlatformType: domain.PlatformType(platformType), - ThumbnailImageURL: data["thumbnail_image_url"].(string), - FaviconURL: data["favicon_url"].(string), - IsEng: data["is_eng"].(bool), - CreatedAt: int(cratedAt), - UpdatedAt: int(updatedAt), - } - if data["deleted_at"] != nil { - deletedAt := int(data["deleted_at"].(int64)) - platform.DeletedAt = &deletedAt - } - return platform -} +//type PlatformRepositoryInterface interface { +// CreatePlatform(ctx context.Context, arg domain.Platform) error +// GetPlatforms(ctx context.Context) ([]domain.Platform, error) +// GetPlatForm(ctx context.Context, id string) (domain.Platform, error) +// UpdatePlatform(ctx context.Context, arg domain.Platform) error +// DeletePlatform(ctx context.Context, id string) error +//} +// +//type PlatformRepository struct { +// Client *firestore.Client +//} +// +//func NewPlatformRepository(client *firestore.Client) *PlatformRepository { +// return &PlatformRepository{Client: client} +//} +// +//// CreatePlatform is a method to create a platform +//func (pr *PlatformRepository) CreatePlatform(ctx context.Context, arg domain.Platform) error { +// _, err := pr.Client.Collection("platforms").Doc(arg.ID).Set(ctx, domain.PlatformFirestore{ +// Name: arg.Name, +// RssURL: arg.RssURL, +// SiteURL: arg.SiteURL, +// PlatformType: arg.PlatformType, +// IsEng: arg.IsEng, +// CreatedAt: arg.CreatedAt, +// UpdatedAt: arg.UpdatedAt, +// DeletedAt: arg.DeletedAt, +// }) +// +// if err != nil { +// return err +// } +// return nil +//} +// +//// GetPlatforms is a method to get all platforms +//func (pr *PlatformRepository) GetPlatforms(ctx context.Context) ([]domain.Platform, error) { +// iter := pr.Client.Collection("platforms").WhereEntity(firestore.OrFilter{ +// Filters: []firestore.EntityFilter{ +// firestore.PropertyFilter{ +// Path: "deleted_at", +// Operator: "==", +// Value: nil, +// }}, +// }).Documents(ctx) +// var platforms []domain.Platform +// for { +// doc, err := iter.Next() +// if err != nil { +// break +// } +// platforms = append(platforms, convertFirestoreToPlatform(doc)) +// } +// return platforms, nil +//} +// +//// GetPlatForm is a method to get a platform by id +//func (pr *PlatformRepository) GetPlatForm(ctx context.Context, id string) (domain.Platform, error) { +// doc, err := pr.Client.Collection("platforms").Doc(id).Get(ctx) +// if err != nil { +// return domain.Platform{}, err +// } +// return convertFirestoreToPlatform(doc), nil +//} +// +//// UpdatePlatform is a method to update a platform +//func (pr *PlatformRepository) UpdatePlatform(ctx context.Context, arg domain.Platform) error { +// _, err := pr.Client.Collection("platforms").Doc(arg.ID).Set(ctx, domain.PlatformFirestore{ +// Name: arg.Name, +// RssURL: arg.RssURL, +// SiteURL: arg.SiteURL, +// PlatformType: arg.PlatformType, +// IsEng: arg.IsEng, +// CreatedAt: arg.CreatedAt, +// UpdatedAt: arg.UpdatedAt, +// DeletedAt: arg.DeletedAt, +// }) +// if err != nil { +// return err +// } +// return nil +//} +// +//// DeletePlatform is a method to delete a platform +//func (pr *PlatformRepository) DeletePlatform(ctx context.Context, id string) error { +// _, err := pr.Client.Collection("platforms").Doc(id).Delete(ctx) +// if err != nil { +// return err +// } +// return nil +//} +// +//// convertFirestoreToPlatform is a method to convert firestore data to platform +//func convertFirestoreToPlatform(doc *firestore.DocumentSnapshot) domain.Platform { +// data := doc.Data() +// platformType := data["platform_type"].(int64) +// cratedAt := data["created_at"].(int64) +// updatedAt := data["updated_at"].(int64) +// platform := domain.Platform{ +// ID: doc.Ref.ID, +// Name: data["name"].(string), +// CategoryName: data["category_name"].(string), +// RssURL: data["rss_url"].(string), +// SiteURL: data["site_url"].(string), +// PlatformType: domain.PlatformType(platformType), +// ThumbnailImageURL: data["thumbnail_image_url"].(string), +// FaviconURL: data["favicon_url"].(string), +// IsEng: data["is_eng"].(bool), +// CreatedAt: int(cratedAt), +// UpdatedAt: int(updatedAt), +// } +// if data["deleted_at"] != nil { +// deletedAt := int(data["deleted_at"].(int64)) +// platform.DeletedAt = &deletedAt +// } +// return platform +//} diff --git a/batch-service/infrastructure/supabase/repository/article.go b/batch-service/infrastructure/supabase/repository/article.go new file mode 100644 index 00000000..c54dc96b --- /dev/null +++ b/batch-service/infrastructure/supabase/repository/article.go @@ -0,0 +1,100 @@ +package repository + +import ( + "context" + "database/sql" + "github.com/YukiOnishi1129/techpicks/batch-service/domain" + "github.com/YukiOnishi1129/techpicks/batch-service/entity" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries/qm" +) + +type ArticleRepositoryInterface interface { + GetArticles(ctx context.Context, dto domain.GetArticlesInputDTO) ([]domain.Article, error) + GetArticle(ctx context.Context, id string) (domain.Article, error) + CreateArticle(ctx context.Context, article domain.CreateArticleInputDTO) (articleID string, err error) + UpdateArticle(ctx context.Context, article domain.UpdateArticleInputDTO) error + DeleteArticle(ctx context.Context, id string) error +} + +type ArticleRepository struct { + db *sql.DB +} + +func NewArticleRepository(db *sql.DB) *ArticleRepository { + return &ArticleRepository{ + db: db, + } +} + +func (ar *ArticleRepository) GetArticles(ctx context.Context, dto domain.GetArticlesInputDTO) ([]domain.Article, error) { + q := make([]qm.QueryMod, 0) + if dto.Title != nil { + q = append(q, qm.Where("title = ?", *dto.Title)) + } + if dto.ArticleURL != nil { + q = append(q, qm.Where("article_url = ?", *dto.ArticleURL)) + } + if dto.StartedAt != nil && dto.EndedAt != nil { + q = append(q, qm.Where("published_at BETWEEN ? AND ?", dto.StartedAt, dto.EndedAt)) + } + q = append(q, qm.Where("deleted_at IS NULL")) + aRows, err := entity.Articles(q...).All(ctx, ar.db) + if err != nil { + return nil, err + } + resArticles := make([]domain.Article, len(aRows)) + for i, a := range aRows { + resArticles[i] = convertDBtoArticleDomain(a) + } + return resArticles, nil +} + +func (ar *ArticleRepository) GetArticle(ctx context.Context, id string) (domain.Article, error) { + a, err := entity.Articles(qm.Where("id = ?", id), qm.Where("deleted_at IS NULL")).One(ctx, ar.db) + if err != nil { + return domain.Article{}, err + + } + return convertDBtoArticleDomain(a), nil +} + +func (ar *ArticleRepository) CreateArticle(ctx context.Context, article domain.CreateArticleInputDTO) (articleID string, err error) { + a := entity.Article{ + Title: article.Title, + Description: article.Description, + ThumbnailURL: article.ThumbnailURL, + ArticleURL: article.ArticleURL, + PublishedAt: article.PublishedAt, + } + if article.IsPrivate != nil { + a.IsPrivate = *article.IsPrivate + } + err = a.Insert(ctx, ar.db, boil.Infer()) + if err != nil { + return "", err + } + return a.ID, nil +} + +func (ar *ArticleRepository) UpdateArticle(ctx context.Context, article domain.UpdateArticleInputDTO) error { + return nil +} + +func (ar *ArticleRepository) DeleteArticle(ctx context.Context, id string) error { + return nil +} + +func convertDBtoArticleDomain(a *entity.Article) domain.Article { + return domain.Article{ + ID: a.ID, + Title: a.Title, + Description: a.Description, + ThumbnailURL: a.ThumbnailURL, + ArticleURL: a.ArticleURL, + PublishedAt: a.PublishedAt, + IsPrivate: a.IsPrivate, + CreatedAt: a.CreatedAt, + UpdatedAt: a.UpdatedAt, + } +} diff --git a/batch-service/infrastructure/supabase/repository/category.go b/batch-service/infrastructure/supabase/repository/category.go new file mode 100644 index 00000000..09f87860 --- /dev/null +++ b/batch-service/infrastructure/supabase/repository/category.go @@ -0,0 +1,95 @@ +package repository + +import ( + "context" + "database/sql" + "github.com/YukiOnishi1129/techpicks/batch-service/domain" + "github.com/YukiOnishi1129/techpicks/batch-service/entity" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries/qm" +) + +type CategoryRepositoryInterface interface { + GetCategories(ctx context.Context) ([]domain.Category, error) + GetCategory(ctx context.Context, id string) (domain.Category, error) + CreateCategory(ctx context.Context, arg domain.CreateCategoryInputDTO) (categoryID string, err error) + UpdateCategory(ctx context.Context, arg domain.UpdateCategoryInputDTO) error +} + +type CategoryRepository struct { + db *sql.DB +} + +func NewCategoryRepository(db *sql.DB) *CategoryRepository { + return &CategoryRepository{db: db} +} + +// GetCategories is a method to get all categories +func (cr *CategoryRepository) GetCategories(ctx context.Context) ([]domain.Category, error) { + cRows, err := entity.Categories(qm.Where("deleted_at IS NOT NULL")).All(ctx, cr.db) + if err != nil { + return nil, err + } + resCategories := make([]domain.Category, len(cRows)) + for i, c := range cRows { + category := domain.Category{ + ID: c.ID, + Name: c.Name, + Type: domain.CategoryType(c.Type), + CreatedAt: c.CreatedAt, + UpdatedAt: c.UpdatedAt, + } + if c.DeletedAt.Valid { + category.DeletedAt = &c.DeletedAt.Time + } + resCategories[i] = category + } + return resCategories, nil +} + +// GetCategory is a method to get a category by id +func (cr *CategoryRepository) GetCategory(ctx context.Context, id string) (domain.Category, error) { + c, err := entity.Categories(qm.Where("id = ?", id), qm.WhereIn("deleted_at IS NOT NULL")).One(ctx, cr.db) + if err != nil { + return domain.Category{}, err + } + category := domain.Category{ + ID: c.ID, + Name: c.Name, + Type: domain.CategoryType(c.Type), + CreatedAt: c.CreatedAt, + UpdatedAt: c.UpdatedAt, + } + if c.DeletedAt.Valid { + category.DeletedAt = &c.DeletedAt.Time + } + return category, nil +} + +// CreateCategory is a method to create a category +func (cr *CategoryRepository) CreateCategory(ctx context.Context, arg domain.CreateCategoryInputDTO) (categoryID string, err error) { + c := entity.Category{ + Name: arg.Name, + Type: arg.Type, + } + err = c.Insert(ctx, cr.db, boil.Infer()) + if err != nil { + return "", err + } + return c.ID, err +} + +// UpdateCategory is a method to update a category +func (cr *CategoryRepository) UpdateCategory(ctx context.Context, arg domain.UpdateCategoryInputDTO) error { + c, err := entity.Categories(qm.Where("id = ?", arg.ID), qm.WhereIn("deleted_at IS NOT NULL")).One(ctx, cr.db) + if err != nil { + return err + } + c.Name = arg.Name + c.Type = arg.Type + _, err = c.Update(ctx, cr.db, boil.Infer()) + if err != nil { + return err + } + return nil +} diff --git a/batch-service/infrastructure/supabase/repository/feed.go b/batch-service/infrastructure/supabase/repository/feed.go new file mode 100644 index 00000000..dda8b81f --- /dev/null +++ b/batch-service/infrastructure/supabase/repository/feed.go @@ -0,0 +1,89 @@ +package repository + +import ( + "context" + "database/sql" + "github.com/YukiOnishi1129/techpicks/batch-service/domain" + "github.com/YukiOnishi1129/techpicks/batch-service/entity" + "github.com/volatiletech/sqlboiler/v4/boil" + "github.com/volatiletech/sqlboiler/v4/queries/qm" +) + +type FeedRepositoryInterface interface { + GetFeeds(ctx context.Context) ([]domain.Feed, error) + GetFeed(ctx context.Context, id string) (domain.Feed, error) + CreateFeed(ctx context.Context, arg domain.CreateFeedInputDTO) (feedID string, err error) + UpdateFeed(ctx context.Context, arg domain.UpdateFeedInputDTO) error + DeletedFeed(ctx context.Context, id string) error +} + +type FeedRepository struct { + db *sql.DB +} + +func NewFeedRepository(db *sql.DB) *FeedRepository { + return &FeedRepository{db: db} +} + +// GetFeeds is a method to get all feeds +func (fr *FeedRepository) GetFeeds(ctx context.Context) ([]domain.Feed, error) { + fRows, err := entity.Feeds(qm.Where("deleted_at IS NOT NULL")).All(ctx, fr.db) + if err != nil { + return nil, err + } + resFeeds := make([]domain.Feed, len(fRows)) + for i, f := range fRows { + resFeeds[i] = convertDBtoFeedDomain(f) + } + return nil, nil +} + +// GetFeed is a method to get a feed by id +func (fr *FeedRepository) GetFeed(ctx context.Context, id string) (domain.Feed, error) { + f, err := entity.Feeds(qm.Where("id = ?", id), qm.Where("deleted_at IS NOT NULL")).One(ctx, fr.db) + if err != nil { + return domain.Feed{}, err + } + return convertDBtoFeedDomain(f), nil +} + +// CreateFeed is a method to create a feed +func (fr *FeedRepository) CreateFeed(ctx context.Context, arg domain.CreateFeedInputDTO) (feedID string, err error) { + f := entity.Feed{ + Name: arg.Name, + RSSURL: arg.RssURL, + PlatformID: arg.PlatformID, + CategoryID: arg.CategoryID, + } + err = f.Insert(ctx, fr.db, boil.Infer()) + if err != nil { + return "", err + } + return f.ID, nil +} + +func convertDBtoFeedDomain(f *entity.Feed) domain.Feed { + return domain.Feed{ + ID: f.ID, + Name: f.Name, + RssURL: f.RSSURL, + Platform: domain.Platform{ + ID: f.R.Platform.ID, + Name: f.R.Platform.Name, + SiteURL: f.R.Platform.SiteURL, + PlatformType: domain.PlatformType(f.R.Platform.PlatformType), + IsEng: f.R.Platform.IsEng, + CreatedAt: f.R.Platform.CreatedAt, + UpdatedAt: f.R.Platform.UpdatedAt, + }, + Category: domain.Category{ + ID: f.R.Category.ID, + Name: f.R.Category.Name, + Type: domain.CategoryType(f.R.Category.Type), + CreatedAt: f.R.Category.CreatedAt, + UpdatedAt: f.R.Category.UpdatedAt, + }, + CreatedAt: f.CreatedAt, + UpdatedAt: f.UpdatedAt, + } +} diff --git a/batch-service/infrastructure/supabase/repository/feed_article_relation.go b/batch-service/infrastructure/supabase/repository/feed_article_relation.go new file mode 100644 index 00000000..1405695c --- /dev/null +++ b/batch-service/infrastructure/supabase/repository/feed_article_relation.go @@ -0,0 +1,96 @@ +package repository + +import ( + "context" + "database/sql" + "github.com/YukiOnishi1129/techpicks/batch-service/domain" + "github.com/YukiOnishi1129/techpicks/batch-service/entity" + "github.com/volatiletech/sqlboiler/v4/queries/qm" +) + +type FeedArticleRelationRepositoryInterface interface { + GetFeedArticleRelations(ctx context.Context, dto domain.GetFeedArticleRelationsInputDTO) ([]domain.FeedArticleRelation, error) + GetFeedArticleRelation(ctx context.Context, id string) (domain.FeedArticleRelation, error) + CreateFeedArticleRelation(ctx context.Context, arg domain.CreateFeedArticleRelationInputDTO) (feedArticleRelationID string, err error) + DeleteFeedArticleRelation(ctx context.Context, id string) error +} + +type FeedArticleRelationRepository struct { + db *sql.DB +} + +func NewFeedArticleRelationRepository(db *sql.DB) *FeedArticleRelationRepository { + return &FeedArticleRelationRepository{db: db} +} + +func (farr *FeedArticleRelationRepository) GetFeedArticleRelations(ctx context.Context, dto domain.GetFeedArticleRelationsInputDTO) ([]domain.FeedArticleRelation, error) { + q := make([]qm.QueryMod, 0) + if dto.FeedID != nil { + q = append(q, qm.Where("feed_id = ?", *dto.FeedID)) + } + if dto.ArticleID != nil { + q = append(q, qm.Where("article_id = ?", *dto.ArticleID)) + } + farRow, err := entity.FeedArticleRelations(q...).All(ctx, farr.db) + if err != nil { + return nil, err + } + resFeedArticleRelations := make([]domain.FeedArticleRelation, len(farRow)) + for i, far := range farRow { + resFeedArticleRelations[i] = convertDBtoFeedArticleRelationDomain(far) + } + return resFeedArticleRelations, nil +} + +func (farr *FeedArticleRelationRepository) GetFeedArticleRelation(ctx context.Context, id string) (domain.FeedArticleRelation, error) { + return domain.FeedArticleRelation{}, nil +} + +func (farr *FeedArticleRelationRepository) CreateFeedArticleRelation(ctx context.Context, arg domain.CreateFeedArticleRelationInputDTO) (feedArticleRelationID string, err error) { + return "", nil +} + +func (farr *FeedArticleRelationRepository) DeleteFeedArticleRelation(ctx context.Context, id string) error { + return nil +} + +func convertDBtoFeedArticleRelationDomain(far *entity.FeedArticleRelation) domain.FeedArticleRelation { + return domain.FeedArticleRelation{ + ID: far.ID, + Feed: domain.Feed{ + ID: far.R.Feed.ID, + Name: far.R.Feed.Name, + RssURL: far.R.Feed.RSSURL, + Platform: domain.Platform{ + ID: far.R.Feed.R.Platform.ID, + Name: far.R.Feed.R.Platform.Name, + SiteURL: far.R.Feed.R.Platform.SiteURL, + PlatformType: domain.PlatformType(far.R.Feed.R.Platform.PlatformType), + IsEng: far.R.Feed.R.Platform.IsEng, + FaviconURL: far.R.Feed.R.Platform.FaviconURL, + CreatedAt: far.R.Feed.R.Platform.CreatedAt, + UpdatedAt: far.R.Feed.R.Platform.UpdatedAt, + }, + Category: domain.Category{ + ID: far.R.Feed.R.Category.ID, + Name: far.R.Feed.R.Category.Name, + Type: domain.CategoryType(far.R.Feed.R.Category.Type), + CreatedAt: far.R.Feed.R.Category.CreatedAt, + UpdatedAt: far.R.Feed.R.Category.UpdatedAt, + }, + }, + Article: domain.Article{ + ID: far.R.Article.ID, + Title: far.R.Article.Title, + Description: far.R.Article.Description, + ThumbnailURL: far.R.Article.ThumbnailURL, + ArticleURL: far.R.Article.ArticleURL, + PublishedAt: far.R.Article.PublishedAt, + IsPrivate: far.R.Article.IsPrivate, + CreatedAt: far.R.Article.CreatedAt, + UpdatedAt: far.R.Article.UpdatedAt, + }, + CreatedAt: far.CreatedAt, + UpdatedAt: far.UpdatedAt, + } +} diff --git a/batch-service/infrastructure/supabase/repository/platform.go b/batch-service/infrastructure/supabase/repository/platform.go new file mode 100644 index 00000000..b9142ed7 --- /dev/null +++ b/batch-service/infrastructure/supabase/repository/platform.go @@ -0,0 +1,64 @@ +package repository + +import ( + "context" + "database/sql" + "github.com/YukiOnishi1129/techpicks/batch-service/domain" + "github.com/YukiOnishi1129/techpicks/batch-service/entity" + "github.com/volatiletech/sqlboiler/v4/queries/qm" +) + +type PlatformRepositoryInterface interface { + //CreatePlatform(ctx context.Context, arg domain.Platform) (platformID string, err error) + GetPlatforms(ctx context.Context) ([]domain.Platform, error) + GetPlatForm(ctx context.Context, id string) (domain.Platform, error) + //UpdatePlatform(ctx context.Context, arg domain.Platform) error + //DeletePlatform(ctx context.Context, id string) error +} + +type PlatformRepository struct { + db *sql.DB +} + +func NewPlatformRepository(db *sql.DB) *PlatformRepository { + return &PlatformRepository{db: db} +} + +func (pr *PlatformRepository) GetPlatforms(ctx context.Context) ([]domain.Platform, error) { + pRows, err := entity.Platforms(qm.Where("deleted_at IS NOT NULL")).All(ctx, pr.db) + if err != nil { + return nil, err + } + resPlatforms := make([]domain.Platform, len(pRows)) + + for i, p := range pRows { + resPlatforms[i] = convertDBtoPlatformDomain(p) + } + return resPlatforms, nil +} + +func (pr *PlatformRepository) GetPlatForm(ctx context.Context, id string) (domain.Platform, error) { + p, err := entity.Platforms(qm.Where("id = ?", id), qm.WhereIn("deleted_at IS NOT NULL")).One(ctx, pr.db) + if err != nil { + return domain.Platform{}, err + } + return convertDBtoPlatformDomain(p), nil +} + +func convertDBtoPlatformDomain(p *entity.Platform) domain.Platform { + platform := domain.Platform{ + ID: p.ID, + Name: p.Name, + SiteURL: p.SiteURL, + PlatformType: domain.PlatformType(p.PlatformType), + IsEng: p.IsEng, + CreatedAt: p.CreatedAt, + UpdatedAt: p.UpdatedAt, + } + + if p.DeletedAt.Valid { + platform.DeletedAt = &p.DeletedAt.Time + } + + return platform +} diff --git a/scripts/create-entity.sh b/scripts/create-entity.sh new file mode 100755 index 00000000..e7f59d5f --- /dev/null +++ b/scripts/create-entity.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +sqlboiler psql \ + -c batch-service/database/sqlboiler.toml \ + -o batch-service/entity \ + -p entity \ + --no-tests --wipe diff --git a/supabase/er.dio b/supabase/er.dio new file mode 100644 index 00000000..2adbb394 --- /dev/null +++ b/supabase/er.dio @@ -0,0 +1,1726 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/supabase/migrations/20240402112758_create_platforms.sql b/supabase/migrations/20240402112758_create_platforms.sql new file mode 100644 index 00000000..b978e71d --- /dev/null +++ b/supabase/migrations/20240402112758_create_platforms.sql @@ -0,0 +1,21 @@ +alter database postgres +set timezone to 'Asia/Tokyo'; + +CREATE FUNCTION set_platforms_update_time() + RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$ LANGUAGE plpgsql; + +CREATE TABLE platforms +( + id uuid NOT NULL DEFAULT uuid_generate_v4(), + name VARCHAR(255) NOT NULL, + site_url TEXT NOT NULL, + platform_type INT NOT NULL, + favicon_url TEXT NOT NULL, + is_eng BOOLEAN NOT NULL DEFAULT false, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + deleted_at TIMESTAMP DEFAULT NULL, + PRIMARY KEY (id) +); + +CREATE TRIGGER platforms_update_tri BEFORE UPDATE ON platforms FOR EACH ROW EXECUTE PROCEDURE set_platforms_update_time(); \ No newline at end of file diff --git a/supabase/migrations/20240402114356_create_categories.sql b/supabase/migrations/20240402114356_create_categories.sql new file mode 100644 index 00000000..a7dbb712 --- /dev/null +++ b/supabase/migrations/20240402114356_create_categories.sql @@ -0,0 +1,15 @@ +CREATE FUNCTION set_categories_update_time() + RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$ LANGUAGE plpgsql; + +CREATE TABLE categories +( + id uuid NOT NULL DEFAULT uuid_generate_v4(), + name VARCHAR(255) NOT NULL, + type INT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + deleted_at TIMESTAMP DEFAULT NULL, + PRIMARY KEY (id) +); + +CREATE TRIGGER categories_update_tri BEFORE UPDATE ON categories FOR EACH ROW EXECUTE PROCEDURE set_categories_update_time(); \ No newline at end of file diff --git a/supabase/migrations/20240402115228_create_feeds.sql b/supabase/migrations/20240402115228_create_feeds.sql new file mode 100644 index 00000000..99609d36 --- /dev/null +++ b/supabase/migrations/20240402115228_create_feeds.sql @@ -0,0 +1,20 @@ +CREATE FUNCTION set_feeds_update_time() + RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$ LANGUAGE plpgsql; + +CREATE TABLE feeds +( + id uuid NOT NULL DEFAULT uuid_generate_v4(), + name VARCHAR(255) NOT NULL, + platform_id uuid NOT NULL, + category_id uuid NOT NULL, + site_url TEXT NOT NULL, + rss_url TEXT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + deleted_at TIMESTAMP DEFAULT NULL, + PRIMARY KEY (id), + CONSTRAINT fk_feeds_platform_id FOREIGN KEY (platform_id) REFERENCES platforms(id) ON UPDATE RESTRICT ON DELETE CASCADE, + CONSTRAINT fk_feeds_categories_id FOREIGN KEY (category_id) REFERENCES categories(id) ON UPDATE RESTRICT ON DELETE CASCADE +); + +CREATE TRIGGER feeds_update_tri BEFORE UPDATE ON feeds FOR EACH ROW EXECUTE PROCEDURE set_feeds_update_time(); \ No newline at end of file diff --git a/supabase/migrations/20240402154049_create_articles_table.sql b/supabase/migrations/20240402154049_create_articles_table.sql new file mode 100644 index 00000000..e61037b3 --- /dev/null +++ b/supabase/migrations/20240402154049_create_articles_table.sql @@ -0,0 +1,18 @@ +CREATE FUNCTION set_articles_update_time() + RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$ LANGUAGE plpgsql; + +CREATE TABLE articles +( + id uuid NOT NULL DEFAULT uuid_generate_v4(), + title VARCHAR(255) NOT NULL, + description TEXT NOT NULL, + article_url TEXT NOT NULL, + published_at TIMESTAMP NOT NULL, + thumbnail_url TEXT NOT NULL, + is_private BOOLEAN NOT NULL DEFAULT FALSE, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (id) +); + +CREATE TRIGGER articles_update_tri BEFORE UPDATE ON articles FOR EACH ROW EXECUTE PROCEDURE set_articles_update_time(); \ No newline at end of file diff --git a/supabase/migrations/20240402154427_create_feed_article_relations_table.sql b/supabase/migrations/20240402154427_create_feed_article_relations_table.sql new file mode 100644 index 00000000..aa361981 --- /dev/null +++ b/supabase/migrations/20240402154427_create_feed_article_relations_table.sql @@ -0,0 +1,16 @@ +CREATE FUNCTION set_feed_article_relations_update_time() + RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$ LANGUAGE plpgsql; + +CREATE TABLE feed_article_relations +( + id uuid NOT NULL DEFAULT uuid_generate_v4(), + feed_id uuid NOT NULL, + article_id uuid NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (id), + CONSTRAINT fk_feed_article_relations_feeds_id FOREIGN KEY (feed_id) REFERENCES feeds(id) ON UPDATE RESTRICT ON DELETE CASCADE, + CONSTRAINT fk_feed_article_relations_articles_id FOREIGN KEY (article_id) REFERENCES articles(id) ON UPDATE RESTRICT ON DELETE CASCADE +); + +CREATE TRIGGER feed_article_relations_update_tri BEFORE UPDATE ON feed_article_relations FOR EACH ROW EXECUTE PROCEDURE set_feed_article_relations_update_time(); \ No newline at end of file