-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate deterministic Goa sample data
- Loading branch information
Showing
21 changed files
with
4,382 additions
and
835 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
$(call _assert_var,MAKEDIR) | ||
$(call _conditional_include,$(MAKEDIR)/base.mk) | ||
$(call _assert_var,UNAME_OS) | ||
$(call _assert_var,UNAME_ARCH) | ||
$(call _assert_var,CACHE_VERSIONS) | ||
$(call _assert_var,CACHE_BIN) | ||
|
||
JQ_VERSION ?= 1.6 | ||
|
||
ifeq ($(UNAME_OS),Darwin) | ||
JQ_OS := osx | ||
JQ_ARCH := -amd64 | ||
endif | ||
|
||
ifeq ($(UNAME_ARCH),x86_64) | ||
ifeq ($(UNAME_OS),Linux) | ||
JQ_OS := linux | ||
JQ_ARCH := 64 | ||
endif | ||
endif | ||
|
||
JQ := $(CACHE_VERSIONS)/jq/$(JQ_VERSION) | ||
$(JQ): | ||
@rm -f $(CACHE_BIN)/jq | ||
@mkdir -p $(CACHE_BIN) | ||
@curl -sSL \ | ||
https://github.com/stedolan/jq/releases/download/jq-$(JQ_VERSION)/jq-$(JQ_OS)$(JQ_ARCH) \ | ||
-o $(CACHE_BIN)/jq | ||
@chmod +x $(CACHE_BIN)/jq | ||
@rm -rf $(dir $(JQ)) | ||
@mkdir -p $(dir $(JQ)) | ||
@touch $(JQ) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// # UUID attributes | ||
// | ||
// Use [AttributeUUID] or [TypedAttributeUUID] to declare UUID attributes. | ||
// | ||
// These attributes produce consistent example UUIDs. | ||
package design | ||
|
||
import ( | ||
. "goa.design/goa/v3/dsl" | ||
) | ||
|
||
// AttributeUUID describes a string typed field that must be a valid UUID. | ||
// The desc is a short description of the field's purpose. | ||
// | ||
// AttributeUUID's example value is a deterministic UUID. | ||
func AttributeUUID(name, desc string) { | ||
Attribute(name, String, desc, func() { | ||
Format(FormatUUID) | ||
Example("d1845cb6-a5ea-474a-9ab8-26f9bcd919f5") | ||
}) | ||
} | ||
|
||
// TypedAttributeUUID describes a [uuid.UUID] typed field. The desc is a short | ||
// description of the field's purpose. | ||
// | ||
// TypedAttributeUUID's example value is a deterministic UUID. | ||
// | ||
// [uuid.UUID]: https://github.com/google/uuid | ||
func TypedAttributeUUID(name, desc string) { | ||
Attribute(name, String, desc, func() { | ||
Meta("struct:field:type", "uuid.UUID", "github.com/google/uuid") | ||
Example("d1845cb6-a5ea-474a-9ab8-26f9bcd919f5") | ||
}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.