Documentation ¶
Index ¶
- Variables
- func SetLogLevel(level string)
- func StartLambda(handler Handler, reader ...*rlogs.Reader)
- type Arguments
- func (x *Arguments) BindEvent(ev interface{}) error
- func (x *Arguments) ChunkService() *service.ChunkService
- func (x *Arguments) DecapSQSEvent() ([]EventRecord, error)
- func (x *Arguments) MetaService() *service.MetaService
- func (x *Arguments) RecordService() *service.RecordService
- func (x *Arguments) S3Service() *service.S3Service
- func (x *Arguments) SQSService() *service.SQSService
- type EnvVars
- type EventRecord
- type Handler
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = internal.Logger
Logger is common logger gateway
Functions ¶
func SetLogLevel ¶
func SetLogLevel(level string)
func StartLambda ¶
StartLambda initialize AWS Lambda and invokes handler
Types ¶
type Arguments ¶
type Arguments struct { EnvVars Event interface{} NewS3 adaptor.S3ClientFactory `json:"-"` NewSQS adaptor.SQSClientFactory `json:"-"` ChunkRepo repository.ChunkRepository `json:"-"` MetaRepo repository.MetaRepository `json:"-"` NewEncoder adaptor.EncoderFactory `json:"-"` NewDecoder adaptor.DecoderFactory `json:"-"` // Only required for indexer Reader *rlogs.Reader }
Arguments has environment variables, Event record and adaptor
func (*Arguments) ChunkService ¶
func (x *Arguments) ChunkService() *service.ChunkService
ChunkService provides ChunkRepository implementation (DynamoDB)
func (*Arguments) DecapSQSEvent ¶
func (x *Arguments) DecapSQSEvent() ([]EventRecord, error)
DecapSQSEvent decapslates wrapped body data in SQSEvent
func (*Arguments) MetaService ¶
func (x *Arguments) MetaService() *service.MetaService
func (*Arguments) RecordService ¶
func (x *Arguments) RecordService() *service.RecordService
RecordService provides encode/decode logic and S3 access for normalized log data
func (*Arguments) SQSService ¶
func (x *Arguments) SQSService() *service.SQSService
SQSService provides service.SQSService with SQS adaptor
type EnvVars ¶
type EnvVars struct { // From arguments AthenaDBName string `env:"ATHENA_DB_NAME"` S3Region string `env:"S3_REGION"` S3Bucket string `env:"S3_BUCKET"` S3Prefix string `env:"S3_PREFIX"` SentryDSN string `env:"SENTRY_DSN"` SentryEnv string `env:"SENTRY_ENVIRONMENT"` LogLevel string `env:"LOG_LEVEL"` // From resource MetaTableName string `env:"META_TABLE_NAME"` ChunkTableName string `env:"CHUNK_TABLE_NAME"` PartitionQueueURL string `env:"PARTITION_QUEUE_URL"` ComposeQueueURL string `env:"COMPOSE_QUEUE_URL"` MergeQueueURL string `env:"MERGE_QUEUE_URL"` // From AWS Lambda AwsRegion string `env:"AWS_REGION"` }
EnvVars has all environment variables that should be given to Lambda function
func (*EnvVars) BindEnvVars ¶
BindEnvVars loads environments variables and set them to EnvVars
type EventRecord ¶
type EventRecord []byte
EventRecord is decapslated event data (e.g. Body of SQS event)
func (EventRecord) Bind ¶
func (x EventRecord) Bind(ev interface{}) error
Bind unmarshal event record to object
Click to show internal directories.
Click to hide internal directories.