github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/pkg/tuple/proto_interface.go (about) 1 package tuple 2 3 import "google.golang.org/protobuf/types/known/structpb" 4 5 type objectReference interface { 6 GetObjectType() string 7 GetObjectId() string 8 } 9 10 type subjectReference[T objectReference] interface { 11 GetOptionalRelation() string 12 GetObject() T 13 } 14 15 type caveat interface { 16 GetCaveatName() string 17 GetContext() *structpb.Struct 18 } 19 20 type relationship[R objectReference, S subjectReference[R], C caveat] interface { 21 Validate() error 22 GetResource() R 23 GetRelation() string 24 GetSubject() S 25 GetOptionalCaveat() C 26 }