Documentation
¶
Index ¶
- Constants
- type Compression
- type CustomKey
- type Field
- type Overflow
- type Partition
- type Replace
- type Resource
- type Rule
- func (r *Rule) ArchiveWalkURL(URL string) string
- func (r *Rule) GetPreserveDepth() int
- func (r *Rule) HasMatch(URL string) bool
- func (r *Rule) HasPreserveDepth() bool
- func (r *Rule) HasSplit() bool
- func (r *Rule) HasTransformer() bool
- func (r *Rule) Init(ctx context.Context, fs afs.Service) error
- func (r *Rule) Name(URL string) string
- func (r *Rule) NewReplacer() *strings.Replacer
- func (r *Rule) Resources() []*Resource
- func (r *Rule) ShallArchiveWalk(URL string) bool
- func (r *Rule) SourceCompression(URL string) (source *Compression)
- func (r *Rule) Validate() error
- type Ruleset
- func (r Ruleset) Init(ctx context.Context, fs afs.Service) error
- func (r *Ruleset) Load(ctx context.Context, fs afs.Service) error
- func (r Ruleset) Match(URL string) (matched []*Rule)
- func (r *Ruleset) ReloadIfNeeded(ctx context.Context, fs afs.Service) (bool, error)
- func (r Ruleset) Rule(URL string) *Rule
- func (r Ruleset) Validate() error
- type Schema
- type Split
- type Streaming
- type Transcoding
Constants ¶
const ( //GZipCodec gzip code GZipCodec = "gzip" //GZIPExtension gzip extension GZIPExtension = ".gz" //AVROExtension avro extension AVROExtension = ".avro" //ZipCodec zip code ZipCodec = "zip" //ZIPExtension zip extension ZIPExtension = ".zip" //TarCodec tar code TarCodec = "tar" //TarExtension tar extension TarExtension = ".tar" )
const ( DataTypeTime = "time" DataTypeFloat = "float" DataTypeInt = "int" DataTypeBoolean = "boolean" DataTypeString = "string" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compression ¶
Compression represents conversion strategy
func NewCompressionForURL ¶
func NewCompressionForURL(URL string) *Compression
NewCompressionForURL returns compression for matched codec or nil
func (*Compression) Equals ¶
func (c *Compression) Equals(compression *Compression) bool
Equals returns true if compression is the same
type Field ¶
type Field struct {
Name string
Position *int
DataType string
SourceDateFormat string
SourceDateLayout string
TargetDateFormat string
TargetDateLayout string
}
Fields represents validation filed
func (*Field) AdjustText ¶
AdjustText adjust text value
func (*Field) AdjustValue ¶
AdjustText adjust text value
type Overflow ¶
Overflow defines overflow controls
func (Overflow) MessageDest ¶
func (Overflow) MessageEvent ¶
type Partition ¶
type Partition struct {
Field string
FieldIndex int
Separator string
Mod int
Hash string
// contains filtered or unexported fields
}
Partition represent partition split
type Resource ¶
type Resource struct {
matcher.Basic
Overflow *Overflow
Bucket string `json:",omitempty"`
URL string `json:",omitempty"`
Region string `json:",omitempty"`
CustomKey *CustomKey `json:",omitempty"`
Grant *option.Grant `json:",omitempty"`
ACL *option.ACL `json:",omitempty"`
ServerSideEncryption *option.ServerSideEncryption `json:",omitempty"`
Credentials *auth.Credentials `json:",omitempty"`
Proxy *option.Proxy
Topic string `json:",omitempty"`
Queue string `json:",omitempty"`
Vendor string `json:",omitempty"`
//Optional pubsub project ID, otherwise it uses default one.
ProjectID string `json:",omitempty"`
Pattern string `json:",omitempty"`
Parameters []*pattern.Param `json:",omitempty"`
// contains filtered or unexported fields
}
Represents a destination
func (Resource) CloneWithURL ¶
CloneWithURL clone resource with URL
type Rule ¶
type Rule struct {
Info base.Info
Disabled bool `json:",omitempty"`
Dest *Resource
Source *Resource
Replace []*Replace `json:",omitempty"`
Schema *Schema `json:",omitempty"`
Transcoder *Transcoding `json:",omitempty"`
Streaming *Streaming `json:",omitempty"`
Split *Split `json:",omitempty"`
AllowEmpty bool `json:",omitempty"`
job.Actions
*Compression
//PreserveDepth - preserves specified folder depth in dest URL
PreserveDepth *int `json:",omitempty"`
//Group defines group of rule to be matched, otherwise multi match is invalid
Group string `json:",omitempty"`
//Name of the file that is done flag, in that case all file will be replayed
DoneMarker string `json:",omitempty"`
}
Rule represent matching resource route rule
func (*Rule) ArchiveWalkURL ¶
func (*Rule) GetPreserveDepth ¶
GetPreserveDepth returns PreservceDepth
func (*Rule) HasPreserveDepth ¶
HasPreserveDepth returns true if property has been specified
func (*Rule) HasTransformer ¶
HasTransformer returns true if rule has recover or replace option
func (*Rule) NewReplacer ¶
NewReplacer create a replaced for the rule
func (*Rule) ShallArchiveWalk ¶
func (*Rule) SourceCompression ¶
func (r *Rule) SourceCompression(URL string) (source *Compression)
SourceCompression returns compression for URL
type Ruleset ¶
type Ruleset struct {
BaseURL string
CheckInMs int
Rules []*Rule
// contains filtered or unexported fields
}
Ruleset represents route slice
func (*Ruleset) ReloadIfNeeded ¶
type Schema ¶
type Split ¶
type Split struct {
//MaxLines max number lines in one split chunk
MaxLines int
//Template has to have %s placeholder for file name, and %d (or padded placeholder i.e. %04d) chunk number, %v is for partition
Template string
//Partition partition rule
Partition *Partition
//Schema format specific schema
Schema string
//SchemaURL format specific schema location
SchemaURL string
//MaxSize max size, if file larger then splits
MaxSize int
}
Split represents a split rule
type Streaming ¶
type Streaming struct {
ThresholdMb int
PartSizeMb int
ChecksumSkipThresholdMb int
// contains filtered or unexported fields
}
Streaming represents streaming option
func (*Streaming) ChecksumSkipThreshold ¶
ChecksumSkipThreshold upload checksum skip threshold
type Transcoding ¶
type Transcoding struct {
Source transcoding.Codec
Dest transcoding.Codec
PathMapping transcoding.Mappings
MaxBadRecords *int
Autodetect bool //detect source schema
}
Transcoding represents transcoding
func (*Transcoding) Validate ¶
func (t *Transcoding) Validate() error
Load check if transcoding is valid