mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
client: ClientConfig -> Config
This commit is contained in:
parent
2aecbaf165
commit
3b41b77cd7
@ -46,12 +46,12 @@ func defaultHTTPClientFactory(tr CancelableTransport, ep url.URL) HTTPClient {
|
||||
}
|
||||
}
|
||||
|
||||
type ClientConfig struct {
|
||||
type Config struct {
|
||||
Endpoints []string
|
||||
Transport CancelableTransport
|
||||
}
|
||||
|
||||
func New(cfg ClientConfig) (SyncableHTTPClient, error) {
|
||||
func New(cfg Config) (SyncableHTTPClient, error) {
|
||||
c := &httpClusterClient{clientFactory: defaultHTTPClientFactory}
|
||||
if err := c.reset(cfg.Transport, cfg.Endpoints); err != nil {
|
||||
return nil, err
|
||||
|
@ -117,7 +117,7 @@ func newDiscovery(durl, dproxyurl string, id types.ID) (*discovery, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cfg := client.ClientConfig{
|
||||
cfg := client.Config{
|
||||
Transport: &http.Transport{Proxy: pf},
|
||||
Endpoints: []string{u.String()},
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ func mustNewMembersAPI(c *cli.Context) client.MembersAPI {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
cfg := client.ClientConfig{
|
||||
cfg := client.Config{
|
||||
Transport: tr,
|
||||
Endpoints: eps,
|
||||
}
|
||||
|
@ -615,8 +615,8 @@ func (m *member) Terminate(t *testing.T) {
|
||||
}
|
||||
|
||||
func mustNewHTTPClient(t *testing.T, eps []string) client.SyncableHTTPClient {
|
||||
cc := client.ClientConfig{Transport: mustNewTransport(t), Endpoints: eps}
|
||||
c, err := client.New(cc)
|
||||
cfg := client.Config{Transport: mustNewTransport(t), Endpoints: eps}
|
||||
c, err := client.New(cfg)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user