Documentation
¶
Index ¶
- type BatchUpsertRelationshipsParams
- type CountGrantedObjectsParams
- type DBTX
- type DeleteRelationshipsParams
- type LookupRelationshipsByOrgParams
- type LookupRelationshipsByOrgRow
- type LookupRelationshipsBySubjectParams
- type Querier
- type Queries
- func (q *Queries) BatchUpsertRelationships(ctx context.Context, arg BatchUpsertRelationshipsParams) ([]Relationship, error)
- func (q *Queries) CountGrantedObjects(ctx context.Context, arg CountGrantedObjectsParams) (int64, error)
- func (q *Queries) DeleteRelationships(ctx context.Context, arg DeleteRelationshipsParams) error
- func (q *Queries) LookupRelationshipsByOrg(ctx context.Context, arg LookupRelationshipsByOrgParams) ([]LookupRelationshipsByOrgRow, error)
- func (q *Queries) LookupRelationshipsBySubject(ctx context.Context, arg LookupRelationshipsBySubjectParams) ([]Relationship, error)
- func (q *Queries) ReadRelationships(ctx context.Context, arg ReadRelationshipsParams) ([]Relationship, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type ReadRelationshipsParams
- type Relationship
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountGrantedObjectsParams ¶ added in v1.18.0
type DeleteRelationshipsParams ¶ added in v1.33.0
type LookupRelationshipsByOrgParams ¶ added in v1.27.0
type LookupRelationshipsByOrgRow ¶ added in v1.27.0
type LookupRelationshipsBySubjectParams ¶ added in v1.49.0
type Querier ¶
type Querier interface {
BatchUpsertRelationships(ctx context.Context, arg BatchUpsertRelationshipsParams) ([]Relationship, error)
CountGrantedObjects(ctx context.Context, arg CountGrantedObjectsParams) (int64, error)
DeleteRelationships(ctx context.Context, arg DeleteRelationshipsParams) error
// origin = 1 is relationships.v1.Origin ORIGIN_ORGANIZATION; org scoping is by
// the subject's local identity in that org.
//
// Both identities joins and the cursor assume one identities row per principal
// per org, which identity resolution guarantees today. Principals are moving to
// several identities per org; this query must change first (see the storage
// schema in docs/relationships-api.md, gitlab-org/gitlab#635812).
LookupRelationshipsByOrg(ctx context.Context, arg LookupRelationshipsByOrgParams) ([]LookupRelationshipsByOrgRow, error)
// edge_type = 1 plus the fixed subject means relationships_direct_grant_unique
// already makes (object, kind) unique per row, so role breaks no ties and is
// left out of the order/cursor (unlike LookupRelationshipsByOrg, which scans
// multiple subjects and does need it).
LookupRelationshipsBySubject(ctx context.Context, arg LookupRelationshipsBySubjectParams) ([]Relationship, error)
ReadRelationships(ctx context.Context, arg ReadRelationshipsParams) ([]Relationship, error)
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) BatchUpsertRelationships ¶
func (q *Queries) BatchUpsertRelationships(ctx context.Context, arg BatchUpsertRelationshipsParams) ([]Relationship, error)
func (*Queries) CountGrantedObjects ¶ added in v1.18.0
func (*Queries) DeleteRelationships ¶ added in v1.33.0
func (q *Queries) DeleteRelationships(ctx context.Context, arg DeleteRelationshipsParams) error
func (*Queries) LookupRelationshipsByOrg ¶ added in v1.27.0
func (q *Queries) LookupRelationshipsByOrg(ctx context.Context, arg LookupRelationshipsByOrgParams) ([]LookupRelationshipsByOrgRow, error)
origin = 1 is relationships.v1.Origin ORIGIN_ORGANIZATION; org scoping is by the subject's local identity in that org.
Both identities joins and the cursor assume one identities row per principal per org, which identity resolution guarantees today. Principals are moving to several identities per org; this query must change first (see the storage schema in docs/relationships-api.md, gitlab-org/gitlab#635812).
func (*Queries) LookupRelationshipsBySubject ¶ added in v1.49.0
func (q *Queries) LookupRelationshipsBySubject(ctx context.Context, arg LookupRelationshipsBySubjectParams) ([]Relationship, error)
edge_type = 1 plus the fixed subject means relationships_direct_grant_unique already makes (object, kind) unique per row, so role breaks no ties and is left out of the order/cursor (unlike LookupRelationshipsByOrg, which scans multiple subjects and does need it).
func (*Queries) ReadRelationships ¶ added in v1.16.0
func (q *Queries) ReadRelationships(ctx context.Context, arg ReadRelationshipsParams) ([]Relationship, error)