123456789101112131415161718192021222324252627282930 |
- package db
- import (
- "github.com/gshopify/service-wrapper/model"
- "github.com/gshopify/service-wrapper/server/middleware"
- "gshopper.com/gshopify/products/graphql/generated"
- "time"
- )
- const (
- cacheTimeout = time.Hour
- cacheCapacity = 4096
- )
- type Database interface {
- Ping() error
- Close() error
- Product(ln model.LanguageCode, handle *string, id *string) (*generated.Product, error)
- Products(ln model.LanguageCode, collectionId *string) ([]*generated.Product, error)
- ProductOptions(ln model.LanguageCode, id string) ([]*generated.ProductOption, error)
- ProductVariants(ctx *middleware.GShopifyContext, id string) ([]*generated.ProductVariant, error)
- ProductVariantOptions(ln model.LanguageCode, id string) ([]*generated.SelectedOption, error)
- ProductTags() ([]*model.ProductTag, error)
- ProductTypes() ([]*model.ProductType, error)
- Collection(ln model.LanguageCode, handle *string, id *string) (*generated.Collection, error)
- Collections(ln model.LanguageCode) ([]*generated.Collection, error)
- ProductCollections(ln model.LanguageCode, id string) ([]*generated.Collection, error)
- }
|