https://github.com/philippgille/apiomat-sdk-go
Go (golang) SDK for ApiOmat
https://github.com/philippgille/apiomat-sdk-go
aom apiomat go golang library package sdk
Last synced: 8 months ago
JSON representation
Go (golang) SDK for ApiOmat
- Host: GitHub
- URL: https://github.com/philippgille/apiomat-sdk-go
- Owner: philippgille
- License: agpl-3.0
- Created: 2018-04-03T18:35:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-15T22:30:36.000Z (about 7 years ago)
- Last Synced: 2025-08-11T09:32:55.340Z (10 months ago)
- Topics: aom, apiomat, go, golang, library, package, sdk
- Language: Go
- Homepage:
- Size: 99.6 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# apiomat-sdk-go
[](https://travis-ci.org/philippgille/apiomat-sdk-go) [](https://ci.appveyor.com/project/philippgille/apiomat-sdk-go/branch/master) [](https://goreportcard.com/report/github.com/philippgille/apiomat-sdk-go) [](https://github.com/philippgille/apiomat-sdk-go/releases)
Go (golang) SDK for ApiOmat
Under construction!
[](http://www.babygopher.org)
## Contents
- [aomx - Package with shared functionality for sending requests to ApiOmat](#aomx)
- [aomc - Package for handling "customer" resources during design-time](#aomc)
- [aomu - Package for handling "user" resources during runtime](#aomu)
## aomx
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.
[](https://godoc.org/github.com/philippgille/apiomat-sdk-go/aomx)
## aomc
Package for handling "customer" resources during design-time
### Usage
[](https://godoc.org/github.com/philippgille/apiomat-sdk-go/aomc)
#### Example
```go
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:[] ...} {...}]
}
```
### Build
For updating the ApiOmat customer resource types such as `dto.Class`, you can turn example JSON into structs with [gojson](https://github.com/ChimeraCoder/gojson) like this:
```bash
gojson -input "dto/class.json" -name "Class" -o "dto/class.go" -pkg "dto"
```
## aomu
Package for handling "user" resources during runtime