Documentation
¶
Index ¶
- type DatastoreStorageOpt
- type IteratorDatastore
- func (sf *IteratorDatastore) Read(ctx context.Context, store string, tupleKey *openfgav1.TupleKey, ...) (storage.TupleIterator, error)
- func (sf *IteratorDatastore) ReadStartingWithUser(ctx context.Context, store string, filter storage.ReadStartingWithUserFilter, ...) (storage.TupleIterator, error)
- func (sf *IteratorDatastore) ReadUsersetTuples(ctx context.Context, store string, filter storage.ReadUsersetTuplesFilter, ...) (storage.TupleIterator, error)
- type IteratorDatastoreOpt
- func WithIteratorTargetSize(targetSize uint32) IteratorDatastoreOpt
- func WithMaxAdmissionTime(maxAdmissionTime time.Duration) IteratorDatastoreOpt
- func WithMaxTTL(ttl time.Duration) IteratorDatastoreOpt
- func WithMethod(method string) IteratorDatastoreOpt
- func WithSharedIteratorDatastoreLogger(logger logger.Logger) IteratorDatastoreOpt
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatastoreStorageOpt ¶
type DatastoreStorageOpt func(*Storage)
func WithSharedIteratorDatastoreStorageLimit ¶
func WithSharedIteratorDatastoreStorageLimit(limit int) DatastoreStorageOpt
WithSharedIteratorDatastoreStorageLimit sets the limit on the number of items in SF iterator iters.
type IteratorDatastore ¶
type IteratorDatastore struct {
storage.RelationshipTupleReader
// contains filtered or unexported fields
}
func NewSharedIteratorDatastore ¶
func NewSharedIteratorDatastore(inner storage.RelationshipTupleReader, internalStorage *Storage, opts ...IteratorDatastoreOpt) *IteratorDatastore
func (*IteratorDatastore) Read ¶
func (sf *IteratorDatastore) Read( ctx context.Context, store string, tupleKey *openfgav1.TupleKey, options storage.ReadOptions) (storage.TupleIterator, error)
func (*IteratorDatastore) ReadStartingWithUser ¶
func (sf *IteratorDatastore) ReadStartingWithUser( ctx context.Context, store string, filter storage.ReadStartingWithUserFilter, options storage.ReadStartingWithUserOptions, ) (storage.TupleIterator, error)
func (*IteratorDatastore) ReadUsersetTuples ¶
func (sf *IteratorDatastore) ReadUsersetTuples( ctx context.Context, store string, filter storage.ReadUsersetTuplesFilter, options storage.ReadUsersetTuplesOptions, ) (storage.TupleIterator, error)
type IteratorDatastoreOpt ¶
type IteratorDatastoreOpt func(*IteratorDatastore)
func WithIteratorTargetSize ¶ added in v1.8.13
func WithIteratorTargetSize(targetSize uint32) IteratorDatastoreOpt
WithIteratorTargetSize sets the pre-allocated size of each shared tuple. This allows iterator from having to reallocate buffer space unless we go over that value.
func WithMaxAdmissionTime ¶ added in v1.8.13
func WithMaxAdmissionTime(maxAdmissionTime time.Duration) IteratorDatastoreOpt
WithMaxAdmissionTime sets the maximum duration for which shared iterator allows clone. After this period, clone will fail and fall back to non-shared iterator. This is done to prevent stale data if there are very long-running requests.
func WithMaxTTL ¶ added in v1.8.13
func WithMaxTTL(ttl time.Duration) IteratorDatastoreOpt
WithMaxTTL sets the time for watchdog will kick and clean up.
func WithMethod ¶ added in v1.8.13
func WithMethod(method string) IteratorDatastoreOpt
WithMethod specifies whether the shared iterator is for check or list objects for metrics.
func WithSharedIteratorDatastoreLogger ¶
func WithSharedIteratorDatastoreLogger(logger logger.Logger) IteratorDatastoreOpt
WithSharedIteratorDatastoreLogger sets the logger for the IteratorDatastore.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewSharedIteratorDatastoreStorage ¶
func NewSharedIteratorDatastoreStorage(opts ...DatastoreStorageOpt) *Storage