lib

package
v0.0.0-...-fccd001 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2015 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIConfigConsumer ...
	APIConfigConsumer = "api"
	// TrackerConfigConsumer ...
	TrackerConfigConsumer = "tracker"
	// ActionsWorkerConfigConsumer ...
	ActionsWorkerConfigConsumer = "worker/actions"
)
View Source
const (
	// ConditionTypeEqual ...
	ConditionTypeEqual = "equal"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Config
}

APIConfig ...

type ActionCreator

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

ActionCreator ...

func NewActionCreator

func NewActionCreator(geoIP *geoip2.Reader) *ActionCreator

NewActionCreator ...

func (*ActionCreator) Create

func (ac *ActionCreator) Create(trackRequest *TrackRequest) (*models.ActionEntity, error)

Create creates visit object based on given track request.

type ActionsWorkerConfig

type ActionsWorkerConfig struct {
	Config
	Worker       WorkerConfig `xml:"worker"`
	MetricsGroup XMLMetrics   `xml:"metrics"`
}

ActionsWorkerConfig ...

type CassandraConfig

type CassandraConfig struct {
	Hosts []struct {
		Host string `xml:"host"`
	} `xml:"hosts"`
	Keyspace string `xml:"keyspace"`
}

CassandraConfig ...

func (CassandraConfig) GetHosts

func (cc CassandraConfig) GetHosts() []string

GetHosts ...

type Condition

type Condition struct {
	Type  string `xml:"type,attr"`
	Value string `xml:",chardata"`
}

Condition ...

func (*Condition) Meets

func (c *Condition) Meets(value string) bool

Meets ...

type Config

type Config struct {
	Server    ServerConfig    `xml:"server"`
	Logger    LoggerConfig    `xml:"logger"`
	Cassandra CassandraConfig `xml:"cassandra"`
	GeoIP     GeoIPConfig     `xml:"geo-ip"`
	Kafka     KafkaConfig     `xml:"kafka"`
}

Config ...

type ConsoleFormatter

type ConsoleFormatter struct {
	ForceColors   bool
	DisableColors bool
}

ConsoleFormatter ...

func (*ConsoleFormatter) Format

func (cf *ConsoleFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format ...

type Dimension

type Dimension struct {
	Name      string    `xml:"name"`
	Condition Condition `xml:"condition"`
}

Dimension ...

type Executor

type Executor interface {
	Execute() (string, error)
}

Executor is an interface that should implement every Command.

type GeoIPConfig

type GeoIPConfig struct {
	Path string `xml:"path"`
}

GeoIPConfig ...

type KafkaConfig

type KafkaConfig struct {
	ConnectionString string `xml:"connection-string"`
	Publishers       struct {
		Action KafkaPublisherConfig `xml:"action"`
	} `xml:"publishers"`
	Consumers struct {
		Action KafkaConsumerConfig `xml:"action"`
	} `xml:"consumers"`
}

KafkaConfig describes configuration of kafka messaging system.

type KafkaConsumerConfig

type KafkaConsumerConfig struct {
	Topic     string `xml:"topic"`
	Partition int    `xml:"partition"`
	Offset    uint64 `xml:"offset"`
	MaxSize   uint32 `xml:"max-size"`
}

KafkaConsumerConfig describes configuration of kafka consumer.

type KafkaPublisher

type KafkaPublisher struct {
	Client *sarama.Client
	Config KafkaConfig
}

KafkaPublisher ...

func (*KafkaPublisher) PublishAction

func (kp *KafkaPublisher) PublishAction(message string) error

PublishAction ...

type KafkaPublisherConfig

type KafkaPublisherConfig struct {
	Topic     string `xml:"topic"`
	Partition int    `xml:"partition"`
}

KafkaPublisherConfig describes configuration of kafka publisher.

type LoggerConfig

type LoggerConfig struct {
	Adapter  string `xml:"adapter"`
	Settings string `xml:"settings"`
}

LoggerConfig ...

type Metric

type Metric struct {
	Dimensions []Dimension
}

Metric ...

func (*Metric) DimensionsNamesAndDimensionsValues

func (m *Metric) DimensionsNamesAndDimensionsValues() (string, string)

DimensionsNamesAndDimensionsValues ...

func (*Metric) SortDimensions

func (m *Metric) SortDimensions()

SortDimensions ...

type MetricRequestMatcher

type MetricRequestMatcher struct {
	Metrics []Metric
}

MetricRequestMatcher ...

func NewMetricRequestMatcherFromConfig

func NewMetricRequestMatcherFromConfig(config *ActionsWorkerConfig) *MetricRequestMatcher

NewMetricRequestMatcherFromConfig ...

func (*MetricRequestMatcher) Matching

func (mg *MetricRequestMatcher) Matching(trackRequest *TrackRequest) []Metric

Matching ...

type RepositoryManager

type RepositoryManager struct {
	VisitActions repositories.VisitActionsRepository
	// Metric by value
	MetricDayByValueCounter   repositories.MetricDayByValueCounterRepository
	MetricMonthByValueCounter repositories.MetricMonthByValueCounterRepository
	MetricYearByValueCounter  repositories.MetricYearByValueCounterRepository
	// Metric by time frame
	MetricDayByMinuteCounter repositories.MetricDayByMinuteCounterRepository
	MetricMonthByHourCounter repositories.MetricMonthByHourCounterRepository
	MetricYearByDayCounter   repositories.MetricYearByDayCounterRepository
}

RepositoryManager ...

type ServerConfig

type ServerConfig struct {
	Host string `xml:"host"`
	Port string `xml:"port"`
}

ServerConfig ...

func (*ServerConfig) GetAddress

func (sc *ServerConfig) GetAddress() string

GetAddress ...

type TrackRequest

type TrackRequest struct {
	SiteID                 int64
	RemoteAddress          string
	Domain                 string
	VisitID                string
	InitializeVisit        bool
	PageTitle              string
	PageHost               string
	PageURL                string
	Language               string
	Referrer               string
	BrowserPluginJava      bool
	BrowserName            string
	BrowserVersion         string
	BrowserMajorVersion    string
	BrowserUserAgent       string
	BrowserPlatform        string
	BrowserCookie          bool
	BrowserIsOnline        bool
	BrowserWindowWidth     int64
	BrowserWindowHeight    int64
	OperatingSystemName    string
	OperatingSystemVersion string
	ScreenWidth            int64
	ScreenHeight           int64
	DeviceName             string
	DeviceIsTablet         bool
	DeviceIsPhone          bool
	DeviceIsMobile         bool
	ServerTime             time.Time
}

TrackRequest ...

func (*TrackRequest) CreateMap

func (tr *TrackRequest) CreateMap() map[string]string

CreateMap ...

func (*TrackRequest) GetRequestIP

func (tr *TrackRequest) GetRequestIP() string

GetRequestIP ...

func (*TrackRequest) IsValidVisitID

func (tr *TrackRequest) IsValidVisitID() bool

IsValidVisitID ...

func (*TrackRequest) ParseVisitID

func (tr *TrackRequest) ParseVisitID() (gocql.UUID, error)

ParseVisitID ...

type TrackerConfig

type TrackerConfig struct {
	Config
}

TrackerConfig ...

type Worker

type Worker interface {
	DoIt() int
}

Worker ...

type WorkerConfig

type WorkerConfig struct {
	Concurency int64 `xml:"concurency"`
}

WorkerConfig ...

type XMLDimensions

type XMLDimensions struct {
	XMLName    xml.Name    `xml:"dimensions"`
	Dimensions []Dimension `xml:"dimension"`
}

XMLDimensions ...

type XMLMetric

type XMLMetric struct {
	XMLName         xml.Name      `xml:"metric"`
	DimensionsGroup XMLDimensions `xml:"dimensions"`
}

XMLMetric ...

type XMLMetrics

type XMLMetrics struct {
	XMLName xml.Name    `xml:"metrics"`
	Metrics []XMLMetric `xml:"metric"`
}

XMLMetrics ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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