Rename full path in order to favor modules

This commit is contained in:
9seconds
2019-11-11 15:09:29 +03:00
parent b491e03504
commit 273aa18367
53 changed files with 120 additions and 122 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"math"
"sync"
"github.com/9seconds/mtg/config"
"mtg/config"
"github.com/dgraph-io/ristretto"
)
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"crypto/rand"
"encoding/hex"
"github.com/9seconds/mtg/config"
"mtg/config"
)
func Generate(secretType, hostname string) {
+10 -10
View File
@@ -8,16 +8,16 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"github.com/9seconds/mtg/antireplay"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/faketls"
"github.com/9seconds/mtg/hub"
"github.com/9seconds/mtg/ntp"
"github.com/9seconds/mtg/obfuscated2"
"github.com/9seconds/mtg/proxy"
"github.com/9seconds/mtg/stats"
"github.com/9seconds/mtg/telegram"
"github.com/9seconds/mtg/utils"
"mtg/antireplay"
"mtg/config"
"mtg/faketls"
"mtg/hub"
"mtg/ntp"
"mtg/obfuscated2"
"mtg/proxy"
"mtg/stats"
"mtg/telegram"
"mtg/utils"
)
func Proxy() error { // nolint: funlen
+1 -1
View File
@@ -13,7 +13,7 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/config"
"mtg/config"
)
type connectionServer struct {
+8 -8
View File
@@ -11,14 +11,14 @@ import (
"sync"
"time"
"github.com/9seconds/mtg/antireplay"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/obfuscated2"
"github.com/9seconds/mtg/protocol"
"github.com/9seconds/mtg/stats"
"github.com/9seconds/mtg/tlstypes"
"github.com/9seconds/mtg/wrappers/stream"
"mtg/antireplay"
"mtg/config"
"mtg/conntypes"
"mtg/obfuscated2"
"mtg/protocol"
"mtg/stats"
"mtg/tlstypes"
"mtg/wrappers/stream"
)
type ClientProtocol struct {
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"sync"
"time"
"github.com/9seconds/mtg/config"
"mtg/config"
)
var (
+2 -4
View File
@@ -1,6 +1,6 @@
module github.com/9seconds/mtg
module mtg
replace github.com/golang/lint => github.com/golang/lint v0.0.0-20190227174305-8f45f776aaf1
go 1.13
require (
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d
@@ -16,5 +16,3 @@ require (
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/alexcesaro/statsd.v2 v2.0.0
)
go 1.13
+4 -4
View File
@@ -7,10 +7,10 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/mtproto"
"github.com/9seconds/mtg/mtproto/rpc"
"github.com/9seconds/mtg/protocol"
"mtg/conntypes"
"mtg/mtproto"
"mtg/mtproto/rpc"
"mtg/protocol"
)
type connection struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"sort"
"github.com/9seconds/mtg/config"
"mtg/config"
)
type connectionList struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"context"
"sync"
"github.com/9seconds/mtg/protocol"
"mtg/protocol"
)
type hub struct {
+1 -1
View File
@@ -1,6 +1,6 @@
package hub
import "github.com/9seconds/mtg/protocol"
import "mtg/protocol"
type Interface interface {
Register(*protocol.TelegramRequest) (*ProxyConn, error)
+2 -2
View File
@@ -3,8 +3,8 @@ package hub
import (
"context"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/protocol"
"mtg/conntypes"
"mtg/protocol"
)
type muxNewRequest struct {
+3 -3
View File
@@ -4,9 +4,9 @@ import (
"sync"
"time"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/mtproto/rpc"
"github.com/9seconds/mtg/protocol"
"mtg/conntypes"
"mtg/mtproto/rpc"
"mtg/protocol"
)
const (
+3 -3
View File
@@ -7,9 +7,9 @@ import (
kingpin "gopkg.in/alecthomas/kingpin.v2"
"github.com/9seconds/mtg/cli"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/utils"
"mtg/cli"
"mtg/config"
"mtg/utils"
)
var version = "dev" // this has to be set by build ld flags
+6 -6
View File
@@ -3,12 +3,12 @@ package mtproto
import (
"fmt"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/mtproto/rpc"
"github.com/9seconds/mtg/protocol"
"github.com/9seconds/mtg/telegram"
"github.com/9seconds/mtg/wrappers/packet"
"github.com/9seconds/mtg/wrappers/stream"
"mtg/conntypes"
"mtg/mtproto/rpc"
"mtg/protocol"
"mtg/telegram"
"mtg/wrappers/packet"
"mtg/wrappers/stream"
)
func TelegramProtocol(req *protocol.TelegramRequest) (conntypes.PacketReadWriteCloser, error) {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"bytes"
"fmt"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
type ProxyResponseType uint8
+7 -7
View File
@@ -9,13 +9,13 @@ import (
"io"
"time"
"github.com/9seconds/mtg/antireplay"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/protocol"
"github.com/9seconds/mtg/stats"
"github.com/9seconds/mtg/utils"
"github.com/9seconds/mtg/wrappers/stream"
"mtg/antireplay"
"mtg/config"
"mtg/conntypes"
"mtg/protocol"
"mtg/stats"
"mtg/utils"
"mtg/wrappers/stream"
)
const clientProtocolHandshakeTimeout = 10 * time.Second
+5 -5
View File
@@ -4,11 +4,11 @@ import (
"crypto/rand"
"fmt"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/protocol"
"github.com/9seconds/mtg/telegram"
"github.com/9seconds/mtg/utils"
"github.com/9seconds/mtg/wrappers/stream"
"mtg/conntypes"
"mtg/protocol"
"mtg/telegram"
"mtg/utils"
"mtg/wrappers/stream"
)
func TelegramProtocol(req *protocol.TelegramRequest) (conntypes.StreamReadWriteCloser, error) {
+1 -1
View File
@@ -1,6 +1,6 @@
package protocol
import "github.com/9seconds/mtg/conntypes"
import "mtg/conntypes"
type ClientProtocol interface {
Handshake(conntypes.StreamReadWriteCloser) (conntypes.StreamReadWriteCloser, error)
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
type TelegramRequest struct {
+3 -3
View File
@@ -6,9 +6,9 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/obfuscated2"
"github.com/9seconds/mtg/protocol"
"mtg/conntypes"
"mtg/obfuscated2"
"mtg/protocol"
)
const directPipeBufferSize = 1024 * 1024
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/protocol"
"github.com/9seconds/mtg/wrappers/packetack"
"mtg/conntypes"
"mtg/protocol"
"mtg/wrappers/packetack"
)
func middleConnection(request *protocol.TelegramRequest) {
+6 -6
View File
@@ -6,12 +6,12 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/protocol"
"github.com/9seconds/mtg/stats"
"github.com/9seconds/mtg/utils"
"github.com/9seconds/mtg/wrappers/stream"
"mtg/config"
"mtg/conntypes"
"mtg/protocol"
"mtg/stats"
"mtg/utils"
"mtg/wrappers/stream"
)
type Proxy struct {
+1 -1
View File
@@ -3,7 +3,7 @@ package stats
import (
"net"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
type IngressTrafficInterface interface {
+1 -1
View File
@@ -3,7 +3,7 @@ package stats
import (
"net"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
type multiStats []Interface
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"net"
"net/http"
"github.com/9seconds/mtg/config"
"mtg/config"
)
var Stats Interface
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/conntypes"
"mtg/config"
"mtg/conntypes"
)
type statsPrometheus struct {
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"gopkg.in/alexcesaro/statsd.v2"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/conntypes"
"mtg/config"
"mtg/conntypes"
)
type statsStatsd struct {
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"strconv"
"strings"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
const (
+3 -3
View File
@@ -5,9 +5,9 @@ import (
"math/rand"
"net"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/utils"
"github.com/9seconds/mtg/wrappers/stream"
"mtg/conntypes"
"mtg/utils"
"mtg/wrappers/stream"
)
type baseTelegram struct {
+1 -1
View File
@@ -1,6 +1,6 @@
package telegram
import "github.com/9seconds/mtg/conntypes"
import "mtg/conntypes"
const (
directV4DefaultIdx conntypes.DC = 1
+1 -1
View File
@@ -1,6 +1,6 @@
package telegram
import "github.com/9seconds/mtg/conntypes"
import "mtg/conntypes"
type Telegram interface {
Dial(conntypes.DC, conntypes.ConnectionProtocol) (conntypes.StreamReadWriteCloser, error)
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/telegram/api"
"mtg/conntypes"
"mtg/telegram/api"
)
const middleTelegramBackgroundUpdateEvery = time.Hour
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"crypto/sha256"
"fmt"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/utils"
"mtg/config"
"mtg/utils"
)
type ClientHello struct {
+1 -1
View File
@@ -3,7 +3,7 @@ package tlstypes
import (
"bytes"
"github.com/9seconds/mtg/utils"
"mtg/utils"
)
type Handshake struct {
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"golang.org/x/crypto/curve25519"
"github.com/9seconds/mtg/config"
"mtg/config"
)
type ServerHello struct {
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"net"
"github.com/9seconds/mtg/config"
"mtg/config"
)
func InitTCP(conn net.Conn) error {
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
const (
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/utils"
"mtg/conntypes"
"mtg/utils"
)
const (
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
const clientIntermediateQuickAckLength = 0x80000000
@@ -8,7 +8,7 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
type wrapperClientIntermediateSecure struct {
+5 -5
View File
@@ -6,11 +6,11 @@ import (
"fmt"
"net"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/hub"
"github.com/9seconds/mtg/mtproto/rpc"
"github.com/9seconds/mtg/protocol"
"mtg/config"
"mtg/conntypes"
"mtg/hub"
"mtg/mtproto/rpc"
"mtg/protocol"
)
type wrapperProxy struct {
+1 -1
View File
@@ -3,7 +3,7 @@ package stream
import (
"net"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
func NewClientConn(parent net.Conn, connID conntypes.ConnID) conntypes.StreamReadWriteCloser {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/utils"
"mtg/conntypes"
"mtg/utils"
)
type wrapperBlockCipher struct {
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/conntypes"
"mtg/config"
"mtg/conntypes"
)
type connPurpose uint8
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
type wrapperCtx struct {
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/tlstypes"
"mtg/conntypes"
"mtg/tlstypes"
)
type wrapperFakeTLS struct {
+3 -3
View File
@@ -9,9 +9,9 @@ import (
"encoding/binary"
"net"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/mtproto/rpc"
"github.com/9seconds/mtg/utils"
"mtg/conntypes"
"mtg/mtproto/rpc"
"mtg/utils"
)
type mtprotoCipherPurpose uint8
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
type wrapperObfuscated2 struct {
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
type ReadWriteCloseRewinder interface {
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/stats"
"mtg/conntypes"
"mtg/stats"
)
type wrapperTelegramStats struct {
+2 -2
View File
@@ -6,8 +6,8 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"github.com/9seconds/mtg/stats"
"mtg/conntypes"
"mtg/stats"
)
type wrapperTrafficStats struct {
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"go.uber.org/zap"
"github.com/9seconds/mtg/conntypes"
"mtg/conntypes"
)
const (