Documentation ¶
Index ¶
- func HandleSQLError(err error, args ...interface{}) error
- func Write(ctx context.Context, dbInfo *DBInfo, store string, deletes storage.Deletes, ...) error
- type Config
- type ContToken
- type DBInfo
- type DatastoreOption
- func WithConnMaxIdleTime(d time.Duration) DatastoreOption
- func WithConnMaxLifetime(d time.Duration) DatastoreOption
- func WithLogger(l logger.Logger) DatastoreOption
- func WithMaxIdleConns(c int) DatastoreOption
- func WithMaxOpenConns(c int) DatastoreOption
- func WithMaxTuplesPerWrite(maxTuples int) DatastoreOption
- func WithMaxTypesPerAuthorizationModel(maxTypes int) DatastoreOption
- type SQLObjectIterator
- type SQLTupleIterator
- type TupleRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleSQLError ¶
Types ¶
type Config ¶
type Config struct { Logger logger.Logger MaxTuplesPerWriteField int MaxTypesPerModelField int MaxOpenConns int MaxIdleConns int ConnMaxIdleTime time.Duration ConnMaxLifetime time.Duration }
func NewConfig ¶
func NewConfig(opts ...DatastoreOption) *Config
type DBInfo ¶
type DBInfo struct {
// contains filtered or unexported fields
}
DBInfo encapsulates DB information for use in common method
type DatastoreOption ¶
type DatastoreOption func(*Config)
func WithConnMaxIdleTime ¶
func WithConnMaxIdleTime(d time.Duration) DatastoreOption
func WithConnMaxLifetime ¶
func WithConnMaxLifetime(d time.Duration) DatastoreOption
func WithLogger ¶
func WithLogger(l logger.Logger) DatastoreOption
func WithMaxIdleConns ¶
func WithMaxIdleConns(c int) DatastoreOption
func WithMaxOpenConns ¶
func WithMaxOpenConns(c int) DatastoreOption
func WithMaxTuplesPerWrite ¶
func WithMaxTuplesPerWrite(maxTuples int) DatastoreOption
func WithMaxTypesPerAuthorizationModel ¶
func WithMaxTypesPerAuthorizationModel(maxTypes int) DatastoreOption
type SQLObjectIterator ¶
type SQLObjectIterator struct {
// contains filtered or unexported fields
}
func NewSQLObjectIterator ¶
func NewSQLObjectIterator(rows *sql.Rows) *SQLObjectIterator
NewSQLObjectIterator returns a tuple iterator for Postgres
func (*SQLObjectIterator) Stop ¶
func (o *SQLObjectIterator) Stop()
type SQLTupleIterator ¶
type SQLTupleIterator struct {
// contains filtered or unexported fields
}
func NewSQLTupleIterator ¶
func NewSQLTupleIterator(rows *sql.Rows) *SQLTupleIterator
NewSQLTupleIterator returns a SQL tuple iterator
func (*SQLTupleIterator) Stop ¶
func (t *SQLTupleIterator) Stop()
func (*SQLTupleIterator) ToArray ¶
func (t *SQLTupleIterator) ToArray(opts storage.PaginationOptions) ([]*openfgapb.Tuple, []byte, error)
ToArray converts the tupleIterator to an []*openfgapb.Tuple and a possibly empty continuation token. If the continuation token exists it is the ulid of the last element of the returned array.
Click to show internal directories.
Click to hide internal directories.