Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ Date format: `YYYY-MM-DD`

---

## [1.56.0] - 2025-12-29

### Added
### Changed
- **risk:** Refactored structure to avoid naming collisions when vendored by consumers.
- **debt:** Buf is now used for linting and code generation.

### Deprecated
### Removed
### Fixed
### Security

---

## [1.55.0] - 2025-12-13

### Added
Expand Down Expand Up @@ -421,7 +435,8 @@ Date format: `YYYY-MM-DD`
### Fixed
### Security

[Unreleased]: https://github.com/sixafter/types/compare/v1.55.0...HEAD
[Unreleased]: https://github.com/sixafter/types/compare/v1.56.0...HEAD
[1.56.0]: https://github.com/sixafter/types/compare/v1.55.0...v1.56.0
[1.55.0]: https://github.com/sixafter/types/compare/v1.54.0...v1.55.0
[1.54.0]: https://github.com/sixafter/types/compare/v1.53.0...v1.54.0
[1.53.0]: https://github.com/sixafter/types/compare/v1.52.0...v1.53.0
Expand Down
30 changes: 26 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ FUZZTIME ?= 20s

export BINARY_NAME=main.out

.PHONY: build
build: ## Build the binary file
@sbin/go-build.sh
.PHONY: all
all: deps tidy vendor clean proto-generate test fmt ## Run all the targets

.PHONY: test
test: ## Execute unit tests
Expand Down Expand Up @@ -60,7 +59,7 @@ deps: ## Get the dependencies and vendor

.PHONY: fmt
fmt: ## Format the files
$(GO_FMT) ./..
$(GO_FMT) ./...

.PHONY: vet
vet: ## Vet the files
Expand Down Expand Up @@ -102,6 +101,29 @@ mod-verify: ## Verify Go module integrity
signature-verify: ## Verify latest release's digital signatures
@sbin/verify-sig.sh

# ---------------------------------------------------------------------------
# Protobuf Operations
# ---------------------------------------------------------------------------
.PHONY: proto-format
proto-format: ## buf format -w (writes canonical formatting)
@sbin/proto-format.sh

.PHONY: proto-lint
proto-lint: ## buf lint (style & sanity checks)
@sbin/proto-lint.sh

.PHONY: proto-breaking
proto-breaking: ## buf breaking --against $(BUF_BREAK_AGAINST)
@sbin/proto-breaking.sh

.PHONY: proto-generate
proto-generate: ## buf generate (no-op if buf.gen.yaml absent)
@sbin/proto-generate.sh

.PHONY: proto-docs
proto-docs: ## Generate SDK documentation from protobuf files
@sbin/proto-docs.sh

.PHONY: help
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | sort
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ This module is a set of common types expressed as [Google Protocol Buffers](http
To verify the integrity of the `types` source, run the following commands:

```sh
# Fetch the latest release tag from GitHub API (e.g., "v1.52.0")
# Fetch the latest release tag from GitHub API (e.g., "v1.56.0")
TAG=$(curl -s https://api.github.com/repos/sixafter/types/releases/latest | jq -r .tag_name)

# Remove the leading "v" for filenames (e.g., "v1.52.0" -> "1.52.0")
# Remove the leading "v" for filenames (e.g., "v1.56.0" -> "1.56.0")
VERSION=${TAG#v}

# ---------------------------------------------------------------------
Expand Down Expand Up @@ -82,7 +82,7 @@ Verified OK
To use this module, execute the following command:

```shell
go get -u github.com/sixafter/types
go get -u github.com/sixafter/types/sixafter/types
```

In your Go code, you can import the module as follows.
Expand All @@ -91,7 +91,7 @@ In your Go code, you can import the module as follows.
package main

import (
"github.com/sixafter/types"
pb "github.com/sixafter/types/proto/v1/pb"
)
```

Expand Down
55 changes: 55 additions & 0 deletions buf.gen.docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 2020-2025 SIX AFTER, INC (SIX AFTER)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Ref: https://buf.build/docs/configuration/v2/buf-gen-yaml/
version: v2

# 'clean', when set to true, deletes the directories, zip files, and/or jar files specified in the
# `out` field for all plugins before running code generation.
clean: false

# 'managed' contains the configuration for managed mode: https://buf.build/docs/generate/managed-mode
# It has three top-level keys: 'enabled', 'disable', and 'override'.
#
# When managed mode is enabled, it uses default values for certain file and field options during code
# generation. Options, accepted values, and defaults are documented here:
# https://buf.build/docs/generate/managed-mode#default-behavior
# The 'disable' key configures modules, paths, fields, and/or options that are excluded from managed
# mode's behavior. The 'override' key configures field and file option values that override the
# default values managed mode uses during code generation.
#
# In the case of options that combine with other options (for example java_package + java_package_prefix
# + java_package_suffix), they're all applied if possible. If not (for example when all three are set)
# then the last configuration rule wins.
managed:
# 'enabled: true' turns managed mode on, 'enabled: false' ignores all managed mode options.
# default: false
enabled: false

# Only generate code for your service’s protos
inputs:
- directory: proto/v1

plugins:
# Docs (HTML)
- local: protoc-gen-doc
out: docs/sdk/_generated/html
opt:
- html,index.html

# Docs (Markdown)
- local: protoc-gen-doc
out: docs/sdk/_generated/markdown
opt:
- markdown,README.md
55 changes: 55 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright 2020-2025 SIX AFTER, INC (SIX AFTER)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Ref: https://buf.build/docs/configuration/v2/buf-gen-yaml/
version: v2

# 'clean', when set to true, deletes the directories, zip files, and/or jar files specified in the
# `out` field for all plugins before running code generation.
clean: false

# 'managed' contains the configuration for managed mode: https://buf.build/docs/generate/managed-mode
# It has three top-level keys: 'enabled', 'disable', and 'override'.
#
# When managed mode is enabled, it uses default values for certain file and field options during code
# generation. Options, accepted values, and defaults are documented here:
# https://buf.build/docs/generate/managed-mode#default-behavior
# The 'disable' key configures modules, paths, fields, and/or options that are excluded from managed
# mode's behavior. The 'override' key configures field and file option values that override the
# default values managed mode uses during code generation.
#
# In the case of options that combine with other options (for example java_package + java_package_prefix
# + java_package_suffix), they're all applied if possible. If not (for example when all three are set)
# then the last configuration rule wins.
managed:
# 'enabled: true' turns managed mode on, 'enabled: false' ignores all managed mode options.
# default: false
enabled: false

# Only generate code for your service's protos
inputs:
- directory: proto/v1

plugins:
# Go models + gRPC
- local: protoc-gen-go
out: proto/v1/pb
opt:
- paths=source_relative

- local: protoc-gen-go-grpc
out: proto/v1/pb
opt:
- paths=source_relative
- require_unimplemented_servers=false
42 changes: 42 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2020-2025 SIX AFTER, INC (SIX AFTER)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# ref: https://buf.build/docs/configuration/v2/buf-yaml/
version: v2

# Define the module for this proto package
modules:
- path: proto/v1
lint:
use: [STANDARD]
except:
- PACKAGE_DIRECTORY_MATCH
breaking:
use: [FILE]
# - path: vendor/github.com/otherorg/otherpackage
# lint:
# disable_builtin: true
# use: []
# breaking:
# disable_builtin: true
# use: []

# Default lint/breaking for modules that don't override them.
lint:
use:
- STANDARD

breaking:
use:
- FILE
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,22 @@

syntax = "proto3";

package sixafter.types;
package proto.v1;

option go_package="github.com/sixafter/types/sixafter/types;types";
import "google/protobuf/timestamp.proto";

option cc_enable_arenas = true;
option java_package = "com.sixafter.types";
option csharp_namespace = "SixAfter.Types.V1.WellKnownTypes";
option go_package = "github.com/sixafter/types/proto/v1/pb;types";
option java_multiple_files = true;
option java_outer_classname = "CompassHeadingProto";
option java_package = "com.sixafter.types.v1";
option objc_class_prefix = "TPB";
option csharp_namespace = "SixAfter.Types.WellKnownTypes";

import "google/protobuf/timestamp.proto";

// The `CompassHeading` message represents the orientation of an object
// in the Compass Geodetic System (CGS). This can be used in geolocation
// systems, navigation tools, or applications requiring orientation data.
message CompassHeading {

// The heading (measured in degrees) relative to magnetic north.
// Values range from 0 to 360, where 0 indicates north, 90 indicates east,
// 180 indicates south, and 270 indicates west.
Expand Down
11 changes: 5 additions & 6 deletions sixafter/types/country.proto → proto/v1/country.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@
// See the License for the specific language governing permissions and
// limitations under the License.

syntax="proto3";
syntax = "proto3";

package sixafter.types;
package proto.v1;

option go_package="github.com/sixafter/types/sixafter/types;types";
option cc_enable_arenas = true;
option java_package = "com.sixafter.types";
option csharp_namespace = "SixAfter.Types.V1.WellKnownTypes";
option go_package = "github.com/sixafter/types/proto/v1/pb;types";
option java_multiple_files = true;
option java_outer_classname = "CountryProto";
option java_package = "com.sixafter.types.v1";
option objc_class_prefix = "TPB";
option csharp_namespace = "SixAfter.Types.WellKnownTypes";

// The `Country` message represents a country as defined by the ISO-3166-1 standard.
// It is commonly used for internationalization, geolocation, and regulatory purposes.
message Country {

// The commonly used name of the country.
// Example: "United States".
string name = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

syntax="proto3";
syntax = "proto3";

package sixafter.types;
package proto.v1;

import "country.proto";

option go_package="github.com/sixafter/types/sixafter/types;types";
option cc_enable_arenas = true;
option java_package = "com.sixafter.types";
option csharp_namespace = "SixAfter.Types.V1.WellKnownTypes";
option go_package = "github.com/sixafter/types/proto/v1/pb;types";
option java_multiple_files = true;
option java_outer_classname = "CountrySubdivisionProto";
option java_package = "com.sixafter.types.v1";
option objc_class_prefix = "TPB";
option csharp_namespace = "SixAfter.Types.WellKnownTypes";

import "sixafter/types/country.proto";

// The `CountrySubdivision` message represents a subdivision of a country,
// such as a state, province, or territory, as defined by the ISO-3166-2 standard.
Expand All @@ -43,5 +43,5 @@ message CountrySubdivision {
string code = 2;

// The country to which this subdivision belongs.
sixafter.types.Country country = 3;
proto.v1.Country country = 3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.

syntax="proto3";
syntax = "proto3";

package sixafter.types;
package proto.v1;

option go_package="github.com/sixafter/types/sixafter/types;types";
option cc_enable_arenas = true;
option java_package = "com.sixafter.types";
option csharp_namespace = "SixAfter.Types.V1.WellKnownTypes";
option go_package = "github.com/sixafter/types/proto/v1/pb;types";
option java_multiple_files = true;
option java_outer_classname = "EmailAddressProto";
option java_package = "com.sixafter.types.v1";
option objc_class_prefix = "TPB";
option csharp_namespace = "SixAfter.Types.WellKnownTypes";

// The `EmailAddress` message represents an electronic mail (email) address
// as defined by RFC 5322. It separates the email address into its two main
// components: the local part and the domain part.
message EmailAddress {

// The local part of the email address.
// This is the portion of the address before the "@" symbol.
// Example: "john.doe" in the email address "john.doe@example.com".
Expand Down
Loading