use type aliases to export types declared in the protocols package

Type aliases were introduced with Go 1.9, so we must drop support for
older Go versions now.
This commit is contained in:
Marten Seemann
2017-08-30 00:30:02 +07:00
parent 95a971f322
commit 3c4a10a5e4
4 changed files with 15 additions and 7 deletions

View File

@@ -7,7 +7,6 @@ addons:
language: go
go:
- 1.8.x
- 1.9
# first part of the GOARCH workaround

View File

@@ -15,5 +15,5 @@
- Changed the log level environment variable to only accept strings ("DEBUG", "INFO", "ERROR"), see [the wiki](https://github.com/lucas-clemente/quic-go/wiki/Logging) for more details.
- Rename the `h2quic.QuicRoundTripper` to `h2quic.RoundTripper`
- Changed `h2quic.Server.Serve()` to accept a `net.PacketConn`
- Drop support for Go 1.7.
- Drop support for Go 1.7 and 1.8.
- Various bugfixes

View File

@@ -16,7 +16,7 @@ As Google's QUIC versions are expected to converge towards the [IETF QUIC draft]
## Guides
We currently support Go 1.8+.
We currently support Go 1.9+.
Installing and updating dependencies:

View File

@@ -9,6 +9,15 @@ import (
"github.com/lucas-clemente/quic-go/internal/protocol"
)
// The StreamID is the ID of a QUIC stream.
type StreamID = protocol.StreamID
// A ByteCount is a number of bytes.
type ByteCount = protocol.ByteCount
// A VersionNumber is a QUIC version number.
type VersionNumber = protocol.VersionNumber
// Stream is the interface implemented by QUIC streams
type Stream interface {
// Read reads data from the stream.
@@ -20,7 +29,7 @@ type Stream interface {
// after a fixed time limit; see SetDeadline and SetWriteDeadline.
io.Writer
io.Closer
StreamID() protocol.StreamID
StreamID() StreamID
// Reset closes the stream with an error.
Reset(error)
// The context is canceled as soon as the write-side of the stream is closed.
@@ -91,7 +100,7 @@ type Config struct {
// The QUIC versions that can be negotiated.
// If not set, it uses all versions available.
// Warning: This API should not be considered stable and will change soon.
Versions []protocol.VersionNumber
Versions []VersionNumber
// Ask the server to truncate the connection ID sent in the Public Header.
// This saves 8 bytes in the Public Header in every packet. However, if the IP address of the server changes, the connection cannot be migrated.
// Currently only valid for the client.
@@ -112,10 +121,10 @@ type Config struct {
AcceptSTK func(clientAddr net.Addr, stk *STK) bool
// MaxReceiveStreamFlowControlWindow is the maximum stream-level flow control window for receiving data.
// If this value is zero, it will default to 1 MB for the server and 6 MB for the client.
MaxReceiveStreamFlowControlWindow protocol.ByteCount
MaxReceiveStreamFlowControlWindow ByteCount
// MaxReceiveConnectionFlowControlWindow is the connection-level flow control window for receiving data.
// If this value is zero, it will default to 1.5 MB for the server and 15 MB for the client.
MaxReceiveConnectionFlowControlWindow protocol.ByteCount
MaxReceiveConnectionFlowControlWindow ByteCount
// KeepAlive defines whether this peer will periodically send PING frames to keep the connection alive.
KeepAlive bool
}