mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
all: improve the method of import for internal packages
1. Change directory structure and Makefile to let GOPATH=`pwd`, so wherever the project directory is, just use make to build.
This commit is contained in:
parent
f32cc7a840
commit
09127a3b55
9
Makefile
9
Makefile
@ -1,4 +1,5 @@
|
|||||||
export PATH := $(GOPATH)/bin:$(PATH)
|
export PATH := $(GOPATH)/bin:$(PATH)
|
||||||
|
export NEW_GOPATH := $(shell pwd)
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
@ -9,13 +10,13 @@ godep:
|
|||||||
godep restore
|
godep restore
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
@godep go fmt ./...
|
@GOPATH=$(NEW_GOPATH) godep go fmt ./...
|
||||||
|
|
||||||
frps:
|
frps:
|
||||||
godep go build -o bin/frps ./cmd/frps
|
GOPATH=$(NEW_GOPATH) godep go build -o bin/frps ./src/frp/cmd/frps
|
||||||
|
|
||||||
frpc:
|
frpc:
|
||||||
godep go build -o bin/frpc ./cmd/frpc
|
GOPATH=$(NEW_GOPATH) godep go build -o bin/frpc ./src/frp/cmd/frpc
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@godep go test ./...
|
@GOPATH=$(NEW_GOPATH) godep go test ./...
|
||||||
|
@ -7,11 +7,11 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fatedier/frp/models/client"
|
"frp/models/client"
|
||||||
"github.com/fatedier/frp/models/consts"
|
"frp/models/consts"
|
||||||
"github.com/fatedier/frp/models/msg"
|
"frp/models/msg"
|
||||||
"github.com/fatedier/frp/utils/conn"
|
"frp/utils/conn"
|
||||||
"github.com/fatedier/frp/utils/log"
|
"frp/utils/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ControlProcess(cli *client.ProxyClient, wait *sync.WaitGroup) {
|
func ControlProcess(cli *client.ProxyClient, wait *sync.WaitGroup) {
|
@ -4,8 +4,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/fatedier/frp/models/client"
|
"frp/models/client"
|
||||||
"github.com/fatedier/frp/utils/log"
|
"frp/utils/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
@ -6,11 +6,11 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fatedier/frp/models/consts"
|
"frp/models/consts"
|
||||||
"github.com/fatedier/frp/models/msg"
|
"frp/models/msg"
|
||||||
"github.com/fatedier/frp/models/server"
|
"frp/models/server"
|
||||||
"github.com/fatedier/frp/utils/conn"
|
"frp/utils/conn"
|
||||||
"github.com/fatedier/frp/utils/log"
|
"frp/utils/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ProcessControlConn(l *conn.Listener) {
|
func ProcessControlConn(l *conn.Listener) {
|
@ -3,9 +3,9 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/fatedier/frp/models/server"
|
"frp/models/server"
|
||||||
"github.com/fatedier/frp/utils/conn"
|
"frp/utils/conn"
|
||||||
"github.com/fatedier/frp/utils/log"
|
"frp/utils/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
@ -3,10 +3,10 @@ package client
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/fatedier/frp/models/consts"
|
"frp/models/consts"
|
||||||
"github.com/fatedier/frp/models/msg"
|
"frp/models/msg"
|
||||||
"github.com/fatedier/frp/utils/conn"
|
"frp/utils/conn"
|
||||||
"github.com/fatedier/frp/utils/log"
|
"frp/utils/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ProxyClient struct {
|
type ProxyClient struct {
|
@ -5,9 +5,9 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fatedier/frp/models/consts"
|
"frp/models/consts"
|
||||||
"github.com/fatedier/frp/utils/conn"
|
"frp/utils/conn"
|
||||||
"github.com/fatedier/frp/utils/log"
|
"frp/utils/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ProxyServer struct {
|
type ProxyServer struct {
|
@ -7,7 +7,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/fatedier/frp/utils/log"
|
"frp/utils/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Listener struct {
|
type Listener struct {
|
Loading…
Reference in New Issue
Block a user