MCPcopy Create free account
hub / github.com/entireio/git-sync / Validate

Method Validate

client.go:146–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144}
145
146func (r SyncRequest) Validate() error {
147 if r.Source.URL == "" {
148 return errors.New("source URL is required")
149 }
150 if r.Target.URL == "" {
151 return errors.New("target URL is required")
152 }
153 if err := validateOperationMode(r.Policy.Mode); err != nil {
154 return err
155 }
156 if err := r.Policy.Validate(); err != nil {
157 return err
158 }
159 if _, err := validation.NormalizeProtocolMode(string(r.Policy.Protocol)); err != nil {
160 return fmt.Errorf("normalize protocol: %w", err)
161 }
162 if _, err := validation.ValidateMappings(validationMappings(r.Scope.Mappings), r.Scope.AllRefs); err != nil {
163 return fmt.Errorf("validate mappings: %w", err)
164 }
165 return nil
166}
167
168func (r PlanRequest) Validate() error {
169 if r.Source.URL == "" {

Callers 4

ProbeMethod · 0.45
PlanMethod · 0.45
SyncMethod · 0.45
ValidateMethod · 0.45

Calls 4

NormalizeProtocolModeFunction · 0.92
ValidateMappingsFunction · 0.92
validateOperationModeFunction · 0.85
validationMappingsFunction · 0.70

Tested by

no test coverage detected