drivers

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SalesCollection    = "sales"
	EarningsCollection = "earnings"
)
View Source
const (
	GooglePlayType = "google_play"
)
View Source
const SignatureLayout = "2006-01-02T15:04:05.000Z"

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, name string, sourceConfig *SourceConfig) (map[string]Driver, error)

Create source drivers per collection Enrich incoming configs with default values if needed

Types

type Driver

type Driver interface {
	io.Closer
	GetAllAvailableIntervals() ([]*TimeInterval, error)
	GetObjectsFor(interval *TimeInterval) ([]map[string]interface{}, error)

	Type() string
}

type GooglePlay

type GooglePlay struct {
	// contains filtered or unexported fields
}

func NewGooglePlay

func NewGooglePlay(ctx context.Context, config *GooglePlayConfig, collection string) (*GooglePlay, error)

func (*GooglePlay) Close

func (gp *GooglePlay) Close() error

func (*GooglePlay) GetAllAvailableIntervals

func (gp *GooglePlay) GetAllAvailableIntervals() ([]*TimeInterval, error)

func (*GooglePlay) GetObjectsFor

func (gp *GooglePlay) GetObjectsFor(interval *TimeInterval) ([]map[string]interface{}, error)

func (*GooglePlay) Type

func (gp *GooglePlay) Type() string

type GooglePlayConfig

type GooglePlayConfig struct {
	AccountId string      `mapstructure:"account_id" json:"account_id,omitempty" yaml:"account_id,omitempty"`
	KeyFile   interface{} `mapstructure:"key_file" json:"key_file,omitempty" yaml:"key_file,omitempty"`
	// contains filtered or unexported fields
}

func (*GooglePlayConfig) Validate

func (gpc *GooglePlayConfig) Validate() error

type Granularity

type Granularity string
const (
	DAY   Granularity = "DAY"
	MONTH Granularity = "MONTH"
	YEAR  Granularity = "YEAR"
)

func (Granularity) Format

func (g Granularity) Format(t time.Time) string

func (Granularity) Lower

func (g Granularity) Lower(t time.Time) time.Time

func (Granularity) String

func (g Granularity) String() string

func (Granularity) Upper

func (g Granularity) Upper(t time.Time) time.Time

type SourceConfig

type SourceConfig struct {
	Type         string   `mapstructure:"type" json:"type,omitempty" yaml:"type,omitempty"`
	Destinations []string `mapstructure:"destinations" json:"destinations,omitempty" yaml:"destinations,omitempty"`
	Collections  []string `mapstructure:"collections" json:"collections,omitempty" yaml:"collections,omitempty"`

	Config map[string]interface{} `mapstructure:"config" json:"config,omitempty" yaml:"config,omitempty"`
}

type TimeInterval

type TimeInterval struct {
	TimeZoneId string
	// contains filtered or unexported fields
}

func NewTimeInterval

func NewTimeInterval(granularity Granularity, t time.Time) *TimeInterval

func (*TimeInterval) CalculateSignatureFrom

func (ti *TimeInterval) CalculateSignatureFrom(t time.Time) string

func (*TimeInterval) LowerEndpoint

func (ti *TimeInterval) LowerEndpoint() time.Time

func (*TimeInterval) String

func (ti *TimeInterval) String() string

func (*TimeInterval) UpperEndpoint

func (ti *TimeInterval) UpperEndpoint() time.Time

Jump to

Keyboard shortcuts

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