Documentation ¶
Index ¶
- Variables
- func Load(ctx context.Context, storage zanzigo.Storage) error
- func RunBenchmark(b *testing.B, storage zanzigo.Storage)
- func RunBenchmarkAll(b *testing.B, storages map[string]zanzigo.Storage)
- func RunTest(t *testing.T, storage zanzigo.Storage, expectations Expectations)
- func RunTestAll(t *testing.T, configs map[string]TestConfig)
- type Expectations
- type TestConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Model = func() *zanzigo.Model { model, err := zanzigo.NewModel(zanzigo.ObjectMap{ "user": zanzigo.RelationMap{}, "group": zanzigo.RelationMap{ "member": zanzigo.Rule{}, }, "folder": zanzigo.RelationMap{ "owner": zanzigo.Rule{}, "editor": zanzigo.Rule{ InheritIf: "owner", }, "viewer": zanzigo.Rule{ InheritIf: "editor", }, }, "doc": zanzigo.RelationMap{ "parent": zanzigo.Rule{}, "owner": zanzigo.Rule{ InheritIf: "owner", OfType: "folder", WithRelation: "parent", }, "editor": zanzigo.AnyOf( zanzigo.Rule{InheritIf: "owner"}, zanzigo.Rule{ InheritIf: "editor", OfType: "folder", WithRelation: "parent", }, ), "viewer": zanzigo.AnyOf( zanzigo.Rule{InheritIf: "editor"}, zanzigo.Rule{ InheritIf: "viewer", OfType: "folder", WithRelation: "parent", }, ), }, }) if err != nil { log.Fatalf("Expected storage.Write not to fail: %v", err) } return model }()
Functions ¶
func RunTestAll ¶
func RunTestAll(t *testing.T, configs map[string]TestConfig)
Types ¶
type Expectations ¶
type Expectations struct {
UserdataCheckQueryTuple zanzigo.MarkedTuple
}
type TestConfig ¶
type TestConfig struct { Storage zanzigo.Storage Expectations Expectations }
Click to show internal directories.
Click to hide internal directories.