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

Method SetDefaults

plugins/destination/azblob/client/spec/spec.go:43–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43func (s *Spec) SetDefaults() {
44 if s.BatchSize == nil {
45 if s.NoRotate {
46 s.BatchSize = int64ptr(0)
47 } else {
48 s.BatchSize = int64ptr(10000)
49 }
50 }
51 if s.BatchSizeBytes == nil {
52 if s.NoRotate {
53 s.BatchSizeBytes = int64ptr(0)
54 } else {
55 s.BatchSizeBytes = int64ptr(50 * 1024 * 1024) // 50 MiB
56 }
57 }
58 if s.BatchTimeout == nil {
59 if s.NoRotate {
60 d := configtype.NewDuration(0)
61 s.BatchTimeout = &d
62 } else {
63 d := configtype.NewDuration(30 * time.Second)
64 s.BatchTimeout = &d
65 }
66 }
67}
68
69func (s *Spec) Validate() error {
70 if len(s.StorageAccount) == 0 {

Callers 3

NewFunction · 0.45
ValidateMethod · 0.45
TestSpec_SetDefaultsFunction · 0.45

Calls 1

int64ptrFunction · 0.70

Tested by 1

TestSpec_SetDefaultsFunction · 0.36