You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: transfer.go
    path of file: ./repos/harbor/src/controller/replication/transfer
    
    the code of the file until where you have to start completion: // Copyright Project Harbor Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may 
    
func RegisterFactory(name string, factory Factory) error {
	if len(name) == 0 {
		return errors.New("empty name")
	}
	if factory == nil {
		return errors.New("empty resource transfer factory")
	}
	if _, exist := registry[name]; exist {
		return fmt.Errorf("resource transfer factory for %s already exists", name)
	}

	registry[name] = factory
	return nil
}