You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,18 @@
1
1
# DirectAdmin Go SDK
2
+
2
3
Interface with a DirectAdmin installation using Go.
3
4
4
-
This library supports both the legacy/default DirectAdmin API, as well as their new modern API that's still in active development.
5
+
This library supports both the legacy/default DirectAdmin API, and their new modern API still in active development.
5
6
6
-
**Note: This is in an experimental state. While it's being used in production, the library is very likely to change (especially in-line with DA's own changes). DA features are being added as needed on our end, but PRs are always welcome!**
7
+
**Note: This is in an experimental state. While it's being used in production, the library is very likely to change (
8
+
especially in-line with DA's own changes). DA features are being added as needed on our end, but PRs are always welcome!
9
+
**
7
10
8
-
**If you wonder why something has been handled in an unusual way, it's most likely a workaround required by one of DA's many quirks.**
11
+
**If you wonder why something has been handled unusually, it's most likely a workaround required by one of DA's many
12
+
quirks.**
9
13
10
14
## Login as Admin / Reseller / User
15
+
11
16
To open a session as an admin/reseller/user, follow the following code block:
12
17
13
18
```go
@@ -16,7 +21,6 @@ package main
16
21
import (
17
22
"time"
18
23
19
-
"github.com/goccy/go-json"
20
24
"github.com/levelzerotechnology/directadmin-go"
21
25
)
22
26
@@ -43,20 +47,22 @@ func main() {
43
47
From here, you can call user functions via `userCtx`.
44
48
45
49
For example, if you wanted to print each of your databases to your terminal:
50
+
46
51
```go
47
52
dbs, err:= userCtx.GetDatabases()
48
53
if err != nil {
49
-
log.Fatalln(err)
54
+
log.Fatalln(err)
50
55
}
51
56
52
57
for_, db:=range dbs {
53
-
fmt.Println(db.Name)
58
+
fmt.Println(db.Name)
54
59
}
55
60
```
56
61
57
62
## Roadmap
58
63
59
-
-[ ] Cleanup repo structure (e.g. redis actions being within `admin.go` could go into a dedicated `redis.go` file perhaps)
64
+
-[ ] Cleanup repo structure (e.g. redis actions being within `admin.go` could go into a dedicated `redis.go` file
65
+
perhaps)
60
66
-[ ] Explore DA's new API's update versions of old functions (e.g. user config/usage)
0 commit comments