Go (golang) SDK for ApiOmat
Under construction!
- aomx - Package with shared functionality for sending requests to ApiOmat
- aomc - Package for handling "customer" resources during design-time
- aomu - Package for handling "user" resources during runtime
Package aomx contains common functionality for sending HTTP requests to an ApiOmat server.
The "x" in aomx is for "cross" (cutting functionality), because the package is used by the aomc and aomu packages.
Instead of using this package directly, you should use the packages aomc
or aomu
instead.
Package for handling "customer" resources during design-time
package main
import (
"fmt"
"github.com/philippgille/apiomat-sdk-go/aomc"
)
func main() {
client := aomc.NewDefaultClient("https://apiomat.yourcompany.com/yambas/rest", "john", "secret", "")
classes, err := client.GetClasses("TestModule")
if err != nil {
panic(err)
}
fmt.Printf("%+v", classes) // [{AllowedRolesCreate:[] AllowedRolesGrant:[] ...} {...}]
}
For updating the ApiOmat customer resource types such as dto.Class
, you can turn example JSON into structs with gojson like this:
gojson -input "dto/class.json" -name "Class" -o "dto/class.go" -pkg "dto"
Package for handling "user" resources during runtime