Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jul 6, 2024
1 parent 0cb32a9 commit 2c550d4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion config/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ import (
"github.com/artie-labs/transfer/lib/stringutil"
)

func (s StreamingSettings) Validate() error {
if !s.Enabled {
return nil
}

if s.OffsetFile == "" {
return fmt.Errorf("offset file must be passed in when streaming is enabled")
}

return nil
}

type StreamingSettings struct {
Enabled bool `yaml:"enabled,omitempty"`
OffsetFile string `yaml:"offsetFile,omitempty"`
Expand Down Expand Up @@ -56,5 +68,5 @@ func (m MongoDB) Validate() error {
}
}

return nil
return m.StreamingSettings.Validate()
}

0 comments on commit 2c550d4

Please sign in to comment.