add variable and method comments

This commit is contained in:
Mike Mason
2023-07-17 19:02:55 +00:00
parent 2681b3d064
commit bc87fa7726
35 changed files with 157 additions and 16 deletions

View File

@@ -5,16 +5,22 @@ import (
)
const (
RelateOwner RelationshipType = "owner"
// 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
@@ -23,11 +29,13 @@ type Relationships struct {
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