Documentation ¶
Index ¶
- func CreateLogMessage(publicationPoint, campaign, signalID string, is models.ItemScore) ([]byte, error)
- func ESCredentials(username, password string) func(*es.Config)
- func KafkaCredentials(username, password string) func(*sarama.Config)
- func KafkaSASLMechanism(m string) func(*sarama.Config)
- type ElasticSearchLogs
- type KakfaLog
- type RecommendationLog
- type RowLog
- type StdoutLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateLogMessage ¶
func CreateLogMessage(publicationPoint, campaign, signalID string, is models.ItemScore) ([]byte, error)
CreateLogMessage append extra information to the item score object
func ESCredentials ¶
ESCredentials functional option for the kafka configuration
func KafkaCredentials ¶
KafkaCredentials functional option for the kafka configuration For functional options see: https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
func KafkaSASLMechanism ¶
KafkaSASLMechanism functional option for the kafka configuration Values accepted: "OAUTHBEARER", "PLAIN", "SCRAM-SHA-256", "SCRAM-SHA-512", "GSSAPI"
Types ¶
type ElasticSearchLogs ¶
ElasticSearchLogs is the struct that contains the information of ElasticSearch
func NewElasticSearchLogs ¶
func NewElasticSearchLogs(addresses string, index string, options ...func(*es.Config)) (ElasticSearchLogs, error)
NewElasticSearchLogs creates a new object for sending logs to ElasticSearch For functional options see: https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
func (ElasticSearchLogs) Write ¶
func (es ElasticSearchLogs) Write(rl RowLog) error
type KakfaLog ¶
type KakfaLog struct { Producer sarama.SyncProducer Topic string }
KakfaLog is the object for sending the logs to Kafa
func NewKafkaLogs ¶
NewKafkaLogs create a new object for interacting with Kafka
type RecommendationLog ¶
RecommendationLog is the interface for the different type of logging system
type RowLog ¶
type RowLog struct { PublicationPoint string Campaign string SignalID string ItemScores []models.ItemScore }
RowLog is the object that will be written in the logs
type StdoutLog ¶
StdoutLog is the object that handles the writing to stdout
func NewStdoutLog ¶
func NewStdoutLog() StdoutLog
NewStdoutLog creates a new object for logging the recommendations to the stdoutput