1
Fork 0
api-go/README.md
mya 9bb2be3ac5
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
ci: add woodpecker
2023-12-30 20:51:43 -06:00

710 B

api-go

status-badge

A Golang implementation of the Licensing API as defined by the proto repository.

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()
}