packagemultisendimport("fmt""github.com/ethereum/go-ethereum/core/types")// ClientFactory produces load testing clients.typeClientFactoryinterface{// ValidateConfig must check whether the given configuration is valid for// our specific client factory.ValidateConfig(cfgConfig)error// NewClient must instantiate a new load testing client, or produce an error// if that process fails.NewClient(cfgConfig)(Client,error)}// Client generates transactions to be sent to a specific endpoint.typeClientinterface{// GenerateTx must generate a raw transaction to be sent to the relevant// broadcast_tx method for a given endpoint.GenerateTx()(*types.Transaction,error)}// Our global registry of client factoriesvarclientFactories=map[string]ClientFactory{}// RegisterClientFactory allows us to programmatically register different client// factories to easily switch between different ones at runtime.funcRegisterClientFactory(namestring,factoryClientFactory)error{if_,exists:=clientFactories[name];exists{returnfmt.Errorf("client factory with the specified name already exists: %s",name)}clientFactories[name]=factoryreturnnil}