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

Method Validate

client.go:168–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166}
167
168func (r PlanRequest) Validate() error {
169 if r.Source.URL == "" {
170 return errors.New("source URL is required")
171 }
172 if r.Target.URL == "" {
173 return errors.New("target URL is required")
174 }
175 if err := validateOperationMode(r.Policy.Mode); err != nil {
176 return err
177 }
178 if err := r.Policy.Validate(); err != nil {
179 return err
180 }
181 if _, err := validation.NormalizeProtocolMode(string(r.Policy.Protocol)); err != nil {
182 return fmt.Errorf("normalize protocol: %w", err)
183 }
184 if _, err := validation.ValidateMappings(validationMappings(r.Scope.Mappings), r.Scope.AllRefs); err != nil {
185 return fmt.Errorf("validate mappings: %w", err)
186 }
187 return nil
188}
189
190func (r ProbeRequest) Validate() error {
191 if r.Source.URL == "" {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected