package service import ( "go.infratographer.com/x/gidx" ) const ( // RelateOwner is the owner relationship type. RelateOwner RelationshipType = "owner" // RelateParent is the parent relationship type. RelateParent RelationshipType = "parent" ) // RelationshipType are relationship types. type RelationshipType string // IDPrefixableResource ensures the the interface passed provides prefixed ids. type IDPrefixableResource interface { PrefixedID() gidx.PrefixedID } // Relationships defines a resource and all possible relationships and memberships. type Relationships struct { Resource IDPrefixableResource Parent Relation SubjectRelation RelationshipType SubjectRelationships []Relation Memberships []ResourceMemberships } // Relation defines a relation to a resource. type Relation struct { Relation RelationshipType Resource IDPrefixableResource } // ResourceMemberships defines a member and role. type ResourceMemberships struct { Role string Member IDPrefixableResource }