docs: add basic readme content
This commit is contained in:
parent
c3d14d8b7d
commit
dcd9f5c5ec
34
README.md
34
README.md
@ -0,0 +1,34 @@
|
|||||||
|
# api-go
|
||||||
|
|
||||||
|
Golang implementation of the Licensing API as defined by the [proto](https://code.pitz.tech/licensing/proto) repository.
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
|
"code.pitz.tech/licensing/api-go"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
clientConn, err := grpc.Dial("host:port") // grpc.Dial("host:port", dialopts...)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
client, err := api.NewClient(api.ClientConfig{
|
||||||
|
ClientConn: clientConn,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
client.Contributors()
|
||||||
|
client.Licenses()
|
||||||
|
client.Packages()
|
||||||
|
client.Products()
|
||||||
|
client.Tokens()
|
||||||
|
client.Users()
|
||||||
|
}
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user