Skip to content

Commit 448d36e

Browse files
committed
RELEASE: 2.0 release
- update dependencies - upgrade go to 1.14 - upgrade go-swagger to 0.23.0 - add goreleaser for releases - add documentation
1 parent e6538b6 commit 448d36e

File tree

556 files changed

+2856
-3070
lines changed

Some content is hidden

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

556 files changed

+2856
-3070
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99

10-
- name: Set up Go 1.13
10+
- name: Set up Go 1.14
1111
uses: actions/setup-go@v1
1212
with:
13-
go-version: 1.13
13+
go-version: 1.14
1414
id: go
1515

1616
- name: Check out code into the Go module directory

.goreleaser.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
before:
3+
hooks:
4+
- go mod download
5+
- make clean
6+
- mkdir build/
7+
builds:
8+
-
9+
id: my-build
10+
main: ./cmd/dataplaneapi/main.go
11+
binary: ./build/dataplaneapi
12+
gcflags:
13+
- -l
14+
- -N
15+
ldflags:
16+
- -s -w -X main.GitRepo={{.GitURL}} -X main.GitTag={{.Tag}} -X main.GitCommit={{.ShortCommit}} -X main.GitDirty= -X main.BuildTime={{.Date}}
17+
env:
18+
- CGO_ENABLED=0
19+
goos:
20+
- linux
21+
- darwin
22+
- freebsd
23+
goarch:
24+
- 386
25+
- amd64
26+
- arm
27+
- arm64
28+
archives:
29+
-
30+
id: my-archive
31+
builds:
32+
- my-build
33+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
34+
replacements:
35+
linux: Linux
36+
darwin: Darwin
37+
freebsd: FreeBSD
38+
386: i386
39+
amd64: x86_64
40+
checksum:
41+
name_template: 'checksums.txt'
42+
snapshot:
43+
name_template: "{{ .Tag }}-next"
44+
changelog:
45+
sort: asc
46+
release:
47+
draft: true
48+
name_template: "HAProxy {{toupper .ProjectName}} v{{.Version}}"

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Data Plane API is generated using [go-swagger](https://github.com/go-swagger/go-
1212
./swagger generate server -f haproxy_spec.yaml \
1313
-A "Data Plane" \
1414
-t $GOPATH/src/github.com/haproxytech/ \
15-
--existing-models github.com/haproxytech/models \
15+
--existing-models github.com/haproxytech/models/v2 \
1616
--exclude-main \
1717
--skip-models \
1818
-s dataplaneapi \

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Building the Data Plane API
88

9-
In order to build the Data Plane API you need go 1.12 installed on your system with go modules support enabled, and execute the following steps:
9+
In order to build the Data Plane API you need go 1.14 installed on your system with go modules support enabled, and execute the following steps:
1010

1111
1\. Clone dataplaneapi repository
1212

@@ -71,6 +71,10 @@ HAProxy options:
7171
-i, --show-system-info Show system info on info endpoint
7272
-f= Path to the dataplane configuration file
7373
--userlist-file= Path to the dataplaneapi userlist file. By default userlist is read from HAProxy conf. When specified userlist would be read from this file
74+
--fid= Path to file that will dataplaneapi use to write its id (not a pid) that was given to him after joining a cluster
75+
-p, --maps-dir= Path to maps directory (default: /etc/haproxy/maps)
76+
--update-map-files Flag used for syncing map files with runtime maps values
77+
--update-map-files-period= Elapsed time in seconds between two maps syncing operations (default: 10)
7478
7579
Logging options:
7680
--log-to=[stdout|file] Log target, can be stdout or file (default: stdout)
@@ -96,7 +100,7 @@ You can test it by simply running:
96100
Test it out with curl, note that you need user/pass combination setup in HAProxy userlist in haproxy configuration (in above example: /etc/haproxy/haproxy.cfg, userlist controller):
97101

98102
```
99-
curl -u <user>:<pass> -H "Content-Type: application/json" "http://127.0.0.1:5555/v1/"
103+
curl -u <user>:<pass> -H "Content-Type: application/json" "http://127.0.0.1:5555/v2/"
100104
```
101105

102106
If you are using secure passwords, supported algorithms are: md5, sha-256 and sha-512.
@@ -105,7 +109,7 @@ If you are using secure passwords, supported algorithms are: md5, sha-256 and sh
105109

106110
For more docs how to use the Data Plane API check our [documentation](https://www.haproxy.com/documentation/hapee/1-9r1/configuration/dataplaneapi/)
107111

108-
Alternatively, dataplaneapi serves it's own interactive documentation relevant for the current build on the `/v1/docs` uri. Just point your browser to the host/port dataplane was started with (i.e. `http://localhost:5555/v1/docs`)
112+
Alternatively, dataplaneapi serves it's own interactive documentation relevant for the current build on the `/v2/docs` uri. Just point your browser to the host/port dataplane was started with (i.e. `http://localhost:5555/v2/docs`)
109113

110114
## Contributing
111115

adapters/adapters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"github.com/docker/go-units"
2626

27-
"github.com/haproxytech/models"
27+
"github.com/haproxytech/models/v2"
2828

2929
"github.com/sirupsen/logrus"
3030
)

cmd/dataplaneapi/main.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ import (
2929
"github.com/haproxytech/dataplaneapi/operations"
3030
)
3131

32+
//GitRepo ...
33+
var GitRepo = ""
34+
35+
//GitTag ...
36+
var GitTag = ""
37+
38+
//GitCommit ...
39+
var GitCommit = "dev"
40+
41+
//GitDirty ...
42+
var GitDirty = ".dirty"
43+
44+
//BuildTime ...
45+
var BuildTime = ""
46+
3247
func init() {
3348
log.SetFormatter(&log.TextFormatter{
3449
FullTimestamp: true,

cmd/dataplaneapi/version.go

Lines changed: 0 additions & 16 deletions
This file was deleted.

configuration/cluster_sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"net/http"
3131
"time"
3232

33-
client_native "github.com/haproxytech/client-native"
33+
client_native "github.com/haproxytech/client-native/v2"
3434
"github.com/haproxytech/config-parser/v2/types"
3535
"github.com/haproxytech/dataplaneapi/haproxy"
3636
log "github.com/sirupsen/logrus"

configure_data_plane.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636

3737
"github.com/haproxytech/dataplaneapi/adapters"
3838
"github.com/haproxytech/dataplaneapi/operations/specification"
39-
"github.com/haproxytech/models"
39+
"github.com/haproxytech/models/v2"
4040

4141
log "github.com/sirupsen/logrus"
4242

@@ -45,10 +45,10 @@ import (
4545
"github.com/go-openapi/runtime/middleware"
4646
"github.com/haproxytech/dataplaneapi/operations/discovery"
4747

48-
client_native "github.com/haproxytech/client-native"
48+
client_native "github.com/haproxytech/client-native/v2"
4949

50-
"github.com/haproxytech/client-native/configuration"
51-
runtime_api "github.com/haproxytech/client-native/runtime"
50+
"github.com/haproxytech/client-native/v2/configuration"
51+
runtime_api "github.com/haproxytech/client-native/v2/runtime"
5252
dataplaneapi_config "github.com/haproxytech/dataplaneapi/configuration"
5353
"github.com/haproxytech/dataplaneapi/handlers"
5454
"github.com/haproxytech/dataplaneapi/haproxy"
@@ -626,7 +626,7 @@ func configureRuntimeClient(confClient *configuration.Client, haproxyOptions dat
626626
log.Warningf("Error setting up runtime client with master socket: %s : %s", masterSocket, err.Error())
627627
}
628628
}
629-
runtimeAPIs := globalConf.RuntimeApis
629+
runtimeAPIs := globalConf.RuntimeAPIs
630630
// if no master socket set, read from first valid socket if nbproc <= 1
631631
if globalConf.Nbproc <= 1 {
632632
socketList := make(map[int]string)

doc.go

Lines changed: 21 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)