data

package
v0.0.0-...-fa575e6 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

README

Data

Documentation

Index

Constants

View Source
const (
	// SpicedbImage is the image used for containerized spiceDB in tests
	SpicedbImage = "authzed/spicedb"
	// SpicedbVersion is the image version used for containerized spiceDB in tests
	SpicedbVersion = "v1.37.0"
	// SpicedbSchemaBootstrapFile specifies an optional bootstrap schema file to be used for testing
	SpicedbSchemaBootstrapFile = "spicedb-test-data/basic_schema.zed"
	// SpicedbRelationsBootstrapFile specifies an optional bootstrap file containing relations to be used for testing
	SpicedbRelationsBootstrapFile = ""
	// FullyConsistent specifices the consistency mode used for our read API calls
	// may experience different results between tests and manual probing if the values differ
	FullyConsistent = false // Should probably be inline with our config file. (TODO: Can we make our tests grab the same value?)
)

Variables

ProviderSet is data providers.

Functions

func CheckForRelationship

func CheckForRelationship(client biz.ZanzibarRepository, subjectID string, subjectNamespace string, subjectType string, subjectRelationship string, relationship string, resourceNamespace string, resourceType string, resourceID string, consistency *v1beta1.Consistency) bool

CheckForRelationship returns true if the given subject has the given relationship to the given resource, otherwise false

Types

type ContainerOptions

type ContainerOptions struct {
	Logger  log.Logger
	Network *docker.Network
}

type LocalSpiceDbContainer

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

LocalSpiceDbContainer struct that holds pointers to the container, dockertest pool and exposes the port

func CreateContainer

func CreateContainer(opts *ContainerOptions) (*LocalSpiceDbContainer, error)

CreateContainer creates a new SpiceDbContainer using dockertest

func (*LocalSpiceDbContainer) Close

func (l *LocalSpiceDbContainer) Close()

Close purges the container

func (*LocalSpiceDbContainer) CreateSpiceDbRepository

func (l *LocalSpiceDbContainer) CreateSpiceDbRepository() (*SpiceDbRepository, error)

CreateClient creates a new client that connects to the dockerized spicedb instance and the right store

func (*LocalSpiceDbContainer) Name

func (l *LocalSpiceDbContainer) Name() string

Name returns the container name

func (*LocalSpiceDbContainer) NewToken

func (l *LocalSpiceDbContainer) NewToken() (string, error)

NewToken returns a new token used for the container so a new store is created in serve-testing

func (*LocalSpiceDbContainer) Port

func (l *LocalSpiceDbContainer) Port() string

Port returns the Port the container is listening

func (*LocalSpiceDbContainer) WaitForQuantizationInterval

func (l *LocalSpiceDbContainer) WaitForQuantizationInterval()

WaitForQuantizationInterval needed to avoid read-before-write when loading the schema

type SpiceDbRepository

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

SpiceDbRepository .

func NewSpiceDbRepository

func NewSpiceDbRepository(c *conf.Data, logger log.Logger) (*SpiceDbRepository, func(), error)

NewSpiceDbRepository .

func (*SpiceDbRepository) AcquireLock

func (*SpiceDbRepository) Check

func (*SpiceDbRepository) CheckBulk

simplified CheckBulk using the helpers

func (*SpiceDbRepository) CheckForUpdate

func (*SpiceDbRepository) CreateRelationships

func (*SpiceDbRepository) DeleteRelationships

func (*SpiceDbRepository) IsBackendAvailable

func (s *SpiceDbRepository) IsBackendAvailable() error

func (*SpiceDbRepository) LookupResources

func (s *SpiceDbRepository) LookupResources(ctx context.Context, resouce_type *apiV1beta1.ObjectType, relation string, subject *apiV1beta1.SubjectReference, limit uint32, continuation biz.ContinuationToken, consistency *apiV1beta1.Consistency) (chan *biz.ResourceResult, chan error, error)

func (*SpiceDbRepository) LookupSubjects

func (s *SpiceDbRepository) LookupSubjects(ctx context.Context, subject_type *apiV1beta1.ObjectType, subject_relation, relation string, object *apiV1beta1.ObjectReference, limit uint32, continuation biz.ContinuationToken, consistency *apiV1beta1.Consistency) (chan *biz.SubjectResult, chan error, error)

func (*SpiceDbRepository) ReadRelationships

func (s *SpiceDbRepository) ReadRelationships(ctx context.Context, filter *apiV1beta1.RelationTupleFilter, limit uint32, continuation biz.ContinuationToken, consistency *apiV1beta1.Consistency) (chan *biz.RelationshipResult, chan error, error)

Jump to

Keyboard shortcuts

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