Documentation ¶
Index ¶
- Variables
- type Persister
- func (p *Persister) Connection(ctx context.Context) *pop.Connection
- func (p *Persister) DeleteAllRelationTuples(ctx context.Context, query *relationtuple.RelationQuery) (err error)
- func (p *Persister) DeleteRelationTuples(ctx context.Context, rs ...*relationtuple.RelationTuple) (err error)
- func (p *Persister) ExistsRelationTuples(ctx context.Context, query *relationtuple.RelationQuery) (_ bool, err error)
- func (p *Persister) GetRelationTuples(ctx context.Context, query *relationtuple.RelationQuery, ...) (_ []*relationtuple.RelationTuple, nextPageToken string, err error)
- func (p *Persister) InsertRelationTuple(ctx context.Context, rel *relationtuple.RelationTuple) (err error)
- func (p *Persister) MapStringsToUUIDs(ctx context.Context, s ...string) (_ []uuid.UUID, err error)
- func (p *Persister) MapStringsToUUIDsReadOnly(ctx context.Context, s ...string) (_ []uuid.UUID, err error)
- func (p *Persister) MapUUIDsToStrings(ctx context.Context, u ...uuid.UUID) (_ []string, err error)
- func (p *Persister) NetworkID(ctx context.Context) uuid.UUID
- func (p *Persister) TransactRelationTuples(ctx context.Context, ins []*relationtuple.RelationTuple, ...) (err error)
- func (p *Persister) Transaction(ctx context.Context, f func(ctx context.Context) error) error
- func (p *Persister) WriteRelationTuples(ctx context.Context, rs ...*relationtuple.RelationTuple) (err error)
- type RelationTuple
- type Traverser
- func (t *Traverser) TraverseSubjectSetExpansion(ctx context.Context, start *relationtuple.RelationTuple) (res []*relationtuple.TraversalResult, err error)
- func (t *Traverser) TraverseSubjectSetRewrite(ctx context.Context, start *relationtuple.RelationTuple, ...) (res []*relationtuple.TraversalResult, err error)
- type UUIDMapping
- type UUIDMappings
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //go:embed migrations/sql/*.sql Migrations embed.FS )
Functions ¶
This section is empty.
Types ¶
type Persister ¶
type Persister struct {
// contains filtered or unexported fields
}
func NewPersister ¶
func (*Persister) Connection ¶
func (*Persister) DeleteAllRelationTuples ¶
func (p *Persister) DeleteAllRelationTuples(ctx context.Context, query *relationtuple.RelationQuery) (err error)
func (*Persister) DeleteRelationTuples ¶
func (p *Persister) DeleteRelationTuples(ctx context.Context, rs ...*relationtuple.RelationTuple) (err error)
func (*Persister) ExistsRelationTuples ¶
func (p *Persister) ExistsRelationTuples(ctx context.Context, query *relationtuple.RelationQuery) (_ bool, err error)
func (*Persister) GetRelationTuples ¶
func (p *Persister) GetRelationTuples(ctx context.Context, query *relationtuple.RelationQuery, options ...x.PaginationOptionSetter) (_ []*relationtuple.RelationTuple, nextPageToken string, err error)
func (*Persister) InsertRelationTuple ¶
func (p *Persister) InsertRelationTuple(ctx context.Context, rel *relationtuple.RelationTuple) (err error)
func (*Persister) MapStringsToUUIDs ¶
func (*Persister) MapStringsToUUIDsReadOnly ¶
func (*Persister) MapUUIDsToStrings ¶
func (*Persister) TransactRelationTuples ¶
func (p *Persister) TransactRelationTuples(ctx context.Context, ins []*relationtuple.RelationTuple, del []*relationtuple.RelationTuple) (err error)
func (*Persister) Transaction ¶
func (*Persister) WriteRelationTuples ¶
func (p *Persister) WriteRelationTuples(ctx context.Context, rs ...*relationtuple.RelationTuple) (err error)
type RelationTuple ¶
type RelationTuple struct { // An ID field is required to make pop happy. The actual ID is a composite primary key. ID uuid.UUID `db:"shard_id"` NetworkID uuid.UUID `db:"nid"` Namespace string `db:"namespace"` Object uuid.UUID `db:"object"` Relation string `db:"relation"` SubjectID uuid.NullUUID `db:"subject_id"` SubjectSetNamespace sql.NullString `db:"subject_set_namespace"` SubjectSetObject uuid.NullUUID `db:"subject_set_object"` SubjectSetRelation sql.NullString `db:"subject_set_relation"` CommitTime time.Time `db:"commit_time"` }
func (*RelationTuple) FromInternal ¶
func (r *RelationTuple) FromInternal(ctx context.Context, p *Persister, rt *relationtuple.RelationTuple) (err error)
func (*RelationTuple) TableName ¶
func (*RelationTuple) TableName() string
func (*RelationTuple) ToInternal ¶
func (r *RelationTuple) ToInternal() (*relationtuple.RelationTuple, error)
type Traverser ¶
type Traverser struct {
// contains filtered or unexported fields
}
func NewTraverser ¶
func (*Traverser) TraverseSubjectSetExpansion ¶
func (t *Traverser) TraverseSubjectSetExpansion(ctx context.Context, start *relationtuple.RelationTuple) (res []*relationtuple.TraversalResult, err error)
TraverseSubjectSetExpansion gets all subject sets for the object#relation. It also checks whether the requested subject is a member of each of the returned subject sets.
func (*Traverser) TraverseSubjectSetRewrite ¶
func (t *Traverser) TraverseSubjectSetRewrite(ctx context.Context, start *relationtuple.RelationTuple, computedSubjectSets []string) (res []*relationtuple.TraversalResult, err error)
type UUIDMapping ¶
type UUIDMapping struct { ID uuid.UUID `db:"id"` StringRepresentation string `db:"string_representation"` }
func (UUIDMapping) TableName ¶
func (UUIDMapping) TableName() string
type UUIDMappings ¶
type UUIDMappings []*UUIDMapping
func (UUIDMappings) TableName ¶
func (UUIDMappings) TableName() string
Click to show internal directories.
Click to hide internal directories.