-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip that works, committing in case I f it up
- Loading branch information
1 parent
242be79
commit a0ed603
Showing
11 changed files
with
108 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
use Mix.Config | ||
|
||
config :protobuf, extensions: :enabled | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
defmodule Brex.Elixir.FieldOptions do | ||
@moduledoc false | ||
use Protobuf, syntax: :proto2 | ||
|
||
@type t :: %__MODULE__{ | ||
extype: String.t() | ||
} | ||
defstruct [:extype] | ||
|
||
field :extype, 1, optional: true, type: :string | ||
end | ||
|
||
defmodule Brex.Elixir.PbExtension do | ||
@moduledoc false | ||
use Protobuf, syntax: :proto2 | ||
|
||
extend Google.Protobuf.FieldOptions, :field, 65_007, | ||
optional: true, | ||
type: Brex.Elixir.FieldOptions | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
syntax = "proto2"; | ||
|
||
// we should call just elixirpb and merge with Tony's | ||
// https://github.com/tony612/protobuf-elixir/blob/e1d4a23baa1f51c2da58db24f58a26dc4d6511b2/src/elixirpb.proto | ||
package brex.elixir; | ||
|
||
import "google/protobuf/descriptor.proto"; | ||
|
||
// Define an extension to specify the elixir type generated for the given field. | ||
|
||
// Field level options | ||
// | ||
// For example, | ||
// google.protobuf.StringValue my_string = 1 [(brex.elixirpb.field).extype="String.t"]; | ||
|
||
message FieldOptions { | ||
// Specify an elixir type to generate for this field. This will override usual type. | ||
optional string extype = 1; | ||
} | ||
|
||
extend google.protobuf.FieldOptions { | ||
// number to change | ||
optional FieldOptions field = 65007; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,4 @@ message FileOptions { | |
extend google.protobuf.FileOptions { | ||
optional FileOptions file = 1047; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters