|
1 | | -# Kill Bill go client library |
| 1 | +# Kill Bill go client library and kill bill command line |
| 2 | +This repository contains killbill go client library (kbclient) |
| 3 | +and killbill command line tool (kbcmd) |
2 | 4 |
|
3 | | -This is a basic implementation of a client library written in go to interract with Kill Bill. |
| 5 | +## Kill bill go client library |
| 6 | +Kill bill go client library is a go package that can be used to connect to |
| 7 | +kill bill. |
4 | 8 |
|
5 | | -The http layer has been adapated from the existing [napping](https://github.com/jmcvetta/napping) go repository (which was itself inspired by Python's excellent [Requests](http://docs.python-requests.org/en/latest/) library. |
| 9 | +### Install |
| 10 | +```bash |
| 11 | +go get -u src/github.com/killbill/kbcli/kbclient |
| 12 | +``` |
6 | 13 |
|
7 | | -# Status |
| 14 | +### Creating new client |
| 15 | +```go |
| 16 | + trp := httptransport.New("127.0.0.1:8080", "", nil) |
| 17 | + // Add text/xml producer which is not handled by openapi runtime. |
| 18 | + trp.Producers["text/xml"] = runtime.TextProducer() |
| 19 | + // Set this to true to dump http messages |
| 20 | + trp.Debug = false |
| 21 | + authWriter := httptransport.BasicAuth("admin"/*username*/, "password" /**password*/) |
| 22 | + client := kbclient.New(trp, strfmt.Default, authWriter, kbclient.KillbillDefaults{}) |
8 | 23 |
|
9 | | -Only a few APIs have been implemented so far, mostly around payments call. There is an [example](https://github.com/sbrossie/kbcli/blob/master/examples/payments.go) which using go concurrency feature to throw some load at an existing running Kill Bill instance. |
| 24 | +``` |
10 | 25 |
|
| 26 | +Look at the [complete example here](examples/listaccounts/main.go). |
| 27 | +For more examples, look at [kbcmd tool](kbcmd/README.md). |
11 | 28 |
|
| 29 | +## Kill bill command line tool (kbcmd) |
| 30 | +kbcmd is a command line tool that uses the go client library. This tool can do many of the |
| 31 | +kill bill operations. More details are [available here in README](kbcmd/README.md). |
0 commit comments