add variable and method comments
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user