Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
v1.SchemaServiceClient
v1.PermissionsServiceClient
v1.WatchServiceClient
}
Client represents an open connection to Authzed.
Clients are backed by a gRPC client and as such are thread-safe.
func NewClient ¶
func NewClient(endpoint string, opts ...grpc.DialOption) (*Client, error)
NewClient initializes a brand new client for interacting with Authzed.
Example ¶
package main
import (
"log"
"github.com/authzed/grpcutil"
authzed "github.com/authzed/authzed-go/v1"
)
func main() {
client, err := authzed.NewClient(
"grpc.authzed.com:443",
grpcutil.WithBearerToken("tc_my_token_deadbeefdeadbeefdeadbeef"),
grpcutil.WithSystemCerts(grpcutil.VerifyCA),
)
if err != nil {
log.Fatalf("failed to connect to authzed: %s", err)
}
log.Println(client)
}
Click to show internal directories.
Click to hide internal directories.