tables

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

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

Go to latest
Published: Jan 29, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicLoader

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

DynamicLoader fetches configs on an interval, with stats on the fetching process.

func NewDynamicLoader

func NewDynamicLoader(
	fetcher fetcher.ConfigFetcher,
	reloadTime,
	retryDelay time.Duration,
	stats reporter.StatsLogger,
	tConfigs map[string]transformer.MappingTransformerConfig,
	geoip geoip.GeoLookup,
) (*DynamicLoader, error)

NewDynamicLoader returns a new DynamicLoader, performing the first fetch.

func (*DynamicLoader) Close

func (d *DynamicLoader) Close()

Close stops the DynamicLoader's fetching process.

func (*DynamicLoader) Crank

func (d *DynamicLoader) Crank()

Crank is a blocking function that refreshes the config on an interval.

func (*DynamicLoader) GetColumnsForEvent

func (d *DynamicLoader) GetColumnsForEvent(eventName string) ([]transformer.RedshiftType, error)

GetColumnsForEvent returns the transformers for the given event.

func (*DynamicLoader) GetVersionForEvent

func (d *DynamicLoader) GetVersionForEvent(eventName string) int

GetVersionForEvent returns the current version of the given event.

type StaticLoader

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

StaticLoader is a static set of transformers and versions.

func NewStaticLoader

func NewStaticLoader(config map[string][]transformer.RedshiftType, versions map[string]int) *StaticLoader

NewStaticLoader creates a StaticLoader from the given configs and versions.

func (*StaticLoader) GetColumnsForEvent

func (s *StaticLoader) GetColumnsForEvent(eventName string) ([]transformer.RedshiftType, error)

GetColumnsForEvent returns the transformers for the given event.

func (*StaticLoader) GetVersionForEvent

func (s *StaticLoader) GetVersionForEvent(eventName string) int

GetVersionForEvent returns the current version of the given event.

type Tables

type Tables struct {
	Configs []scoop_protocol.Config
}

Tables is a list of versioned events and their definitions.

func LoadConfig

func LoadConfig(file io.Reader) (Tables, error)

LoadConfig loads a Tables from the given io.Reader.

func (*Tables) CompileForMaintenance

func (c *Tables) CompileForMaintenance() map[string]scoop_protocol.Config

CompileForMaintenance turns our list of Configs into a map.

func (*Tables) CompileForParsing

func (c *Tables) CompileForParsing(
	tConfigs map[string]transformer.MappingTransformerConfig,
	geoip geoip.GeoLookup,
) (map[string][]transformer.RedshiftType, map[string]int, error)

CompileForParsing returns a map of transformers and versions for our table configs.

Jump to

Keyboard shortcuts

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