https://github.com/liquidweb/go-lwapi
Minimalist LiquidWeb API Golang client
https://github.com/liquidweb/go-lwapi
golang liquidweb
Last synced: 5 months ago
JSON representation
Minimalist LiquidWeb API Golang client
- Host: GitHub
- URL: https://github.com/liquidweb/go-lwapi
- Owner: liquidweb
- License: apache-2.0
- Archived: true
- Created: 2017-06-09T16:21:52.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-04T20:35:56.000Z (almost 5 years ago)
- Last Synced: 2025-10-20T17:50:26.479Z (8 months ago)
- Topics: golang, liquidweb
- Language: Go
- Homepage: https://godoc.org/github.com/liquidweb/go-lwApi
- Size: 35.2 KB
- Stars: 3
- Watchers: 30
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-lwApi
LiquidWeb API Golang client
[](https://godoc.org/github.com/liquidweb/go-lwApi)
## Setting up Authentication
When creating an api client, it expects to be configured via a configuration struct. Here is an example of how to get an api client.
```
package main
import (
"fmt"
lwApi "github.com/liquidweb/go-lwApi"
)
func main() {
config := lwApi.LWAPIConfig{
Username: "ExampleUsername",
Password: "ExamplePassword",
Url: "api.liquidweb.com",
}
apiClient, iErr := lwApi.New(&config)
}
```
## Importing
``` go
import (
lwApi "github.com/liquidweb/go-lwApi"
)
```
## Calling a method
``` go
apiClient, iErr := lwApi.New(&config)
if iErr != nil {
panic(iErr)
}
args := map[string]interface{}{
"uniq_id": "2UPHPL",
}
got, gotErr := apiClient.Call("bleed/asset/details", args)
if gotErr != nil {
panic(gotErr)
}
fmt.Printf("RETURNED:\n\n%+v\n\n", got)
```
As you can see, you don't need to prefix the `params` key, as that is handled in the `Call()` function for you.