Skip to content

Commit

Permalink
Merge pull request #111 from loopholelabs/staging
Browse files Browse the repository at this point in the history
Release v0.4.6
  • Loading branch information
ShivanshVij authored Apr 28, 2022
2 parents 452d626 + 665f1af commit fa0a4e3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 0.1
cli:
version: 0.10.1-beta
version: 0.11.0-beta
lint:
enabled:
- [email protected]
Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [v0.4.6] - 2022-04-28 (Beta)

## Fixes

- Fixing issue where generated `decode` functions for slices would not allocate the proper memory before decoding the slice values (Issue #108)

## Changes

- Updating Trunk Linter to `v0.11.0-beta`

## [v0.4.5] - 2022-04-22 (Beta)

## Fixes
Expand Down Expand Up @@ -247,7 +257,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Initial Release of Frisbee

[unreleased]: https://github.com/loopholelabs/frisbee/compare/v0.4.5...HEAD
[unreleased]: https://github.com/loopholelabs/frisbee/compare/v0.4.6...HEAD
[v0.4.6]: https://github.com/loopholelabs/frisbee/compare/v0.4.5...v0.4.6
[v0.4.5]: https://github.com/loopholelabs/frisbee/compare/v0.4.4...v0.4.5
[v0.4.4]: https://github.com/loopholelabs/frisbee/compare/v0.4.3...v0.4.4
[v0.4.3]: https://github.com/loopholelabs/frisbee/compare/v0.4.2...v0.4.3
Expand Down
4 changes: 2 additions & 2 deletions protoc-gen-frisbee/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM golang as builder

ENV GOOS=linux GOARCH=amd64 CGO_ENABLED=0

RUN go install github.com/loopholelabs/frisbee/[email protected].5
RUN go install github.com/loopholelabs/frisbee/[email protected].6

# Note, the Docker images must be built for amd64. If the host machine architecture is not amd64
# you need to cross-compile the binary and move it into /go/bin.
Expand All @@ -12,7 +12,7 @@ FROM scratch

# Runtime dependencies
LABEL "build.buf.plugins.runtime_library_versions.0.name"="github.com/loopholelabs/frisbee"
LABEL "build.buf.plugins.runtime_library_versions.0.version"="v0.4.5"
LABEL "build.buf.plugins.runtime_library_versions.0.version"="v0.4.6"

COPY --from=builder /go/bin /

Expand Down
5 changes: 5 additions & 0 deletions protoc-gen-frisbee/examples/simple/simple.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ message Request {

message Response{
string Message = 1;
}

message SliceResponse {
repeated Response ResponseSlice = 1;
map<string, Response> ResponseMap = 2;
}
3 changes: 3 additions & 0 deletions protoc-gen-frisbee/templates/decode.templ
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func (x *{{CamelCase .FullName}}) decode(d *packet.Decoder) error {
for i := uint32(0); i < sliceSize; i++ {
{{ $decoder := GetLUTDecoder $field.Kind -}}
{{ if eq $field.Kind 11 -}} {{/* protoreflect.MessageKind */ -}}
if x.{{ CamelCaseName $field.Name }}[i] == nil {
x.{{ CamelCaseName $field.Name }}[i] = New{{ CamelCase $field.Message.FullName }}()
}
err = x.{{ CamelCaseName $field.Name }}[i].decode(d)
{{ else -}}
x.{{ CamelCaseName $field.Name }}[i], err = d{{ $decoder }}()
Expand Down

0 comments on commit fa0a4e3

Please sign in to comment.