1
- Information for confluent-kafka-go developers
2
- =============================================
3
-
1
+ # Information for confluent-kafka-go developers
4
2
5
3
Whenever librdkafka error codes are updated make sure to run generate before building:
6
4
7
- $ (cd go_rdkafka_generr && go install) && go generate
8
- $ go build
9
-
10
-
5
+ ```
6
+ $ (cd go_rdkafka_generr && go install) && go generate
7
+ $ go build
8
+ ```
11
9
12
10
13
11
14
- Testing
15
- =======
16
12
13
+ ## Testing
17
14
18
15
Some of the tests included in this directory, the benchmark and integration tests in particular,
19
16
require an existing Kafka cluster and a testconf.json configuration file to
20
17
provide tests with bootstrap brokers, topic name, etc.
21
18
22
19
The format of testconf.json is a JSON object:
23
20
```
24
- {
25
- "Brokers": "<bootstrap-brokers>",
26
- "Topic": "<test-topic-name>"
27
- }
21
+ {
22
+ "Brokers": "<bootstrap-brokers>",
23
+ "Topic": "<test-topic-name>"
24
+ }
28
25
```
29
26
30
27
See testconf-example.json for an example and full set of available options.
31
28
32
29
33
30
To run unit-tests:
34
-
35
- $ go test
36
-
31
+ ```
32
+ $ go test
33
+ ```
37
34
38
35
To run benchmark tests:
39
-
40
- $ go test -bench .
36
+ ```
37
+ $ go test -bench .
38
+ ```
41
39
42
40
For the code coverage:
41
+ ```
42
+ $ go test -coverprofile=coverage.out -bench=.
43
+ $ go tool cover -func=coverage.out
44
+ ```
43
45
44
- $ go test -coverprofile=coverage.out -bench=.
45
- $ go tool cover -func=coverage.out
46
-
46
+ ## Build tags (static linking)
47
47
48
- Build tags (static linking)
49
- ===========================
50
48
51
49
Different build types are supported through Go build tags (` -tags .. ` ),
52
50
these tags should be specified on the ** application** build command.
@@ -58,14 +56,14 @@ these tags should be specified on the **application** build command.
58
56
59
57
60
58
61
- Generate HTML documentation
62
- ===========================
59
+ ## Generating HTML documentation
63
60
64
61
To generate one-page HTML documentation run the mk/doc-gen.py script from the
65
62
top-level directory. This script requires the beautifulsoup4 Python package.
66
63
67
- $ source .../your/virtualenv/bin/activate
68
- $ pip install beautifulsoup4
69
- ..
70
- $ mk/doc-gen.py > kafka.html
71
-
64
+ ```
65
+ $ source .../your/virtualenv/bin/activate
66
+ $ pip install beautifulsoup4
67
+ ...
68
+ $ mk/doc-gen.py > kafka.html
69
+ ```
0 commit comments