MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / SetDefaults

Method SetDefaults

plugins/destination/file/client/spec/spec.go:64–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64func (s *Spec) SetDefaults() {
65 if !strings.Contains(s.Path, varTable) {
66 s.Path = path.Join(s.Path, fmt.Sprintf("%s.%s", varTable, s.Format))
67 }
68 if s.BatchSize == nil {
69 if s.NoRotate {
70 s.BatchSize = ptr(int64(0))
71 } else {
72 s.BatchSize = ptr(int64(10000))
73 }
74 }
75 if s.BatchSizeBytes == nil {
76 if s.NoRotate {
77 s.BatchSizeBytes = ptr(int64(0))
78 } else {
79 s.BatchSizeBytes = ptr(int64(50 * 1024 * 1024)) // 50 MiB
80 }
81 }
82 if s.BatchTimeout == nil {
83 if s.NoRotate {
84 d := configtype.NewDuration(0)
85 s.BatchTimeout = &d
86 } else {
87 d := configtype.NewDuration(30 * time.Second)
88 s.BatchTimeout = &d
89 }
90 }
91}
92
93func (s *Spec) Validate() error {
94 if len(s.Path) == 0 {

Callers 3

NewFunction · 0.45
ValidateMethod · 0.45
TestSpec_SetDefaultsFunction · 0.45

Calls 1

ptrFunction · 0.70

Tested by 1

TestSpec_SetDefaultsFunction · 0.36