rename the constructor from NewUpgrader to New
This commit is contained in:
parent
a3f424bc1d
commit
5a79888154
|
@ -70,7 +70,7 @@ type upgrader struct {
|
||||||
|
|
||||||
var _ transport.Upgrader = &upgrader{}
|
var _ transport.Upgrader = &upgrader{}
|
||||||
|
|
||||||
func NewUpgrader(secureMuxer sec.SecureMuxer, muxer mux.Multiplexer, opts ...Option) (transport.Upgrader, error) {
|
func New(secureMuxer sec.SecureMuxer, muxer mux.Multiplexer, opts ...Option) (transport.Upgrader, error) {
|
||||||
u := &upgrader{
|
u := &upgrader{
|
||||||
secure: secureMuxer,
|
secure: secureMuxer,
|
||||||
muxer: muxer,
|
muxer: muxer,
|
||||||
|
|
|
@ -32,7 +32,7 @@ func createUpgraderWithMuxer(t *testing.T, muxer mux.Multiplexer, opts ...st.Opt
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
id, err := peer.IDFromPrivateKey(priv)
|
id, err := peer.IDFromPrivateKey(priv)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
u, err := st.NewUpgrader(&MuxAdapter{tpt: insecure.NewWithIdentity(id, priv)}, muxer, opts...)
|
u, err := st.New(&MuxAdapter{tpt: insecure.NewWithIdentity(id, priv)}, muxer, opts...)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
return id, u
|
return id, u
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue