validate.go 579 B

1234567891011121314151617181920212223242526
  1. package volume
  2. import (
  3. "fmt"
  4. "github.com/docker/docker/api/types/mount"
  5. "github.com/pkg/errors"
  6. )
  7. var errBindNotExist = errors.New("bind source path does not exist")
  8. type errMountConfig struct {
  9. mount *mount.Mount
  10. err error
  11. }
  12. func (e *errMountConfig) Error() string {
  13. return fmt.Sprintf("invalid mount config for type %q: %v", e.mount.Type, e.err.Error())
  14. }
  15. func errExtraField(name string) error {
  16. return errors.Errorf("field %s must not be specified", name)
  17. }
  18. func errMissingField(name string) error {
  19. return errors.Errorf("field %s must not be empty", name)
  20. }