Skip to content

Commit

Permalink
Create new types
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna committed Jan 17, 2024
1 parent 6cd8770 commit 5d2a70b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
31 changes: 31 additions & 0 deletions transport/transport.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright 2019 Jigsaw Operations LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package transport

// Endpoint is the interface that groups StreamEndpoint and PacketEndpoint.
// It encapsulates the notion that you can establish Stream or Packet connections
// with the same endpoint.
type Endpoint interface {
StreamEndpoint
PacketEndpoint
}

// Dialer is the interface that groups StreamDialer and PacketDialer.
// It encapsulates the ability to dial both stream and packet connections,
// similar to [net.Dialer], but with strict types.
type Dialer interface {
StreamDialer
PacketDialer
}
3 changes: 1 addition & 2 deletions x/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/Jigsaw-Code/outline-sdk/x
go 1.20

require (
github.com/Jigsaw-Code/outline-sdk v0.0.12-0.20240117211645-97b16196294c
github.com/Jigsaw-Code/outline-sdk v0.0.12-0.20240117212550-6cd87709dc1e
github.com/songgao/water v0.0.0-20190725173103-fd331bda3f4b
github.com/stretchr/testify v1.8.2
github.com/vishvananda/netlink v1.1.0
Expand All @@ -15,7 +15,6 @@ require (
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/eycorsican/go-tun2socks v1.16.11 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/shadowsocks/go-shadowsocks2 v0.1.5 // indirect
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
Expand Down
6 changes: 2 additions & 4 deletions x/go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
github.com/Jigsaw-Code/outline-sdk v0.0.12-0.20240117211645-97b16196294c h1:J2tp+6I0R/gL0hdod74tiYWKYrh5323lk18q586YlLA=
github.com/Jigsaw-Code/outline-sdk v0.0.12-0.20240117211645-97b16196294c/go.mod h1:A4mEzzyT2y96KB7VESoStsL7moONembHkR6VT/Ca3eI=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/Jigsaw-Code/outline-sdk v0.0.12-0.20240117212550-6cd87709dc1e h1:56ZI48e68EYYb3m2slu3YJ6C+gWqh8v9bIWk+Bl9dfY=
github.com/Jigsaw-Code/outline-sdk v0.0.12-0.20240117212550-6cd87709dc1e/go.mod h1:9cEaF6sWWMzY8orcUI9pV5D0oFp2FZArTSyJiYtMQQs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -9,7 +8,6 @@ github.com/eycorsican/go-tun2socks v1.16.11/go.mod h1:wgB2BFT8ZaPKyKOQ/5dljMG/YI
github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg=
Expand Down

0 comments on commit 5d2a70b

Please sign in to comment.