func (b boltRepo) Fetch(ID string) (*Type, error) {
	w := &Type{}

	err := b.client.View(func(tx *bolt.Tx) error {
		bucket := tx.Bucket([]byte(b.BucketName))
		if bucket == nil {
			logrus.Trace("webhook not found in storage")
			return errWebhookNotFound
		}

		data := bucket.Get([]byte(ID))
		if data == nil {
			logrus.Trace("webhook not found in storage")
			return errWebhookNotFound
		}

		err := json.Unmarshal([]byte(data), w)
		if err != nil {
			return err
		}

		return nil
	})

	if err != nil {
		return nil, err
	}

	return w, nil
}
// Fetch a key from the repository, or err
Fetch a key from the repository, or err
// Fetch a key from the repository or err
func (b boltRepo) Fetch(ID string) (*Type, error) {
	w := &Type{}
	err := b.client.View(func(tx *bolt.Tx) error {
		bucket := tx.Bucket([]byte(b.BucketName))
		if bucket == nil {
			logrus.Trace("webhook not found in storage")
			return errWebhookNotFound
		}
		data := bucket.Get([]byte(ID))
		if data == nil {
			logrus.Trace("webhook not found in storage")
			return errWebhookNotFound
		}
		err := json.Unmarshal([]byte(data), w)
		if err != nil {
			return err
		}
		return nil
	})
	if err != nil {
		return nil, err
	}
	return w, nil
}
func ( b boltRepo ) Fetch ( ID string ) ( * Type , error ) { w := & Type { } err := b . client . View ( func ( tx * bolt . Tx ) error { bucket := tx . Bucket ( [ ] byte ( b . BucketName ) ) if bucket == nil { logrus . Trace ( " " ) return errWebhookNotFound } data := bucket . Get ( [ ] byte ( ID ) ) if data == nil { logrus . Trace ( " " ) return errWebhookNotFound } err := json . Unmarshal ( [ ] byte ( data ) , w ) if err != nil { return err } return nil } ) if err != nil { return nil , err } return w , nil }
Fetch a key from the repository, or err
Fetch a key from the repository or err