xspanner

package
v0.0.0-...-7c4a8a6 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RakutenTagGroupsTableName = "rakuten_tag_groups"
	RakutenTagsTableName      = "rakuten_tags"

	TagGroupIDBrand  = 1000161
	TagGroupIDColor  = 1000111
	TagGroupIDWidth  = 1000057
	TagGroupIDDepth  = 1000058
	TagGroupIDHeight = 1000059
)
View Source
const AmazonBrowseNodesTableName = "amazon_browse_nodes"
View Source
const ItemCategoriesTableName = "item_categories"
View Source
const ItemsTableName = "items"
View Source
const RakutenItemGenresTableName = "rakuten_item_genres"
View Source
const YahooShoppingItemCategoriesTableName = "yahoo_shopping_item_categories"

Variables

This section is empty.

Functions

This section is empty.

Types

type AmazonBrowseNode

type AmazonBrowseNode struct {
	ID             string             `spanner:"id"`
	Name           string             `spanner:"name"`
	Level          int64              `spanner:"level"`
	ParentID       spanner.NullString `spanner:"parent_id"`
	ItemCategoryID string             `spanner:"item_category_id"`
	UpdatedAt      time.Time          `spanner:"updated_at"`
}

AmazonBrowseNode represents item category used in Amazon

func GetAllAmazonBrowseNodes

func GetAllAmazonBrowseNodes(ctx context.Context, spannerClient *spanner.Client) ([]*AmazonBrowseNode, error)

type IntRange

type IntRange struct {
	Gte int `spanner:"gte"`
	Lte int `spanner:"lte"`
}

type Item

type Item struct {
	ID            string             `spanner:"id"`
	GroupID       spanner.NullString `spanner:"group_id"` // temporally nullable, will fix to NOT NULL after migration
	Name          string             `spanner:"name"`
	Description   string             `spanner:"description"`
	Status        int64              `spanner:"status"`
	URL           string             `spanner:"url"`
	AffiliateURL  string             `spanner:"affiliate_url"`
	Price         int64              `spanner:"price"`
	ImageURLs     []string           `spanner:"image_urls"`
	AverageRating float64            `spanner:"average_rating"`
	ReviewCount   int64              `spanner:"review_count"`
	CategoryID    string             `spanner:"category_id"`
	BrandName     spanner.NullString `spanner:"brand_name"`
	Colors        []string           `spanner:"colors"`
	WidthRange    []int64            `spanner:"width_range"`  // [gte, lte]
	DepthRange    []int64            `spanner:"depth_range"`  // [gte, lte]
	HeightRange   []int64            `spanner:"height_range"` // [gte, lte]
	JANCode       spanner.NullString `spanner:"jan_code"`
	Platform      xitem.Platform     `spanner:"platform"`
	UpdatedAt     time.Time          `spanner:"updated_at"`
}

func GetItem

func GetItem(ctx context.Context, spannerClient *spanner.Client, itemID string) (*Item, error)

func GetSameGroupItemsByItemID

func GetSameGroupItemsByItemID(ctx context.Context, spannerClient *spanner.Client, itemID string) ([]*Item, error)

type ItemCategory

type ItemCategory struct {
	ID        string             `spanner:"id"`
	Name      string             `spanner:"name"`
	Level     int64              `spanner:"level"`
	ParentID  spanner.NullString `spanner:"parent_id"`
	ImageURL  spanner.NullString `spanner:"image_url"`
	IsActive  bool               `spanner:"is_active"`
	UpdatedAt time.Time          `spanner:"updated_at"`
}

func GetAllActiveItemCategories

func GetAllActiveItemCategories(ctx context.Context, spannerClient *spanner.Client) ([]*ItemCategory, error)

func GetTopLevelItemCategories

func GetTopLevelItemCategories(ctx context.Context, spannerClient *spanner.Client) ([]*ItemCategory, error)

type ItemCategoryWithParent

type ItemCategoryWithParent struct {
	*ItemCategory
	Parent *ItemCategoryWithParent
}

func GetAllActiveItemCategoriesWithParent

func GetAllActiveItemCategoriesWithParent(ctx context.Context, spannerClient *spanner.Client) ([]*ItemCategoryWithParent, error)

func (*ItemCategoryWithParent) CategoryIDs

func (i *ItemCategoryWithParent) CategoryIDs() []string

CategoryIDs returns hierarchized category ids from top level category id to current category id

func (*ItemCategoryWithParent) CategoryNames

func (i *ItemCategoryWithParent) CategoryNames() []string

CategoryNames returns hierarchized category names from top level category name to current category name

type RakutenItemGenre

type RakutenItemGenre struct {
	ID             int64             `spanner:"id"`
	Name           string            `spanner:"name"`
	Level          int64             `spanner:"level"`
	ParentID       spanner.NullInt64 `spanner:"parent_id"`
	ItemCategoryID string            `spanner:"item_category_id"`
	UpdatedAt      time.Time         `spanner:"updated_at"`
}

RakutenItemGenre represents Genre (equivalent of item category in Kagumiru) used in Rakuten

func GetAllRakutenItemGenres

func GetAllRakutenItemGenres(ctx context.Context, spannerClient *spanner.Client) ([]*RakutenItemGenre, error)

type RakutenTag

type RakutenTag struct {
	ID         int64     `spanner:"id"`
	Name       string    `spanner:"name"`
	TagGroupID int64     `spanner:"tag_group_id"`
	UpdatedAt  time.Time `spanner:"updated_at"`
}

RakutenTag represents Tag in Rakuten

func GetAllRakutenTags

func GetAllRakutenTags(ctx context.Context, spannerClient *spanner.Client) ([]*RakutenTag, error)

type RakutenTagGroup

type RakutenTagGroup struct {
	ID        int64     `spanner:"id"`
	Name      string    `spanner:"name"`
	UpdatedAt time.Time `spanner:"updated_at"`
}

RakutenTagGroup represents Tag group in Rakuten

type YahooShoppingItemCategory

type YahooShoppingItemCategory struct {
	ID             int64             `spanner:"id"`
	Name           string            `spanner:"name"`
	Level          int64             `spanner:"level"`
	ParentID       spanner.NullInt64 `spanner:"parent_id"`
	ItemCategoryID string            `spanner:"item_category_id"`
	UpdatedAt      time.Time         `spanner:"updated_at"`
}

YahooShoppingItemCategory represents item category used in Yahoo Shopping

func GetAllYahooShoppingItemCategories

func GetAllYahooShoppingItemCategories(ctx context.Context, spannerClient *spanner.Client) ([]*YahooShoppingItemCategory, error)

Jump to

Keyboard shortcuts

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