forked from redpanda-data/connect
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config_sftp.go
41 lines (37 loc) · 1.35 KB
/
config_sftp.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package input
import (
sftpSetup "github.com/nehal119/benthos-119/pkg/impl/sftp/shared"
)
type watcherConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
MinimumAge string `json:"minimum_age" yaml:"minimum_age"`
PollInterval string `json:"poll_interval" yaml:"poll_interval"`
Cache string `json:"cache" yaml:"cache"`
}
// SFTPConfig contains configuration fields for the SFTP input type.
type SFTPConfig struct {
Address string `json:"address" yaml:"address"`
Credentials sftpSetup.Credentials `json:"credentials" yaml:"credentials"`
Paths []string `json:"paths" yaml:"paths"`
Codec string `json:"codec" yaml:"codec"`
DeleteOnFinish bool `json:"delete_on_finish" yaml:"delete_on_finish"`
MaxBuffer int `json:"max_buffer" yaml:"max_buffer"`
Watcher watcherConfig `json:"watcher" yaml:"watcher"`
}
// NewSFTPConfig creates a new SFTPConfig with default values.
func NewSFTPConfig() SFTPConfig {
return SFTPConfig{
Address: "",
Credentials: sftpSetup.Credentials{},
Paths: []string{},
Codec: "all-bytes",
DeleteOnFinish: false,
MaxBuffer: 1000000,
Watcher: watcherConfig{
Enabled: false,
MinimumAge: "1s",
PollInterval: "1s",
Cache: "",
},
}
}