Documentation
¶
Index ¶
- func EnsureCategory(ctx context.Context, tx *sqlx.Tx, cat *db.Category) (*db.Category, error)
- func EnsureDateTime(ctx context.Context, tx *sqlx.Tx, dt *db.DateTime) (*db.DateTime, error)
- func EnsureDiscount(ctx context.Context, tx *sqlx.Tx, ensureDiscount *db.Discount) (*db.Discount, error)
- func EnsureFact(ctx context.Context, tx *sqlx.Tx, ensureFact *db.Fact) (*db.Fact, error)
- func EnsureProduct(ctx context.Context, tx *sqlx.Tx, ensureProduct *db.Product) (*db.Product, error)
- func EnsureQuery(ctx context.Context, tx *sqlx.Tx, ensureQuery *db.Query) (*db.Query, error)
- func EnsureTenant(ctx context.Context, tx *sqlx.Tx, ensureTenant *db.Tenant) (*db.Tenant, error)
- func GetBestMatchingDiscount(ctx context.Context, tx *sqlx.Tx, source string, timestamp time.Time) (*db.Discount, error)
- func GetBestMatchingProduct(ctx context.Context, tx *sqlx.Tx, source string, timestamp time.Time) (*db.Product, error)
- func GetByFact(ctx context.Context, tx *sqlx.Tx, fact *db.Fact) (*db.Fact, error)
- func GetCategory(ctx context.Context, tx *sqlx.Tx, source string) (*db.Category, error)
- func GetDateTime(ctx context.Context, tx *sqlx.Tx, timestamp time.Time) (*db.DateTime, error)
- func GetQueryByName(ctx context.Context, tx *sqlx.Tx, name string) (*db.Query, error)
- func GetTenantBySource(ctx context.Context, tx *sqlx.Tx, source string) (*db.Tenant, error)
- func NewDateTime(timestamp time.Time) *db.DateTime
- func NewFact(dateTime *db.DateTime, query *db.Query, tenant *db.Tenant, ...) *db.Fact
- type Record
- type Store
- type TokenizedSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureCategory ¶
func EnsureDateTime ¶
func EnsureDiscount ¶
func EnsureFact ¶
func EnsureProduct ¶
func EnsureQuery ¶
func EnsureTenant ¶
func GetBestMatchingDiscount ¶
func GetBestMatchingProduct ¶
func GetCategory ¶
func GetDateTime ¶
func GetQueryByName ¶
func GetTenantBySource ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Initialize ¶
func (r *Store) Initialize(ctx context.Context, products []*db.Product, discounts []*db.Discount, queries []*db.Query) error
Initialize uses a transaction to ensure given entities in reporting store.
func (*Store) WithTransaction ¶
WithTransaction runs fn within a transaction and does commit/rollback when necessary.
type TokenizedSource ¶
type TokenizedSource struct {
Tokens []string
}
Does not do much, we mostly have this to make the code more readable (better than 2D string arrays)
func FindBestMatchingTokenizedSource ¶
func FindBestMatchingTokenizedSource(reference *TokenizedSource, candidates []*TokenizedSource) *TokenizedSource
func NewTokenizedSource ¶
func NewTokenizedSource(source string) *TokenizedSource
func (*TokenizedSource) Equals ¶
func (ts *TokenizedSource) Equals(other *TokenizedSource) bool
func (TokenizedSource) String ¶
func (ts TokenizedSource) String() string
Click to show internal directories.
Click to hide internal directories.