diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-24 16:59:43 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-24 16:59:43 -0600 |
| commit | a3496a1114c6958aa1831af5348d7340e29ebf06 (patch) | |
| tree | e467d6d54a4a16ac0002bad784b7c3a1dd9fe0bd /app/domain/entity.go | |
| parent | 0babaa518db6cbdc17779e9c4846a8a277d098b7 (diff) | |
refactor: delegate to GlobalID to provide object references
Diffstat (limited to 'app/domain/entity.go')
| -rw-r--r-- | app/domain/entity.go | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/app/domain/entity.go b/app/domain/entity.go index 4f3e63b..9cce1aa 100644 --- a/app/domain/entity.go +++ b/app/domain/entity.go @@ -2,8 +2,6 @@ package domain import ( "errors" - - v1 "github.com/authzed/authzed-go/proto/authzed/api/v1" ) type Entity interface { @@ -24,17 +22,10 @@ func (s *entity) SetID(id ID) error { return nil } -func (s *entity) ToGID() string { - return "gid://sparkle/Entity/" + s.ID.String() -} - -func (self *entity) ToObjectReference() *v1.ObjectReference { - return &v1.ObjectReference{ - ObjectType: "entity", - ObjectId: self.ID.String(), - } -} - func (s *entity) Validate() error { return errors.New("method Validate not implemented") } + +func (s *entity) ToGID() GlobalID { + return GlobalID("gid://sparkle/Entity/" + s.ID.String()) +} |
