Skip to content

Commit 6c5c13f

Browse files
author
liuminjian
committed
1.add http deployment method
Signed-off-by: liuminjian <[email protected]>
1 parent 580b26d commit 6c5c13f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+935
-187
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ GO := go
2121

2222
# output
2323
OUTPUT := bin/curveadm
24+
SERVER_OUTPUT := bin/pigeon
2425

2526
# build flags
2627
LDFLAGS := -s -w
@@ -52,12 +53,14 @@ TEST_FLAGS += -run $(CASE)
5253

5354
# packages
5455
PACKAGES := $(PWD)/cmd/curveadm/main.go
56+
SERVER_PACKAGES := $(PWD)/cmd/service/main.go
5557

5658
# tar
5759
VERSION := "unknown"
5860

5961
build:
6062
$(GOENV) $(GO) build -o $(OUTPUT) $(BUILD_FLAGS) $(PACKAGES)
63+
$(GO) build -o $(SERVER_OUTPUT) $(SERVER_PACKAGES)
6164

6265
debug:
6366
$(GOENV) $(GO) build -o $(OUTPUT) $(DEBUG_FLAGS) $(PACKAGES)

cmd/service/main.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2023 NetEase Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package main
18+
19+
import (
20+
"github.com/opencurve/curveadm/http"
21+
"github.com/opencurve/pigeon"
22+
)
23+
24+
func main() {
25+
admServer := http.NewServer()
26+
pigeon.Serve(admServer)
27+
}

go.mod

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ require (
1212
github.com/jpillora/longestcommon v0.0.0-20161227235612-adb9d91ee629
1313
github.com/kpango/glg v1.6.14
1414
github.com/mattn/go-sqlite3 v1.14.16
15+
github.com/mcuadros/go-defaults v1.2.0
1516
github.com/melbahja/goph v1.3.0
1617
github.com/mitchellh/hashstructure/v2 v2.0.2
1718
github.com/moby/term v0.0.0-20221205130635-1aeaba878587
19+
github.com/opencurve/pigeon v0.0.0-20230512031044-d5a430bb02a4
1820
github.com/pingcap/log v1.1.0
1921
github.com/sergi/go-diff v1.2.0
2022
github.com/spf13/cobra v1.7.0
@@ -25,10 +27,46 @@ require (
2527
golang.org/x/crypto v0.8.0
2628
)
2729

30+
require (
31+
github.com/Wine93/grace v0.0.0-20221021033009-7d0348013a3c // indirect
32+
github.com/bytedance/sonic v1.8.7 // indirect
33+
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
34+
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
35+
github.com/facebookgo/grace v0.0.0-20180706040059-75cf19382434 // indirect
36+
github.com/facebookgo/httpdown v0.0.0-20180706035922-5979d39b15c2 // indirect
37+
github.com/facebookgo/stats v0.0.0-20151006221625-1b76add642e4 // indirect
38+
github.com/gin-contrib/sse v0.1.0 // indirect
39+
github.com/gin-gonic/gin v1.9.0 // indirect
40+
github.com/go-playground/locales v0.14.1 // indirect
41+
github.com/go-playground/universal-translator v0.18.1 // indirect
42+
github.com/go-playground/validator/v10 v10.12.0 // indirect
43+
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
44+
github.com/golang/mock v1.6.0 // indirect
45+
github.com/google/pprof v0.0.0-20230406165453-00490a63f317 // indirect
46+
github.com/hashicorp/errwrap v1.1.0 // indirect
47+
github.com/hashicorp/go-multierror v1.1.1 // indirect
48+
github.com/imroc/req/v3 v3.33.2 // indirect
49+
github.com/json-iterator/go v1.1.12 // indirect
50+
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect
51+
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
52+
github.com/leodido/go-urn v1.2.3 // indirect
53+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
54+
github.com/modern-go/reflect2 v1.0.2 // indirect
55+
github.com/onsi/ginkgo/v2 v2.9.2 // indirect
56+
github.com/quic-go/qpack v0.4.0 // indirect
57+
github.com/quic-go/qtls-go1-19 v0.3.2 // indirect
58+
github.com/quic-go/qtls-go1-20 v0.2.2 // indirect
59+
github.com/quic-go/quic-go v0.33.0 // indirect
60+
github.com/sevlyar/go-daemon v0.1.6 // indirect
61+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
62+
github.com/ugorji/go/codec v1.2.11 // indirect
63+
golang.org/x/arch v0.3.0 // indirect
64+
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
65+
)
66+
2867
require (
2968
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
3069
github.com/Microsoft/go-winio v0.6.1 // indirect
31-
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d // indirect
3270
github.com/VividCortex/ewma v1.2.0 // indirect
3371
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
3472
github.com/benbjohnson/clock v1.3.0 // indirect
@@ -81,18 +119,17 @@ require (
81119
github.com/subosito/gotenv v1.4.2 // indirect
82120
github.com/theupdateframework/notary v0.7.0 // indirect
83121
go.uber.org/atomic v1.10.0 // indirect
84-
go.uber.org/multierr v1.8.0 // indirect
85-
golang.org/x/mod v0.9.0 // indirect
122+
go.uber.org/multierr v1.11.0 // indirect
123+
golang.org/x/mod v0.10.0 // indirect
86124
golang.org/x/net v0.9.0 // indirect
87125
golang.org/x/sys v0.7.0 // indirect
88126
golang.org/x/term v0.7.0 // indirect
89127
golang.org/x/text v0.9.0 // indirect
90-
golang.org/x/tools v0.7.0 // indirect
91-
google.golang.org/protobuf v1.29.1 // indirect
128+
golang.org/x/tools v0.8.0 // indirect
129+
google.golang.org/protobuf v1.30.0 // indirect
92130
gopkg.in/ini.v1 v1.67.0 // indirect
93131
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
94132
gopkg.in/yaml.v3 v3.0.1 // indirect
95-
gotest.tools/v3 v3.0.3 // indirect
96133
)
97134

98135
replace github.com/melbahja/goph v1.3.0 => github.com/Wine93/goph v0.0.0-20220907033045-3b286d827fb3

0 commit comments

Comments
 (0)