Documentation ¶
Index ¶
- Constants
- Variables
- func BoolValue(b *bool) bool
- func DryRun(configFile string, opt *Option) error
- func Import(ctx context.Context, event Event) (int, error)
- func Run(configFile string, opt *Option) error
- func RunWithContext(ctx context.Context, configFile string, opt *Option) error
- type BatchItemFailureItem
- type Config
- type Credentials
- type Event
- type EventRecord
- type MaxExecutionTimeReachedError
- type NoMessageError
- type Option
- type Redshift
- type S3
- type S3Bucket
- type S3Event
- type S3Object
- type SQLParam
- type SQSBatchResponse
- type SessionStore
- type SnsEvent
- type Target
- func (t *Target) BuildCopySQL(key string, cred Credentials, capture *[]string) (string, error)
- func (target *Target) ConnectToRedshift(ctx context.Context) (*sql.DB, error)
- func (target *Target) DisconnectToRedshift()
- func (target *Target) ImportRedshift(ctx context.Context, record *EventRecord, cap *[]string) error
- func (t *Target) Match(bucket, key string) (bool, *[]string)
- func (t *Target) MatchEventRecord(r *EventRecord) (bool, *[]string)
- func (t *Target) String() string
Constants ¶
View Source
const ( S3URITemplate = "s3://%s/%s" SQLTemplate = "/* Rin */ COPY %s FROM %s CREDENTIALS '%s' REGION '%s' %s" DriverPostgres = "postgres" DriverRedshiftData = "redshift-data" )
Variables ¶
View Source
var MaxDeleteRetry = 8
Functions ¶
Types ¶
type BatchItemFailureItem ¶ added in v1.3.0
type BatchItemFailureItem struct {
ItemIdentifier string `json:"itemIdentifier"`
}
type Config ¶
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 Event ¶
type Event struct { Records []*EventRecord `json:"Records"` Event string Bucket string }
func ParseEvent ¶
func (Event) IsTestEvent ¶ added in v1.1.2
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 MaxExecutionTimeReachedError ¶ added in v1.3.2
type MaxExecutionTimeReachedError struct{}
func (MaxExecutionTimeReachedError) Error ¶ added in v1.3.2
func (e MaxExecutionTimeReachedError) Error() 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 Option ¶ added in v1.3.2
type Redshift ¶
type Redshift struct { Driver string `yaml:"driver"` // for postgres driver Host string `yaml:"host"` Port int `yaml:"port"` // for redshift-data driver provisioned Cluster string `yaml:"cluster"` // for redshift-data driver serverless Workgroup string `yaml:"workgroup"` DBName string `yaml:"dbname"` User string `yaml:"user"` Password string `yaml:"password"` Schema string `yaml:"schema"` Table string `yaml:"table"` ReconnectOnError *bool `yaml:"reconnect_on_error"` }
func (Redshift) UseTransaction ¶ added in v1.3.0
func (Redshift) VisibleDSN ¶ added in v0.0.8
type S3 ¶
type SQSBatchResponse ¶ added in v1.3.0
type SQSBatchResponse struct {
BatchItemFailures []BatchItemFailureItem `json:"batchItemFailures,omitempty"`
}
type SessionStore ¶ added in v1.0.0
type SessionStore struct { SQS *aws.Config SQSOptFns []func(*sqs.Options) Redshift *aws.Config RedshiftOptFns []func(*redshift.Options) S3 *aws.Config S3OptFns []func(*s3.Options) }
var Sessions *SessionStore
type Target ¶
type Target struct { Redshift *Redshift `yaml:"redshift"` S3 *S3 `yaml:"s3"` SQLOption string `yaml:"sql_option"` Break bool `yaml:"break"` Discard bool `yaml:"discard"` // contains filtered or unexported fields }
func (*Target) BuildCopySQL ¶
func (*Target) ConnectToRedshift ¶ added in v1.3.0
func (*Target) DisconnectToRedshift ¶ added in v1.3.0
func (target *Target) DisconnectToRedshift()
func (*Target) ImportRedshift ¶ added in v1.3.0
func (*Target) MatchEventRecord ¶
func (t *Target) MatchEventRecord(r *EventRecord) (bool, *[]string)
Click to show internal directories.
Click to hide internal directories.