openfga

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore[R, W any] interface {
	// Read starts a read only transaction.
	Read(context.Context, func(context.Context, R) error) error
	// ReadWriteTx starts a read write transaction.
	ReadWrite(context.Context, func(context.Context, W) error) error
}

Datastore provides methods for transactional operations.

func NewDatastore

func NewDatastore[R, W any](client client.SdkClient, r ReadFactory[R], rw ReadWriteFactory[W]) (Datastore[R, W], error)

NewDatastore returns a new instance of db.

type DatastoreError

type DatastoreError struct {
	// Details are details to the operation
	Details string
	// Err is the error that occurred.
	Err error
}

DatastoreError is an error that occurred while executing a operation.

func NewDatastoreError

func NewDatastoreError(details string, err error) *DatastoreError

NewDatastoreError returns a new QueryError.

func (*DatastoreError) Error

func (e *DatastoreError) Error() string

Error implements the error interface.

func (*DatastoreError) Unwrap

func (e *DatastoreError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type ReadFactory

type ReadFactory[R any] func(client.SdkClient) (R, error)

ReadFactory is a function that creates a new instance of Datastore.

type ReadWriteFactory

type ReadWriteFactory[W any] func(client.SdkClient) (W, error)

ReadWriteFactory is a function that creates a new instance of Datastore.

Jump to

Keyboard shortcuts

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