// Validate validates if BoltConfig is valid
9362
func (bc *BoltConfig) Validate() error {
	switch bc.ContentSharingPolicy {
	case SharingPolicyShared, SharingPolicyIsolated:
		return nil
	default:
		return errors.Wrapf(errdefs.ErrInvalidArgument, "unknown policy: %s", bc.ContentSharingPolicy)
	}
}
82615
func (config ManifoldConfig) Validate() error {
	if config.ClockName == "" {
		return errors.NotValidf("empty ClockName")
	}
	if config.AgentName == "" {
		return errors.NotValidf("empty AgentName")
	}
	if config.TransportName == "" {
		return errors.NotValidf("empty TransportName")
	}
	if config.FSM == nil {
		return errors.NotValidf("nil FSM")
	}
	if config.Logger == nil {
		return errors.NotValidf("nil Logger")
	}
	if config.NewWorker == nil {
		return errors.NotValidf("nil NewWorker")
	}
	return nil
}
1306571
func (c *NetworkConfig) Validate(onExecution bool) error {
	if onExecution {
		if _, err := os.Stat(c.NetworkDir); err != nil {
			return errors.Wrapf(err, "invalid network_dir")
		}

		for _, pluginDir := range c.PluginDir {
			if err := os.MkdirAll(pluginDir, 0755); err != nil {
				return errors.Wrapf(err, "invalid plugin_dir entry")
			}
		}
	}

	return nil
}
818998
func (m *TapConfig) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetMatchConfig() == nil {
		return TapConfigValidationError{
			field:  "MatchConfig",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetMatchConfig()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return TapConfigValidationError{
					field:  "MatchConfig",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	if m.GetOutputConfig() == nil {
		return TapConfigValidationError{
			field:  "OutputConfig",
			reason: "value is required",
		}
	}

	{
		tmp := m.GetOutputConfig()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return TapConfigValidationError{
					field:  "OutputConfig",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	return nil
}
1199112
func (c *ControllerConfig) Validate() error {
	if c.Changes == nil {
		return errors.NotValidf("nil Changes")
	}
	return nil
}
312190
func (c *Config) Validate() error {
	if err := c.validateTemplates(); err != nil {
		return err
	}

	return nil
}
489133
func (cfg Config) Validate() error {
	if cfg.Clock == nil {
		return errors.NotValidf("nil Clock")
	}
	if cfg.MetricsCollector == nil {
		return errors.NotValidf("nil MetricsCollector")
	}
	return nil
}
577484
func (m *ConfigDump) Validate() error {
	if m == nil {
		return nil
	}

	for idx, item := range m.GetConfigs() {
		_, _ = idx, item

		{
			tmp := item

			if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok {

				if err := v.Validate(); err != nil {
					return ConfigDumpValidationError{
						field:  fmt.Sprintf("Configs[%v]", idx),
						reason: "embedded message failed validation",
						cause:  err,
					}
				}
			}
		}

	}

	return nil
}
1054540
func (config Config) Validate() error {
	if config.Facade == nil {
		return errors.NotValidf("nil Facade")
	}
	if config.GateUnlocker == nil {
		return errors.NotValidf("nil GateUnlocker")
	}
	if config.ControllerTag == (names.ControllerTag{}) {
		return errors.NotValidf("empty ControllerTag")
	}
	if config.ModelTag == (names.ModelTag{}) {
		return errors.NotValidf("empty ModelTag")
	}
	if config.CredentialAPI == nil {
		return errors.NotValidf("nil CredentialAPI")
	}
	return nil
}
164612
func (config Config) Validate() error {
	if config.RestoreInfoWatcher == nil {
		return errors.NotValidf("nil RestoreInfoWatcher")
	}
	return nil
}
1011731
func (config Config) Validate() error {
	if config.RevisionUpdater == nil {
		return errors.NotValidf("nil RevisionUpdater")
	}
	if config.Clock == nil {
		return errors.NotValidf("nil Clock")
	}
	if config.Period <= 0 {
		return errors.NotValidf("non-positive Period")
	}
	return nil
}
507454
func (config ManifoldConfig) Validate() error {
	if config.APICallerName == "" {
		return errors.NotValidf("empty APICallerName")
	}
	if config.BrokerName == "" {
		return errors.NotValidf("empty BrokerName")
	}
	if config.NewClient == nil {
		return errors.NotValidf("nil NewClient")
	}
	if config.NewWorker == nil {
		return errors.NotValidf("nil NewWorker")
	}
	return nil
}
334850
func (c *Config) Validate() bool {
	if c.DBType == "sqlite3" {
		if ok, _ := valid.IsFilePath(c.DBPath); !ok {
			log.Errorf("SQLite3 DB path must be a *Absolute* file path. dbpath: %s", c.DBPath)
			return false
		}
	}

	if len(c.DumpPath) != 0 {
		if ok, _ := valid.IsFilePath(c.DumpPath); !ok {
			log.Errorf("JSON path must be a *Absolute* file path. dumppath: %s", c.DumpPath)
			return false
		}
	}

	_, err := valid.ValidateStruct(c)
	if err != nil {
		log.Errorf("error: " + err.Error())
		return false
	}
	return true
}
878359
func (config Config) Validate() error {
	if config.FSM == nil {
		return errors.NotValidf("nil FSM")
	}
	if config.Logger == nil {
		return errors.NotValidf("nil Logger")
	}
	if config.StorageDir == "" {
		return errors.NotValidf("empty StorageDir")
	}
	if config.LocalID == "" {
		return errors.NotValidf("empty LocalID")
	}
	if config.SnapshotRetention < 0 {
		return errors.NotValidf("negative SnapshotRetention")
	}
	if config.Transport == nil {
		return errors.NotValidf("nil Transport")
	}
	if config.Clock == nil {
		return errors.NotValidf("nil Clock")
	}
	return nil
}
727169
func (c *Config) Validate() error {
	var result *multierror.Error

	if c.PoolName == "" {
		result = multierror.Append(result, fmt.Errorf("pool_name is required"))
	}

	if c.RootPath == "" {
		result = multierror.Append(result, fmt.Errorf("root_path is required"))
	}

	if c.BaseImageSize == "" {
		result = multierror.Append(result, fmt.Errorf("base_image_size is required"))
	}

	return result.ErrorOrNil()
}
983315
func (config Config) validate() error {
	if config.Collection == "" {
		return errors.New("missing collection")
	}
	if config.Mongo == nil {
		return errors.New("missing mongo client")
	}
	return nil
}
616458
func (config ManifoldConfig) Validate() error {
	if config.APICallerName == "" {
		return errors.NotValidf("empty APICallerName")
	}
	if config.ClockName == "" {
		return errors.NotValidf("empty ClockName")
	}
	return nil
}