docker / libchan

Like Go channels over the network
Apache License 2.0
2.47k stars 142 forks source link

How to migrate code from v.0.1.0 version ? #104

Open joao-parana opened 8 years ago

joao-parana commented 8 years ago

I'm trying to do the build of https://github.com/bfosberry/banano/blob/master/server/main.go code and I am getting the following errors:

The code is:

listener, err := net.Listen("tcp", fmt.Sprintf(":%s", port))
if err != nil {
    log.Fatal(err)
}

tl, err := spdy.NewTransportListener(listener, spdy.NoAuthenticator)
if err != nil {
    log.Fatal(err)
}

This code run with v.0.1.0 of libchain

I haven't found documentation of changes to be made in code when we want to migrate to the current version of libchain.

dmcgowan commented 8 years ago

0.2.0 will not have a compatible API to 0.1.0. Migration can be summarized as using the provider interface. Once it is complete and I am ready to tag 0.2.0 I will fully document any differences and migration. For now if you are basing off 0.1.0 I would suggest checking out the tag and building from there. Using a vendoring solution would help alleviate any build issues as a result of these changes.

dmcgowan commented 8 years ago

Creating listener now works a bit different. The libchan spdy package is no longer dealing directly with the tcp listener. Just use a connection which was either created on accepted from a net Listener.

provider, err := spdy.NewSpdyStreamProvider(conn, true)
...
tl := provider.Listen()