Skip to content

Commit

Permalink
Release V10
Browse files Browse the repository at this point in the history
  • Loading branch information
actgardner committed Oct 11, 2021
1 parent cb870fb commit 10f387c
Show file tree
Hide file tree
Showing 490 changed files with 1,197 additions and 1,197 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![CircleCI](https://circleci.com/gh/actgardner/gogen-avro/tree/master.svg?style=svg)](https://circleci.com/gh/actgardner/gogen-avro/tree/master)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/actgardner/gogen-avro/master/LICENSE)
[![Version 9.0.0](https://img.shields.io/badge/version-9.0.0-lightgrey.svg)](https://github.com/actgardner/gogen-avro/releases)
[![Version 10.0.0](https://img.shields.io/badge/version-10.0.0-lightgrey.svg)](https://github.com/actgardner/gogen-avro/releases)

Generates type-safe Go code based on your Avro schemas, including serializers and deserializers that support Avro's schema evolution rules.
Also supports deserializing generic Avro data (in beta).
Expand Down Expand Up @@ -34,7 +34,7 @@ gogen-avro has two parts: a tool which you install on your system (usually on yo
To generate structs, install the command-line tool (this isn't necessary for the generic package):

```
go get github.com/actgardner/gogen-avro/v9/cmd/...
go get github.com/actgardner/gogen-avro/v10/cmd/...
```

This will put the `gogen-avro` binary in `$GOPATH/bin`, which should be part of your PATH.
Expand All @@ -46,7 +46,7 @@ _Note: Generic data is support is currently beta. Please report any issues or fe
To deserialize generic Avro data into Go structs without generating code, instantiate a new `generic.Codec` with the reader and writer schemas:

```
import "github.com/actgardner/gogen-avro/v9/generic"
import "github.com/actgardner/gogen-avro/v10/generic"
codec, err := NewCodecFromSchema(writerSchema, readerSchema) // writerSchema and readerSchema may be the same schema if you're not dealing with evolution
datum, err := codec.Deserialize(r) // r is an io.Reader with the Avro-encoded bytes
Expand All @@ -60,7 +60,7 @@ To generate Go source files from one or more Avro schema files, run:
gogen-avro [--containers=false] [--sources-comment=false] [--short-unions=false] [--package=<package name>] <output directory> <avro schema files>
```

You can also use a `go:generate` directive in a source file ([example](https://github.com/actgardner/gogen-avro/blob/master/v9/test/primitive/generate.go#L3)):
You can also use a `go:generate` directive in a source file ([example](https://github.com/actgardner/gogen-avro/blob/master/v10/test/primitive/generate.go#L3)):

```
//go:generate $GOPATH/bin/gogen-avro . primitives.avsc
Expand All @@ -87,27 +87,27 @@ Read Avro data from the given `io.Reader` and deserialize it into the generated

### Working with Object Container Files (OCF)

An example of how to write a container file can be found in [example/container/example.go](https://github.com/actgardner/gogen-avro/blob/master/v9/example/container/example.go).
An example of how to write a container file can be found in [example/container/example.go](https://github.com/actgardner/gogen-avro/blob/master/v10/example/container/example.go).

[Godocs for the container package](https://godoc.org/github.com/actgardner/gogen-avro/v9/container)
[Godocs for the container package](https://godoc.org/github.com/actgardner/gogen-avro/v10/container)

### Single-Object Encoding

An example of how to read and write Single-Object encoded messages (for use with Kafka, for instance) can be found in [example/single_object/example.go](https://github.com/actgardner/gogen-avro/blob/master/v9/example/single_object/example.go).
An example of how to read and write Single-Object encoded messages (for use with Kafka, for instance) can be found in [example/single_object/example.go](https://github.com/actgardner/gogen-avro/blob/master/v10/example/single_object/example.go).

[Godocs for the soe package](https://godoc.org/github.com/actgardner/gogen-avro/v9/soe)
[Godocs for the soe package](https://godoc.org/github.com/actgardner/gogen-avro/v10/soe)

### Examples

The `example` directory contains simple example projects with an Avro schema. Once you've installed the CLI tool you can install the example projects:

```
# Build the Go source files from the Avro schema using the generate directive
go generate github.com/actgardner/gogen-avro/v9/example
go generate github.com/actgardner/gogen-avro/v10/example
# Install the example projects on the GOPATH
go install github.com/actgardner/gogen-avro/v9/example/record
go install github.com/actgardner/gogen-avro/v9/example/container
go install github.com/actgardner/gogen-avro/v10/example/record
go install github.com/actgardner/gogen-avro/v10/example/container
```

### Naming
Expand Down Expand Up @@ -181,7 +181,7 @@ When reporting issues, please include your reader and writer schemas, and the ou

```
import (
"github.com/actgardner/gogen-avro/v9/compiler"
"github.com/actgardner/gogen-avro/v10/compiler"
)
func init() {
Expand Down
Binary file added v10/benchmark.test
Binary file not shown.
File renamed without changes.
10 changes: 5 additions & 5 deletions v9/cmd/gogen-avro/main.go → v10/cmd/gogen-avro/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
"path/filepath"
"strings"

"github.com/actgardner/gogen-avro/v9/generator"
"github.com/actgardner/gogen-avro/v9/generator/flat"
"github.com/actgardner/gogen-avro/v9/parser"
"github.com/actgardner/gogen-avro/v9/resolver"
"github.com/actgardner/gogen-avro/v10/generator"
"github.com/actgardner/gogen-avro/v10/generator/flat"
"github.com/actgardner/gogen-avro/v10/parser"
"github.com/actgardner/gogen-avro/v10/resolver"
)

const fileComment = "// Code generated by github.com/actgardner/gogen-avro/v8. DO NOT EDIT."
const fileComment = "// Code generated by github.com/actgardner/gogen-avro/v10. DO NOT EDIT."

func main() {
cfg := parseCmdLine()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ func TestCodegenComment(t *testing.T) {
sourcesComment bool
out string
}{
{[]string{"file_1.avsc", "file_2.avsc"}, true, `// Code generated by github.com/actgardner/gogen-avro/v8. DO NOT EDIT.
{[]string{"file_1.avsc", "file_2.avsc"}, true, `// Code generated by github.com/actgardner/gogen-avro/v10. DO NOT EDIT.
/*
* SOURCES:
* file_1.avsc
* file_2.avsc
*/`},
{[]string{"file_1.avsc"}, true, `// Code generated by github.com/actgardner/gogen-avro/v8. DO NOT EDIT.
{[]string{"file_1.avsc"}, true, `// Code generated by github.com/actgardner/gogen-avro/v10. DO NOT EDIT.
/*
* SOURCE:
* file_1.avsc
*/`},
{[]string{"file_1.avsc", "file_2.avsc"}, false, `// Code generated by github.com/actgardner/gogen-avro/v8. DO NOT EDIT.`},
{[]string{"file_1.avsc", "file_2.avsc"}, false, `// Code generated by github.com/actgardner/gogen-avro/v10. DO NOT EDIT.`},
}

for _, tc := range tt {
Expand Down
8 changes: 4 additions & 4 deletions v9/compiler/compile.go → v10/compiler/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
package compiler

import (
"github.com/actgardner/gogen-avro/v9/parser"
"github.com/actgardner/gogen-avro/v9/resolver"
"github.com/actgardner/gogen-avro/v9/schema"
"github.com/actgardner/gogen-avro/v9/vm"
"github.com/actgardner/gogen-avro/v10/parser"
"github.com/actgardner/gogen-avro/v10/resolver"
"github.com/actgardner/gogen-avro/v10/schema"
"github.com/actgardner/gogen-avro/v10/vm"
)

// Given two Avro schemas, compile them into a program which can read the data
Expand Down
2 changes: 1 addition & 1 deletion v9/compiler/instruction.go → v10/compiler/instruction.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package compiler
import (
"fmt"

"github.com/actgardner/gogen-avro/v9/vm"
"github.com/actgardner/gogen-avro/v10/vm"
)

type irInstruction interface {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions v9/compiler/method.go → v10/compiler/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package compiler
import (
"fmt"

"github.com/actgardner/gogen-avro/v9/schema"
"github.com/actgardner/gogen-avro/v9/vm"
"github.com/actgardner/gogen-avro/v10/schema"
"github.com/actgardner/gogen-avro/v10/vm"
)

type irMethod struct {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion v9/compiler/program.go → v10/compiler/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package compiler
import (
"fmt"

"github.com/actgardner/gogen-avro/v9/vm"
"github.com/actgardner/gogen-avro/v10/vm"
)

// Build an intermediate representation of the program where
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
6 changes: 3 additions & 3 deletions v9/container/avro/bytes.go → v10/container/avro/bytes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions v9/container/avro/magic.go → v10/container/avro/magic.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions v9/container/avro/sync.go → v10/container/avro/sync.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions v9/container/reader.go → v10/container/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/golang/snappy"

"github.com/actgardner/gogen-avro/v9/container/avro"
"github.com/actgardner/gogen-avro/v9/schema"
"github.com/actgardner/gogen-avro/v10/container/avro"
"github.com/actgardner/gogen-avro/v10/schema"
)

// Reader is a low-level primitive for reading the OCF framing of a file.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion v9/container/writer.go → v10/container/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"compress/flate"
"io"

"github.com/actgardner/gogen-avro/v9/container/avro"
"github.com/actgardner/gogen-avro/v10/container/avro"
)

// A Codec specifies how the blocks within a container file should be compressed.
Expand Down
Binary file added v10/cpu.pprof
Binary file not shown.
6 changes: 3 additions & 3 deletions v9/example/avro/bytes.go → v10/example/avro/bytes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"io"
"os"

"github.com/actgardner/gogen-avro/v9/container"
"github.com/actgardner/gogen-avro/v9/example/avro"
"github.com/actgardner/gogen-avro/v10/container"
"github.com/actgardner/gogen-avro/v10/example/avro"
)

func main() {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"bytes"
"fmt"

"github.com/actgardner/gogen-avro/v9/example/avro"
"github.com/actgardner/gogen-avro/v10/example/avro"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"reflect"

"github.com/actgardner/gogen-avro/v9/example/avro"
"github.com/actgardner/gogen-avro/v9/soe"
"github.com/actgardner/gogen-avro/v10/example/avro"
"github.com/actgardner/gogen-avro/v10/soe"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package flat

import (
"github.com/actgardner/gogen-avro/v9/generator"
"github.com/actgardner/gogen-avro/v9/generator/flat/templates"
avro "github.com/actgardner/gogen-avro/v9/schema"
"github.com/actgardner/gogen-avro/v10/generator"
"github.com/actgardner/gogen-avro/v10/generator/flat/templates"
avro "github.com/actgardner/gogen-avro/v10/schema"
)

// FlatPackageGenerator emits a file per generated type, all in a single Go package without handling namespacing
Expand Down
Loading

0 comments on commit 10f387c

Please sign in to comment.