docker/libchan

How to migrate code from v.0.1.0 version ?

joao-parana opened this issue · 2 comments

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:

  • undefined: spdy.NewTransportListener
  • undefined: spdy.NoAuthenticator

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.

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.

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()