func (b *Bundle) Validate() error {
	if b.ID == "" {
		return errors.New("id required")
	}
	if err := validateDBID(b.ID); err != nil {
		return err
	}
	if !strings.HasPrefix(b.ID, "bundle-") {
		return errors.New("incorrect doc type")
	}
	if b.Created.IsZero() {
		return errors.New("created time required")
	}
	if b.Modified.IsZero() {
		return errors.New("modified time required")
	}
	if b.Owner == "" {
		return errors.New("owner required")
	}
	if _, err := B32dec(b.Owner); err != nil {
		return errors.Wrap(err, "invalid owner name")
	}
	return nil
}
// Validate validates that all of the data in the bundle appears valid and self
// consistent. A nil return value means no errors were detected.
Validate validates that all of the data in the bundle appears valid and self
consistent. A nil return value means no errors were detected.
// Validate validates that all of the data in the bundle appears valid and self // consistent . A nil return value means no errors were detected .
func (b *Bundle) Validate() error {
	if b.ID == "" {
		return errors.New("id required")
	}
	if err := validateDBID(b.ID); err != nil {
		return err
	}
	if !strings.HasPrefix(b.ID, "bundle-") {
		return errors.New("incorrect doc type")
	}
	if b.Created.IsZero() {
		return errors.New("created time required")
	}
	if b.Modified.IsZero() {
		return errors.New("modified time required")
	}
	if b.Owner == "" {
		return errors.New("owner required")
	}
	if _, err := B32dec(b.Owner); err != nil {
		return errors.Wrap(err, "invalid owner name")
	}
	return nil
}
func ( b * Bundle ) Validate ( ) error { if b . ID == " " { return errors . New ( " " ) } if err := validateDBID ( b . ID ) ; err != nil { return err } if ! strings . HasPrefix ( b . ID , " " ) { return errors . New ( " " ) } if b . Created . IsZero ( ) { return errors . New ( " " ) } if b . Modified . IsZero ( ) { return errors . New ( " " ) } if b . Owner == " " { return errors . New ( " " ) } if _ , err := B32dec ( b . Owner ) ; err != nil { return errors . Wrap ( err , " " ) } return nil }
Validate validates that all of the data in the bundle appears valid and self
consistent.
Validate validates that all of the data in the bundle appears valid and self consistent .