storage

package
v0.0.0-...-1cdd71b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 Load

func Load(ctx context.Context, storage zanzigo.Storage) error

func RunBenchmark

func RunBenchmark(b *testing.B, storage zanzigo.Storage)

func RunBenchmarkAll

func RunBenchmarkAll(b *testing.B, storages map[string]zanzigo.Storage)

func RunTest

func RunTest(t *testing.T, storage zanzigo.Storage, expectations Expectations)

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL