Skip to content

Commit eac115c

Browse files
committed
README.md update
1 parent b290a9e commit eac115c

File tree

1 file changed

+16
-51
lines changed

1 file changed

+16
-51
lines changed

README.md

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ and killbill command line tool (kbcmd)
44

55
## Versions
66

7-
| KB Version | KBCli Version |
8-
| ----------- | ------------- |
9-
| 0.20.x | 1.x.y |
10-
| 0.22.x | 2.x.y |
7+
| KB Version | KBCli Version |
8+
|------------|---------------|
9+
| 0.20.x | 1.x.y |
10+
| 0.22.x | 2.x.y |
11+
| 0.24.x | 3.x.y |
1112

1213

1314

1415
## Kill bill go client library
15-
Kill bill go client library is a go package that can be used to connect to
16-
kill bill.
16+
Kill bill go client library is a go package that can be used to connect to Kill Bill server.
1717

1818
### Install
1919
```bash
20-
go get -u github.com/killbill/kbcli/v2
20+
go get -u github.com/killbill/kbcli/v3
2121
```
2222

2323
### Creating new client
@@ -47,56 +47,21 @@ go get -u github.com/killbill/kbcli/v2
4747
Look at the [complete example here](examples/listaccounts/main.go).
4848
For more examples, look at [kbcmd tool](kbcmd/README.md).
4949

50-
### Client code generation
51-
52-
This client code was generated by the [go-swagger tool](https://github.com/go-swagger/go-swagger).
53-
54-
We use a modified generator and templates to generate the client, and the [sources are here](https://github.com/killbill/go-swagger).
55-
56-
As explained in the [commit](https://github.com/killbill/go-swagger/commit/4d48bffe307c6043daccf5144b132c55cc783803), we are stuck
57-
on an older version of `go-swagger`, i.e our fork is not up to date with parent. In addition to this, there is an [issue](https://github.com/go-swagger/go-swagger/issues/2215) compiling
58-
the tool with recent version of go, and so we are aldo currently stuck using go <= 1.13 -- for building the tool itself, i.e the swagger generator.
59-
60-
To download/install GO 1.13, follow the steps from [here](https://golang.org/doc/manage-install), or simply:
50+
### Wrapper client
6151

62-
```bash
63-
# This will install the tool under ~/sdk by default
64-
go get golang.org/dl/go1.13
65-
go1.13 download
66-
67-
# You can then set GOROOT=~/sdk/go1.13 in your shell or inside Goland 's preference (for the project)
68-
```
52+
We also provide a client wrapper (a higher level and easier to use api) that is built (not generated) on top of the generated code.
53+
See the package `killbill` package under the `wrapper` directory.
6954

70-
To build the (custom) swagger generator
71-
72-
```bash
55+
There is a suite of test `client_test.go` that shows how to use it.
7356

74-
# Pre-requisite (needed if template changes)
75-
brew install go-bindata
76-
77-
# Install swagger tool
78-
mkdir -p $GOPATH/src/github.com/go-swagger
79-
cd $GOPATH/src/github.com/go-swagger
80-
git clone git@github.com:killbill/go-swagger.git
81-
82-
# Each time the templates change, following 2 steps are needed:
83-
84-
#1. Regenerate the (template) byte code inside the go-swagger code itself -> generator/bindata.go should be modified
85-
go1.13 generate ./generator
86-
87-
#2. build the binary
88-
go1.13 build cmd/swagger/swagger.go && cp swagger cp ./swagger $GOPATH/bin/swagger
89-
```
57+
### Client code generation
9058

91-
Finally, in order to generate the killbill client (using the custom `swagger` generator):
59+
We use a forked version of the `go-swagger` client hosted under https://github.com/killbill/go-swagger.
60+
Every so often we rebase our fork from upstream to keep it up-to-date. Given a version of a `swagger` binary, the
61+
client can be regenarated using:
9262

93-
```bash
94-
# Update swagger.json
95-
curl http://localhost:8080/swagger.json | jq "." >swagger.json
63+
`swagger generate client -f kbswagger.yaml -m kbmodel -c kbclient --default-scheme=http`
9664

97-
# Regenerate the tool
98-
swagger generate client -f swagger.json -m kbmodel -c kbclient --default-scheme=http
99-
```
10065

10166
### Generating dev extensions
10267
We also have dev extension APIs (like clock etc), that are in swagger-dev.json. To generate,

0 commit comments

Comments
 (0)