authzed

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	v1alpha1.SchemaServiceClient
}

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/v1alpha1"
)

func main() {
	client, err := authzed.NewClient(
		"grpc.authzed.com:443",
		grpcutil.WithBearerToken("tc_my_token_deadbeefdeadbeefdeadbeef"),
		grpcutil.WithSystemCerts(false),
	)
	if err != nil {
		log.Fatalf("failed to connect to authzed: %s", err)
	}
	log.Println(client)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL