directory

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: Apache-2.0 Imports: 16 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DBPath         string        `json:"db_path"`
	RequestTimeout time.Duration `json:"request_timeout"`
	Seed           bool          `json:"seed_metadata"`
}

type Directory

type Directory struct {
	// contains filtered or unexported fields
}

func New

func New(config *Config, logger *zerolog.Logger) (*Directory, error)

func (*Directory) CheckPermission

func (s *Directory) CheckPermission(ctx context.Context, req *dsr.CheckPermissionRequest) (resp *dsr.CheckPermissionResponse, err error)

Check if subject has permission on object.

func (*Directory) CheckRelation

func (s *Directory) CheckRelation(ctx context.Context, req *dsr.CheckRelationRequest) (resp *dsr.CheckRelationResponse, err error)

Check if subject has relation to object.

func (*Directory) Close

func (s *Directory) Close()

func (*Directory) DeleteObject

func (s *Directory) DeleteObject(ctx context.Context, req *dsw.DeleteObjectRequest) (resp *dsw.DeleteObjectResponse, err error)

func (*Directory) DeleteObjectType

func (s *Directory) DeleteObjectType(ctx context.Context, req *dsw.DeleteObjectTypeRequest) (resp *dsw.DeleteObjectTypeResponse, err error)

func (*Directory) DeletePermission

func (s *Directory) DeletePermission(ctx context.Context, req *dsw.DeletePermissionRequest) (resp *dsw.DeletePermissionResponse, err error)

func (*Directory) DeleteRelation

func (s *Directory) DeleteRelation(ctx context.Context, req *dsw.DeleteRelationRequest) (resp *dsw.DeleteRelationResponse, err error)

func (*Directory) DeleteRelationType

func (s *Directory) DeleteRelationType(ctx context.Context, req *dsw.DeleteRelationTypeRequest) (resp *dsw.DeleteRelationTypeResponse, err error)

func (*Directory) Export

func (s *Directory) Export(req *dse.ExportRequest, stream dse.Exporter_ExportServer) (err error)

func (*Directory) GetGraph

func (s *Directory) GetGraph(ctx context.Context, req *dsr.GetGraphRequest) (resp *dsr.GetGraphResponse, err error)

Get object dependency graph.

func (*Directory) GetObject

func (s *Directory) GetObject(ctx context.Context, req *dsr.GetObjectRequest) (resp *dsr.GetObjectResponse, err error)

Get single object instance.

func (*Directory) GetObjectMany

func (s *Directory) GetObjectMany(ctx context.Context, req *dsr.GetObjectManyRequest) (resp *dsr.GetObjectManyResponse, err error)

Get multiple object instances by id or type+key, in a single request.

func (*Directory) GetObjectType

func (s *Directory) GetObjectType(ctx context.Context, req *dsr.GetObjectTypeRequest) (resp *dsr.GetObjectTypeResponse, err error)

Get object type (metadata)

func (*Directory) GetObjectTypes

func (s *Directory) GetObjectTypes(ctx context.Context, req *dsr.GetObjectTypesRequest) (resp *dsr.GetObjectTypesResponse, err error)

Get all objects types (metadata) (paginated)

func (*Directory) GetObjects

func (s *Directory) GetObjects(ctx context.Context, req *dsr.GetObjectsRequest) (resp *dsr.GetObjectsResponse, err error)

Get all object instances, optionally filtered by object type. (paginated)

func (*Directory) GetPermission

func (s *Directory) GetPermission(ctx context.Context, req *dsr.GetPermissionRequest) (resp *dsr.GetPermissionResponse, err error)

Get permission (metadata)

func (*Directory) GetPermissions

func (s *Directory) GetPermissions(ctx context.Context, req *dsr.GetPermissionsRequest) (resp *dsr.GetPermissionsResponse, err error)

Get all permissions (metadata) (paginated)

func (*Directory) GetRelation

func (s *Directory) GetRelation(ctx context.Context, req *dsr.GetRelationRequest) (resp *dsr.GetRelationResponse, err error)

Get relation instances based on subject, relation, object filter.

func (*Directory) GetRelationType

func (s *Directory) GetRelationType(ctx context.Context, req *dsr.GetRelationTypeRequest) (resp *dsr.GetRelationTypeResponse, err error)

Get relation type (metadata)

func (*Directory) GetRelationTypes

func (s *Directory) GetRelationTypes(ctx context.Context, req *dsr.GetRelationTypesRequest) (resp *dsr.GetRelationTypesResponse, err error)

Get all relation types, optionally filtered by object type (metadata) (paginated)

func (*Directory) GetRelations

func (s *Directory) GetRelations(ctx context.Context, req *dsr.GetRelationsRequest) (resp *dsr.GetRelationsResponse, err error)

Get relation instances based on subject, relation, object filter. (paginated)

func (*Directory) Import

func (s *Directory) Import(stream dsi.Importer_ImportServer) error

func (*Directory) Init

func (s *Directory) Init() error

func (*Directory) Seed

func (s *Directory) Seed() error

func (*Directory) SetObject

func (s *Directory) SetObject(ctx context.Context, req *dsw.SetObjectRequest) (resp *dsw.SetObjectResponse, err error)

object methods

func (*Directory) SetObjectType

func (s *Directory) SetObjectType(ctx context.Context, req *dsw.SetObjectTypeRequest) (resp *dsw.SetObjectTypeResponse, err error)

object type metadata methods

func (*Directory) SetPermission

func (s *Directory) SetPermission(ctx context.Context, req *dsw.SetPermissionRequest) (resp *dsw.SetPermissionResponse, err error)

permission metadata methods

func (*Directory) SetRelation

func (s *Directory) SetRelation(ctx context.Context, req *dsw.SetRelationRequest) (resp *dsw.SetRelationResponse, err error)

relation methods

func (*Directory) SetRelationType

func (s *Directory) SetRelationType(ctx context.Context, req *dsw.SetRelationTypeRequest) (resp *dsw.SetRelationTypeResponse, err error)

relation type metadata methods

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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