servers

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStatus

func GetStatus(err error) codes.Code

GetStatus - Get status code and message from error

Types

type Container added in v0.4.0

type Container struct {
	// Invoker for performing permission-related operations
	Invoker invoke.Invoker
	// DataReader for reading data from storage
	DR storage.DataReader
	// DataWriter for writing data to storage
	DW storage.DataWriter
	// SchemaReader for reading schemas from storage
	SR storage.SchemaReader
	// SchemaWriter for writing schemas to storage
	SW storage.SchemaWriter
	// TenantReader for reading tenant information from storage
	TR storage.TenantReader
	// TenantWriter for writing tenant information to storage
	TW storage.TenantWriter

	W storage.Watcher
}

Container is a struct that holds the invoker and various storage storage for permission-related operations. It serves as a central point of access for interacting with the underlying data and services.

func NewContainer added in v0.4.0

NewContainer is a constructor for the Container struct. It takes an Invoker, RelationshipReader, RelationshipWriter, SchemaReader, SchemaWriter, TenantReader, and TenantWriter as arguments, and returns a pointer to a Container instance.

func (*Container) Run added in v0.4.0

func (s *Container) Run(
	ctx context.Context,
	cfg *config.Server,
	authentication *config.Authn,
	profiler *config.Profiler,
	l *logger.Logger,
) error

Run is a method that starts the Container and its services, including the gRPC server, an optional HTTP server, and an optional profiler server. It also sets up authentication, TLS configurations, and interceptors as needed.

type DataServer added in v0.5.0

type DataServer struct {
	v1.UnimplementedDataServer
	// contains filtered or unexported fields
}

DataServer - Structure for Data Server

func NewDataServer added in v0.5.0

NewDataServer - Creates new Data Server

func (*DataServer) Delete added in v0.5.0

Delete - Delete relationships and attributes from writeDB

func (*DataServer) DeleteRelationships added in v0.5.0

func (r *DataServer) DeleteRelationships(ctx context.Context, request *v1.RelationshipDeleteRequest) (*v1.RelationshipDeleteResponse, error)

DeleteRelationships - Delete relationships from writeDB

func (*DataServer) ReadAttributes added in v0.5.0

func (r *DataServer) ReadAttributes(ctx context.Context, request *v1.AttributeReadRequest) (*v1.AttributeReadResponse, error)

ReadAttributes - Allows directly querying the stored engines data to display and filter stored attribute tuples

func (*DataServer) ReadRelationships added in v0.5.0

func (r *DataServer) ReadRelationships(ctx context.Context, request *v1.RelationshipReadRequest) (*v1.RelationshipReadResponse, error)

ReadRelationships - Allows directly querying the stored engines data to display and filter stored relational tuples

func (*DataServer) Write added in v0.5.0

func (r *DataServer) Write(ctx context.Context, request *v1.DataWriteRequest) (*v1.DataWriteResponse, error)

Write - Write relationships and attributes to writeDB

func (*DataServer) WriteRelationships added in v0.5.0

func (r *DataServer) WriteRelationships(ctx context.Context, request *v1.RelationshipWriteRequest) (*v1.RelationshipWriteResponse, error)

WriteRelationships - Write relation tuples to writeDB

type HealthServer

type HealthServer struct {
	health.UnimplementedHealthServer
}

HealthServer - Structure for Health Server

func NewHealthServer

func NewHealthServer() *HealthServer

NewHealthServer - Creates new HealthServer Server

func (*HealthServer) Check

Check - Return health check status response

func (*HealthServer) Watch

Watch - TO:DO

type PermissionServer

type PermissionServer struct {
	v1.UnimplementedPermissionServer
	// contains filtered or unexported fields
}

PermissionServer - Structure for Permission Server

func NewPermissionServer

func NewPermissionServer(i invoke.Invoker, l logger.Interface) *PermissionServer

NewPermissionServer - Creates new Permission Server

func (*PermissionServer) Check

Check - Performs Authorization Check

func (*PermissionServer) Expand

Expand - Get schema actions in a tree structure

func (*PermissionServer) LookupEntity

LookupEntity -

func (*PermissionServer) LookupEntityStream

LookupEntityStream -

func (*PermissionServer) LookupSubject added in v0.4.1

LookupSubject -

func (*PermissionServer) SubjectPermission added in v0.4.7

SubjectPermission -

type SchemaServer

type SchemaServer struct {
	v1.UnimplementedSchemaServer
	// contains filtered or unexported fields
}

SchemaServer - Structure for Schema Server

func NewSchemaServer

NewSchemaServer - Creates new Schema Server

func (*SchemaServer) Read

Read - Read created Schema

func (*SchemaServer) Write

Write - Configure new Permify Schema to Permify

type TenancyServer added in v0.3.0

type TenancyServer struct {
	v1.UnimplementedTenancyServer
	// contains filtered or unexported fields
}

TenancyServer - Structure for Tenancy Server

func NewTenancyServer added in v0.3.0

NewTenancyServer - Creates new Tenancy Server

func (*TenancyServer) Create added in v0.3.0

Create - Create new Tenant

func (*TenancyServer) Delete added in v0.3.0

Delete - Delete a Tenant

func (*TenancyServer) List added in v0.3.0

List - List Tenants

type WatchServer added in v0.4.4

type WatchServer struct {
	v1.UnimplementedWatchServer
	// contains filtered or unexported fields
}

func NewWatchServer added in v0.4.4

func NewWatchServer(
	w storage.Watcher,
	dr storage.DataReader,
	l logger.Interface,
) *WatchServer

func (*WatchServer) Watch added in v0.4.4

func (r *WatchServer) Watch(request *v1.WatchRequest, server v1.Watch_WatchServer) error

Watch function sets up a stream for the client to receive changes.

Jump to

Keyboard shortcuts

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