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

Method Validate

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

Source from the content-addressed store, hash-verified

67}
68
69func (s *Spec) Validate() error {
70 if len(s.StorageAccount) == 0 {
71 return errors.New("`storage_account` is required")
72 }
73 if len(s.Container) == 0 {
74 return errors.New("`container` is required")
75 }
76 if len(s.Path) == 0 {
77 return errors.New("`path` is required")
78 }
79
80 if s.NoRotate && ((s.BatchSize != nil && *s.BatchSize > 0) || (s.BatchSizeBytes != nil && *s.BatchSizeBytes > 0) || (s.BatchTimeout != nil && s.BatchTimeout.Duration() > 0)) {
81 return errors.New("`no_rotate` cannot be used with non-zero `batch_size`, `batch_size_bytes` or `batch_timeout`")
82 }
83
84 // required for s.FileSpec.Validate call
85 err := s.FileSpec.UnmarshalSpec()
86 if err != nil {
87 return err
88 }
89 s.FileSpec.SetDefaults()
90
91 return s.FileSpec.Validate()
92}
93
94func int64ptr(i int64) *int64 {
95 return &i

Callers 2

NewFunction · 0.45
TestSpec_ValidateFunction · 0.45

Calls 2

UnmarshalSpecMethod · 0.45
SetDefaultsMethod · 0.45

Tested by 1

TestSpec_ValidateFunction · 0.36