-
Notifications
You must be signed in to change notification settings - Fork 10
/
docs.zig
88 lines (72 loc) · 2.81 KB
/
docs.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const std = @import("std");
const Docs = @import("../docs_types.zig").Docs;
pub const GoDocs = Docs{
.directory = "go",
.markdown_name = "go",
.extension = "go",
.proper_name = "Go",
.test_source_path = "",
.name = "tigerbeetle-go",
.description =
\\The TigerBeetle client for Go.
\\
\\[![Go Reference](https://pkg.go.dev/badge/github.com/tigerbeetle/tigerbeetle-go.svg)](https://pkg.go.dev/github.com/tigerbeetle/tigerbeetle-go)
\\
\\Make sure to import `github.com/tigerbeetle/tigerbeetle-go`, not
\\this repo and subdirectory.
,
.prerequisites =
\\* Go >= 1.21
\\
\\**Additionally on Windows**: you must install [Zig
\\0.13.0](https://ziglang.org/download/#release-0.13.0) and set the
\\`CC` environment variable to `zig.exe cc`. Use the full path for
\\`zig.exe`.
,
.project_file = "",
.project_file_name = "",
.test_file_name = "main",
.install_commands =
\\go mod init tbtest
\\go get github.com/tigerbeetle/tigerbeetle-go
,
.run_commands = "go run main.go",
.examples = "",
.client_object_documentation = "",
.create_accounts_documentation =
\\The `Uint128` fields like `ID`, `UserData128`, `Amount` and
\\account balances have a few helper functions to make it easier
\\to convert 128-bit little-endian unsigned integers between
\\`string`, `math/big.Int`, and `[]byte`.
\\
\\See the type [Uint128](https://pkg.go.dev/github.com/tigerbeetle/tigerbeetle-go/pkg/types#Uint128) for more details.
,
.account_flags_documentation =
\\To toggle behavior for an account, use the `types.AccountFlags` struct
\\to combine enum values and generate a `uint16`. Here are a
\\few examples:
\\
\\* `AccountFlags{Linked: true}.ToUint16()`
\\* `AccountFlags{DebitsMustNotExceedCredits: true}.ToUint16()`
\\* `AccountFlags{CreditsMustNotExceedDebits: true}.ToUint16()`
\\* `AccountFlags{History: true}.ToUint16()`
,
.create_accounts_errors_documentation =
\\To handle errors you can either 1) exactly match error codes returned
\\from `client.createAccounts` with enum values in the
\\`CreateAccountError` object, or you can 2) look up the error code in
\\the `CreateAccountError` object for a human-readable string.
,
.create_transfers_documentation = "",
.create_transfers_errors_documentation = "",
.transfer_flags_documentation =
\\To toggle behavior for an account, use the `types.TransferFlags` struct
\\to combine enum values and generate a `uint16`. Here are a
\\few examples:
\\
\\* `TransferFlags{Linked: true}.ToUint16()`
\\* `TransferFlags{Pending: true}.ToUint16()`
\\* `TransferFlags{PostPendingTransfer: true}.ToUint16()`
\\* `TransferFlags{VoidPendingTransfer: true}.ToUint16()`
,
};