spicedb

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWritingSchema = errors.New("error in writing schema to spicedb")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Host         string `yaml:"host"`
	Port         string `yaml:"port" default:"50051"`
	PreSharedKey string `yaml:"pre_shared_key" mapstructure:"pre_shared_key"`

	// FullyConsistent ensures APIs although slower than usual will result in responses always most consistent
	FullyConsistent bool `yaml:"fully_consistent" mapstructure:"fully_consistent" default:"false"`
}

type RelationRepository

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

func NewRelationRepository

func NewRelationRepository(spiceDB *SpiceDB, fullyConsistent bool) *RelationRepository

func (RelationRepository) Add

func (RelationRepository) BatchCheck added in v0.7.4

func (r RelationRepository) BatchCheck(ctx context.Context, relations []relation.Relation) ([]relation.CheckPair, error)

func (RelationRepository) Check

func (RelationRepository) Delete

func (RelationRepository) ListRelations

func (r RelationRepository) ListRelations(ctx context.Context, rel relation.Relation) ([]relation.Relation, error)

ListRelations shouldn't be used in high TPS flows as consistency requirements are set high

func (RelationRepository) LookupResources

func (r RelationRepository) LookupResources(ctx context.Context, rel relation.Relation) ([]string, error)

func (RelationRepository) LookupSubjects

func (r RelationRepository) LookupSubjects(ctx context.Context, rel relation.Relation) ([]string, error)

type SchemaRepository

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

func NewSchemaRepository

func NewSchemaRepository(logger log.Logger, spiceDB *SpiceDB) *SchemaRepository

func (SchemaRepository) WriteSchema

func (r SchemaRepository) WriteSchema(ctx context.Context, schema string) error

type SpiceDB

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

func New

func New(config Config, logger log.Logger) (*SpiceDB, error)

func (*SpiceDB) Check

func (s *SpiceDB) Check() error

Jump to

Keyboard shortcuts

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