コード例 #1
0
func NewBundleKey(definition bc.BundleDefinition) (key BundleKey) {
	key = BundleKey{
		Name:    definition.BundleName(),
		Version: definition.BundleVersion(),
	}
	return
}
コード例 #2
0
func (s *FakeBundleCollection) Get(definition bc.BundleDefinition) (bc.Bundle, error) {
	if len(definition.BundleName()) == 0 {
		return nil, errors.New("missing bundle name")
	}

	if len(definition.BundleVersion()) == 0 {
		return nil, errors.New("missing bundle version")
	}

	return s.FakeGet(definition), s.GetErr
}
コード例 #3
0
func (s *FakeBundleCollection) Get(definition bc.BundleDefinition) (bundle bc.Bundle, err error) {
	if len(definition.BundleName()) == 0 {
		err = errors.New("missing bundle name")
		return
	}
	if len(definition.BundleVersion()) == 0 {
		err = errors.New("missing bundle version")
		return
	}

	bundle = s.FakeGet(definition)

	return
}
コード例 #4
0
func NewBundleKey(definition bc.BundleDefinition) BundleKey {
	return BundleKey{
		Name:    definition.BundleName(),
		Version: definition.BundleVersion(),
	}
}