Repository navigation
feat!: take a base Definition in objectidproto and cache definitions per type - #3
Merged
Merged
Conversation
Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Erik Nilsen <enilsen16@live.com>
…options Signed-off-by: Erik Nilsen <enilsen16@live.com>
…ition Signed-off-by: Erik Nilsen <enilsen16@live.com>
Signed-off-by: Erik Nilsen <enilsen16@live.com>
…options Signed-off-by: Erik Nilsen <enilsen16@live.com> # Conflicts: # objectid_test.go
enilsen16
marked this pull request as ready for review
October 22, 2026 14:30
…-options Signed-off-by: Erik Nilsen <enilsen16@live.com> # Conflicts: # objectid.go # objectid_test.go
…-options Signed-off-by: Erik Nilsen <enilsen16@live.com> # Conflicts: # objectid.go # objectid_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2.
Summary
objectidproto.Definition(enum, base)andMustDefinition(enum, base)readObjectTypeandSeparatorfrom the annotation over a baseDefinition. Each type is then one package-level variable, the same way the Elixiruse Trogon.ObjectId, proto: {...}, validate: :uuiddeclares it. A newDefinitionfield, such asAliasesin feat: accept earlier prefixes with Definition.Aliases #8, works with no change here. This breaks v0.1.0'sDefinition(enum).cache.go) stores each type's spec byreflect.Type, as a pointer, for both IDs and unions.Definitionmust return the same value every time, and the docs say so.ObjectTypeOf[T]()andPrefixOf[T]()read the type's object type and prefix without an ID. They are the Go form of the Elixir module functionsobject_type/0andprefix/0. TheIDmethods call them.Benchmarks (Apple M5 Max)
StringParseTests
The tests cover the base overlay, a check that
Definitionruns once acrossStringandParse, the type-level accessors, and the benchmarks. CI runs only on PRs tomain. Locally,go test -race,go vetand golangci-lint pass.