github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/volume/mounts/validate.go (about)

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