github.com/skanehira/moby@v17.12.1-ce-rc2+incompatible/volume/validate.go (about)

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