Documentation ¶
Index ¶
- func NewMigrationBox(c *pop.Connection, logger *logrusx.Logger, tracer *tracing.Tracer) (*popx.MigrationBox, error)
- type Persister
- func (p *Persister) Connection(ctx context.Context) *pop.Connection
- func (p *Persister) CreateWithNetwork(ctx context.Context, v interface{}) error
- func (p *Persister) DeleteAllRelationTuples(ctx context.Context, query *relationtuple.RelationQuery) error
- func (p *Persister) DeleteRelationTuples(ctx context.Context, rs ...*relationtuple.InternalRelationTuple) error
- func (p *Persister) GetNamespaceByID(ctx context.Context, id int32) (*namespace.Namespace, error)
- func (p *Persister) GetNamespaceByName(ctx context.Context, name string) (*namespace.Namespace, error)
- func (p *Persister) GetRelationTuples(ctx context.Context, query *relationtuple.RelationQuery, ...) ([]*relationtuple.InternalRelationTuple, string, error)
- func (p *Persister) InsertRelationTuple(ctx context.Context, rel *relationtuple.InternalRelationTuple) error
- func (p *Persister) NetworkID(_ context.Context) uuid.UUID
- func (p *Persister) QueryWithNetwork(ctx context.Context) *pop.Query
- func (p *Persister) TransactRelationTuples(ctx context.Context, ins []*relationtuple.InternalRelationTuple, ...) error
- func (p *Persister) Transaction(ctx context.Context, f func(ctx context.Context, c *pop.Connection) error) error
- func (p *Persister) WriteRelationTuples(ctx context.Context, rs ...*relationtuple.InternalRelationTuple) error
- type RelationTuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMigrationBox ¶
Types ¶
type Persister ¶
type Persister struct {
// contains filtered or unexported fields
}
func (*Persister) Connection ¶
func (*Persister) CreateWithNetwork ¶
func (*Persister) DeleteAllRelationTuples ¶
func (p *Persister) DeleteAllRelationTuples(ctx context.Context, query *relationtuple.RelationQuery) error
func (*Persister) DeleteRelationTuples ¶
func (p *Persister) DeleteRelationTuples(ctx context.Context, rs ...*relationtuple.InternalRelationTuple) error
func (*Persister) GetNamespaceByID ¶
func (*Persister) GetNamespaceByName ¶
func (*Persister) GetRelationTuples ¶
func (p *Persister) GetRelationTuples(ctx context.Context, query *relationtuple.RelationQuery, options ...x.PaginationOptionSetter) ([]*relationtuple.InternalRelationTuple, string, error)
func (*Persister) InsertRelationTuple ¶
func (p *Persister) InsertRelationTuple(ctx context.Context, rel *relationtuple.InternalRelationTuple) error
func (*Persister) QueryWithNetwork ¶
func (*Persister) TransactRelationTuples ¶
func (p *Persister) TransactRelationTuples(ctx context.Context, ins []*relationtuple.InternalRelationTuple, del []*relationtuple.InternalRelationTuple) error
func (*Persister) Transaction ¶
func (*Persister) WriteRelationTuples ¶
func (p *Persister) WriteRelationTuples(ctx context.Context, rs ...*relationtuple.InternalRelationTuple) 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"` NamespaceID int32 `db:"namespace_id"` Object string `db:"object"` Relation string `db:"relation"` SubjectID sql.NullString `db:"subject_id"` SubjectSetNamespaceID sql.NullInt32 `db:"subject_set_namespace_id"` SubjectSetObject sql.NullString `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.InternalRelationTuple) error
Click to show internal directories.
Click to hide internal directories.