func (gar APIGroupFactoryRegistry) AnnouncePreconstructedFactory(gmf *GroupMetaFactory) error {
	name := gmf.GroupArgs.GroupName
	if _, exists := gar[name]; exists {
		return fmt.Errorf("the group %q has already been announced.", name)
	}
	gar[name] = gmf
	return nil
}
AnnouncePreconstructedFactory announces a factory which you've manually assembled.
You may call this instead of calling AnnounceGroup and AnnounceGroupVersion.
package announced
import (
	"fmt"
	"k8s.io/client-go/pkg/apimachinery/registered"
	"k8s.io/client-go/pkg/runtime"
)
var (
	DefaultGroupFactoryRegistry = make(APIGroupFactoryRegistry)
	AnnounceGroupVersion = DefaultGroupFactoryRegistry.AnnounceGroupVersion
	AnnounceGroup        = DefaultGroupFactoryRegistry.AnnounceGroup
)
type APIGroupFactoryRegistry map[string]*GroupMetaFactory
func (gar APIGroupFactoryRegistry) group(groupName string) *GroupMetaFactory {
	gmf, ok := gar[groupName]
	if !ok {
		gmf = &GroupMetaFactory{VersionArgs: map[string]*GroupVersionFactoryArgs{}}
		gar[groupName] = gmf
	}
	return gmf
}
func (gar APIGroupFactoryRegistry) AnnounceGroupVersion(gvf *GroupVersionFactoryArgs) error {
	gmf := gar.group(gvf.GroupName)
	if _, ok := gmf.VersionArgs[gvf.VersionName]; ok {
		return fmt.Errorf("version %q in group %q has already been announced", gvf.VersionName, gvf.GroupName)
	}
	gmf.VersionArgs[gvf.VersionName] = gvf
	return nil
}
func (gar APIGroupFactoryRegistry) AnnounceGroup(args *GroupMetaFactoryArgs) error {
	gmf := gar.group(args.GroupName)
	if gmf.GroupArgs != nil {
		return fmt.Errorf("group %q has already been announced", args.GroupName)
	}
	gmf.GroupArgs = args
	return nil
}
func (gar APIGroupFactoryRegistry) RegisterAndEnableAll(m *registered.APIRegistrationManager, scheme *runtime.Scheme) error {
	for groupName, gmf := range gar {
		if err := gmf.Register(m); err != nil {
			return fmt.Errorf("error registering %v: %v", groupName, err)
		}
		if err := gmf.Enable(m, scheme); err != nil {
			return fmt.Errorf("error enabling %v: %v", groupName, err)
		}
	}
	return nil
}