apiv1alpha1connect

package
v1.16.1-20240319091308... Latest Latest
Warning

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

Go to latest
Published: unknown License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SchemaServiceReadSchemaProcedure is the fully-qualified name of the SchemaService's ReadSchema
	// RPC.
	SchemaServiceReadSchemaProcedure = "/authzed.api.v1alpha1.SchemaService/ReadSchema"
	// SchemaServiceWriteSchemaProcedure is the fully-qualified name of the SchemaService's WriteSchema
	// RPC.
	SchemaServiceWriteSchemaProcedure = "/authzed.api.v1alpha1.SchemaService/WriteSchema"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// SchemaServiceName is the fully-qualified name of the SchemaService service.
	SchemaServiceName = "authzed.api.v1alpha1.SchemaService"
)
View Source
const (
	// WatchResourcesServiceName is the fully-qualified name of the WatchResourcesService service.
	WatchResourcesServiceName = "authzed.api.v1alpha1.WatchResourcesService"
)
View Source
const (
	// WatchResourcesServiceWatchResourcesProcedure is the fully-qualified name of the
	// WatchResourcesService's WatchResources RPC.
	WatchResourcesServiceWatchResourcesProcedure = "/authzed.api.v1alpha1.WatchResourcesService/WatchResources"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

Variables

This section is empty.

Functions

func NewSchemaServiceHandler

func NewSchemaServiceHandler(svc SchemaServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewSchemaServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewWatchResourcesServiceHandler

func NewWatchResourcesServiceHandler(svc WatchResourcesServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewWatchResourcesServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type SchemaServiceClient

type SchemaServiceClient interface {
	// Read returns the current Object Definitions for a Permissions System.
	//
	// Errors include:
	// - INVALID_ARGUMENT: a provided value has failed to semantically validate
	// - NOT_FOUND: one of the Object Definitions being requested does not exist
	ReadSchema(context.Context, *connect.Request[v1alpha1.ReadSchemaRequest]) (*connect.Response[v1alpha1.ReadSchemaResponse], error)
	// Write overwrites the current Object Definitions for a Permissions System.
	//
	// Any Object Definitions that exist, but are not included will be deleted.
	WriteSchema(context.Context, *connect.Request[v1alpha1.WriteSchemaRequest]) (*connect.Response[v1alpha1.WriteSchemaResponse], error)
}

SchemaServiceClient is a client for the authzed.api.v1alpha1.SchemaService service.

func NewSchemaServiceClient

func NewSchemaServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SchemaServiceClient

NewSchemaServiceClient constructs a client for the authzed.api.v1alpha1.SchemaService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type SchemaServiceHandler

type SchemaServiceHandler interface {
	// Read returns the current Object Definitions for a Permissions System.
	//
	// Errors include:
	// - INVALID_ARGUMENT: a provided value has failed to semantically validate
	// - NOT_FOUND: one of the Object Definitions being requested does not exist
	ReadSchema(context.Context, *connect.Request[v1alpha1.ReadSchemaRequest]) (*connect.Response[v1alpha1.ReadSchemaResponse], error)
	// Write overwrites the current Object Definitions for a Permissions System.
	//
	// Any Object Definitions that exist, but are not included will be deleted.
	WriteSchema(context.Context, *connect.Request[v1alpha1.WriteSchemaRequest]) (*connect.Response[v1alpha1.WriteSchemaResponse], error)
}

SchemaServiceHandler is an implementation of the authzed.api.v1alpha1.SchemaService service.

type UnimplementedSchemaServiceHandler

type UnimplementedSchemaServiceHandler struct{}

UnimplementedSchemaServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedSchemaServiceHandler) ReadSchema

func (UnimplementedSchemaServiceHandler) WriteSchema

type UnimplementedWatchResourcesServiceHandler

type UnimplementedWatchResourcesServiceHandler struct{}

UnimplementedWatchResourcesServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedWatchResourcesServiceHandler) WatchResources

type WatchResourcesServiceClient

type WatchResourcesServiceClient interface {
	// WatchResources initiates a watch for permission changes for the provided
	// (resource type, permission, subject) pair.
	WatchResources(context.Context, *connect.Request[v1alpha1.WatchResourcesRequest]) (*connect.ServerStreamForClient[v1alpha1.WatchResourcesResponse], error)
}

WatchResourcesServiceClient is a client for the authzed.api.v1alpha1.WatchResourcesService service.

func NewWatchResourcesServiceClient

func NewWatchResourcesServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) WatchResourcesServiceClient

NewWatchResourcesServiceClient constructs a client for the authzed.api.v1alpha1.WatchResourcesService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type WatchResourcesServiceHandler

type WatchResourcesServiceHandler interface {
	// WatchResources initiates a watch for permission changes for the provided
	// (resource type, permission, subject) pair.
	WatchResources(context.Context, *connect.Request[v1alpha1.WatchResourcesRequest], *connect.ServerStream[v1alpha1.WatchResourcesResponse]) error
}

WatchResourcesServiceHandler is an implementation of the authzed.api.v1alpha1.WatchResourcesService service.

Jump to

Keyboard shortcuts

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