Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Benchmark ¶
type Benchmark struct {
Name string
Tags []Tag
Setup func(ctx context.Context, ds datastore.Datastore) (*QuerySets, error)
}
Benchmark is a named scenario that can write its schema and data to a datastore and return sets of valid queries with expected results.
type CheckQuery ¶
type CheckQuery struct {
ResourceType string
ResourceID string
Permission string
SubjectType string
SubjectID string
SubjectRelation string
}
CheckQuery is a positive check query — the subject is expected to have the permission.
type IterResourcesQuery ¶
type IterResourcesQuery struct {
SubjectType string
SubjectID string
SubjectRelation string
Permission string
FilterResourceType string
ExpectedResourceIDs []string
}
IterResourcesQuery is an IterResources query with the full expected result set.
type IterSubjectsQuery ¶
type IterSubjectsQuery struct {
ResourceType string
ResourceID string
Permission string
FilterSubjectType string
ExpectedSubjectIDs []string
}
IterSubjectsQuery is an IterSubjects query with the full expected result set.
type QuerySets ¶
type QuerySets struct {
Checks []CheckQuery
IterResources []IterResourcesQuery
IterSubjects []IterSubjectsQuery
// MaxRecursionDepth, if > 0, should be passed to the query context.
// Zero means use the default.
MaxRecursionDepth int
}
QuerySets holds the sets of valid queries returned by a benchmark's Setup.
Click to show internal directories.
Click to hide internal directories.