Documentation
¶
Index ¶
- Constants
- Variables
- func ConnectToRedshift(target *Target) (*sql.DB, error)
- func Import(event Event) (int, error)
- func ImportRedshift(target *Target, record *EventRecord, cap *[]string) error
- func Run(configFile string, batchMode bool) error
- type AuthExpiration
- type Config
- type Credentials
- type Event
- type EventRecord
- type NoMessageError
- type Redshift
- type S3
- type S3Bucket
- type S3Event
- type S3Object
- type SQLParam
- type Target
Constants ¶
View Source
const ( S3URITemplate = "s3://%s/%s" SQLTemplate = "/* Rin */ COPY %s FROM %s CREDENTIALS '%s' REGION '%s' %s" )
Variables ¶
View Source
var Debug bool
View Source
var MaxDeleteRetry = 8
View Source
var Runnable bool
View Source
var SQS *sqs.SQS
Functions ¶
func ImportRedshift ¶
func ImportRedshift(target *Target, record *EventRecord, cap *[]string) error
Types ¶
type AuthExpiration ¶ added in v0.1.0
type AuthExpiration struct {
// contains filtered or unexported fields
}
func (AuthExpiration) Error ¶ added in v0.1.0
func (e AuthExpiration) Error() string
func (AuthExpiration) Signal ¶ added in v0.1.0
func (e AuthExpiration) Signal()
func (AuthExpiration) String ¶ added in v0.1.0
func (e AuthExpiration) String() string
type Config ¶
type Config struct {
QueueName string `yaml:"queue_name"`
Targets []*Target `yaml:"targets"`
Credentials Credentials `yaml:"credentials"`
Redshift *Redshift `yaml:"redshift"`
S3 *S3 `yaml:"s3"`
SQLOption string `yaml:"sql_option"`
}
func LoadConfig ¶
type Credentials ¶
type Credentials struct {
AWS_ACCESS_KEY_ID string `yaml:"aws_access_key_id"`
AWS_SECRET_ACCESS_KEY string `yaml:"aws_secret_access_key"`
AWS_REGION string `yaml:"aws_region"`
AWS_IAM_ROLE string `yaml:"aws_iam_role"`
}
func (Credentials) RedshiftCredential ¶ added in v0.1.2
func (c Credentials) RedshiftCredential() string
type EventRecord ¶
type EventRecord struct {
EventVersion string `json:"eventVersion"`
EventName string `json:"eventName"`
EventSource string `json:"eventSource"`
EventTime string `json:"eventTime"`
AWSRegion string `json:"awsRegion"`
S3 S3Event `json:"s3"`
}
func (EventRecord) String ¶
func (r EventRecord) String() string
type NoMessageError ¶ added in v0.0.6
type NoMessageError struct {
// contains filtered or unexported fields
}
func (NoMessageError) Error ¶ added in v0.0.6
func (e NoMessageError) Error() string
type Redshift ¶
type Redshift struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
DBName string `yaml:"dbname"`
User string `yaml:"user"`
Password string `yaml:"password"`
Schema string `yaml:"schema"`
Table string `yaml:"table"`
}
func (Redshift) VisibleDSN ¶ added in v0.0.8
type S3 ¶
type Target ¶
type Target struct {
Redshift *Redshift `yaml:"redshift"`
S3 *S3 `yaml:"s3"`
SQLOption string `yaml:"sql_option"`
// contains filtered or unexported fields
}
func (*Target) BuildCopySQL ¶
func (*Target) MatchEventRecord ¶
func (t *Target) MatchEventRecord(r *EventRecord) (bool, *[]string)
Click to show internal directories.
Click to hide internal directories.