Documentation ¶
Index ¶
- Variables
- type Config
- type ConsistencyLevel
- type RelationRepository
- func (r *RelationRepository) Add(ctx context.Context, rel relation.Relation) error
- func (r *RelationRepository) BatchCheck(ctx context.Context, relations []relation.Relation) ([]relation.CheckPair, error)
- func (r *RelationRepository) Check(ctx context.Context, rel relation.Relation) (bool, error)
- func (r *RelationRepository) Delete(ctx context.Context, rel relation.Relation) error
- func (r *RelationRepository) ListRelations(ctx context.Context, rel relation.Relation) ([]relation.Relation, error)
- func (r *RelationRepository) LookupResources(ctx context.Context, rel relation.Relation) ([]string, error)
- func (r *RelationRepository) LookupSubjects(ctx context.Context, rel relation.Relation) ([]string, error)
- type SchemaRepository
- type SpiceDB
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"` // Deprecated: Use Consistency instead // FullyConsistent ensures APIs although slower than usual will result in responses always most consistent FullyConsistent bool `yaml:"fully_consistent" mapstructure:"fully_consistent" default:"false"` // Consistency ensures Authz server consistency guarantees for various operations // Possible values are: // - "full": Guarantees that the data is always fresh // - "best_effort": Guarantees that the data is the best effort fresh // - "minimize_latency": Tries to prioritise minimal latency Consistency string `yaml:"consistency" mapstructure:"consistency" default:"best_effort"` // CheckTrace enables tracing in check api for spicedb, it adds considerable // latency to the check calls and shouldn't be enabled in production CheckTrace bool `yaml:"check_trace" mapstructure:"check_trace" default:"false"` }
type ConsistencyLevel ¶ added in v0.42.0
type ConsistencyLevel string
const ( ConsistencyLevelFull ConsistencyLevel = "full" ConsistencyLevelBestEffort ConsistencyLevel = "best_effort" ConsistencyLevelMinimizeLatency ConsistencyLevel = "minimize_latency" )
func (ConsistencyLevel) String ¶ added in v0.42.0
func (c ConsistencyLevel) String() string
type RelationRepository ¶
type RelationRepository struct {
// contains filtered or unexported fields
}
func NewRelationRepository ¶
func NewRelationRepository(spiceDB *SpiceDB, consistency ConsistencyLevel, tracing bool) *RelationRepository
func (*RelationRepository) BatchCheck ¶ added in v0.7.4
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 (*RelationRepository) LookupSubjects ¶
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
Click to show internal directories.
Click to hide internal directories.