services

package
v0.0.0-alpha1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DepthError              = errors.New("depth error")
	CanceledError           = errors.New("canceled error")
	ActionCannotFoundError  = errors.New("action cannot found")
	EntityCannotFoundError  = errors.New("entity cannot found")
	UndefinedChildTypeError = errors.New("undefined child type")
	UndefinedChildKindError = errors.New("undefined child kind")
)

Functions

This section is empty.

Types

type CheckFunction

type CheckFunction func(ctx context.Context, decisionChan chan<- Decision)

CheckFunction -

type Combiner

type Combiner func(ctx context.Context, requests []CheckFunction) Decision

Combiner .

type Decision

type Decision struct {
	Can bool  `json:"can"`
	Err error `json:"err"`
}

Decision -

type IPermissionService

type IPermissionService interface {
	Check(ctx context.Context, s string, a string, o string, d int) (bool, *VisitMap, int, error)
}

IPermissionService -

type IRelationshipService

type IRelationshipService interface {
	WriteRelationship(ctx context.Context, entities []e.RelationTuple) error
	DeleteRelationship(ctx context.Context, entities []e.RelationTuple) error
}

IRelationshipService -

type ISchemaService

type ISchemaService interface {
	Schema(ctx context.Context) (sch schema.Schema, err error)
	Replace(ctx context.Context, configs []e.EntityConfig) (err error)
}

ISchemaService -

type PermissionService

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

PermissionService -

func NewPermissionService

NewPermissionService -

func (*PermissionService) Check

func (service *PermissionService) Check(ctx context.Context, s string, a string, o string, d int) (can bool, visit *VisitMap, remainingDepth int, err error)

Check -

type RelationshipService

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

RelationshipService -

func NewRelationshipService

func NewRelationshipService(repo repositories.IRelationTupleRepository) *RelationshipService

NewRelationshipService -

func (*RelationshipService) DeleteRelationship

func (service *RelationshipService) DeleteRelationship(ctx context.Context, entities []e.RelationTuple) error

DeleteRelationship -

func (*RelationshipService) WriteRelationship

func (service *RelationshipService) WriteRelationship(ctx context.Context, entities []e.RelationTuple) error

WriteRelationship -

type Request

type Request struct {
	Object  tuple.Object
	Subject tuple.User
	// contains filtered or unexported fields
}

Request -

func (*Request) SetDepth

func (r *Request) SetDepth(i int)

SetDepth -

type SchemaService

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

SchemaService -

func NewSchemaService

func NewSchemaService(repo repositories.IEntityConfigRepository) *SchemaService

NewSchemaService -

func (*SchemaService) Replace

func (service *SchemaService) Replace(ctx context.Context, configs []e.EntityConfig) (err error)

Replace -

func (*SchemaService) Schema

func (service *SchemaService) Schema(ctx context.Context) (sch schema.Schema, err error)

Schema -

type VisitMap

type VisitMap map[string]Decision

VisitMap -

Jump to

Keyboard shortcuts

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