Skip to content

Commit

Permalink
Add wrapperspb
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 committed Aug 27, 2022
1 parent f0896d1 commit 5ecac57
Show file tree
Hide file tree
Showing 4 changed files with 1,627 additions and 0 deletions.
51 changes: 51 additions & 0 deletions types/known/wrapperspb/wrappers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// Copyright 2022 Teppei Fukuda. All rights reserved.
// https://developers.google.com/protocol-buffers/

package wrapperspb

// Double stores v in a new DoubleValue and returns a pointer to it.
func Double(v float64) *DoubleValue {
return &DoubleValue{Value: v}
}

// Float stores v in a new FloatValue and returns a pointer to it.
func Float(v float32) *FloatValue {
return &FloatValue{Value: v}
}

// Int64 stores v in a new Int64Value and returns a pointer to it.
func Int64(v int64) *Int64Value {
return &Int64Value{Value: v}
}

// UInt64 stores v in a new UInt64Value and returns a pointer to it.
func UInt64(v uint64) *UInt64Value {
return &UInt64Value{Value: v}
}

// Int32 stores v in a new Int32Value and returns a pointer to it.
func Int32(v int32) *Int32Value {
return &Int32Value{Value: v}
}

// UInt32 stores v in a new UInt32Value and returns a pointer to it.
func UInt32(v uint32) *UInt32Value {
return &UInt32Value{Value: v}
}

// Bool stores v in a new BoolValue and returns a pointer to it.
func Bool(v bool) *BoolValue {
return &BoolValue{Value: v}
}

// String stores v in a new StringValue and returns a pointer to it.
func String(v string) *StringValue {
return &StringValue{Value: v}
}

// Bytes stores v in a new BytesValue and returns a pointer to it.
func Bytes(v []byte) *BytesValue {
return &BytesValue{Value: v}
}
231 changes: 231 additions & 0 deletions types/known/wrapperspb/wrappers.pb.go

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

82 changes: 82 additions & 0 deletions types/known/wrapperspb/wrappers.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// Copyright 2008 Teppei Fukuda. All rights reserved.
// https://developers.google.com/protocol-buffers/

syntax = "proto3";

package google.protobuf;

option go_package = "github.com/knqyf263/go-plugin/types/known/wrapperspb";

// Wrapper message for `double`.
//
// The JSON representation for `DoubleValue` is JSON number.
message DoubleValue {
// The double value.
double value = 1;
}

// Wrapper message for `float`.
//
// The JSON representation for `FloatValue` is JSON number.
message FloatValue {
// The float value.
float value = 1;
}

// Wrapper message for `int64`.
//
// The JSON representation for `Int64Value` is JSON string.
message Int64Value {
// The int64 value.
int64 value = 1;
}

// Wrapper message for `uint64`.
//
// The JSON representation for `UInt64Value` is JSON string.
message UInt64Value {
// The uint64 value.
uint64 value = 1;
}

// Wrapper message for `int32`.
//
// The JSON representation for `Int32Value` is JSON number.
message Int32Value {
// The int32 value.
int32 value = 1;
}

// Wrapper message for `uint32`.
//
// The JSON representation for `UInt32Value` is JSON number.
message UInt32Value {
// The uint32 value.
uint32 value = 1;
}

// Wrapper message for `bool`.
//
// The JSON representation for `BoolValue` is JSON `true` and `false`.
message BoolValue {
// The bool value.
bool value = 1;
}

// Wrapper message for `string`.
//
// The JSON representation for `StringValue` is JSON string.
message StringValue {
// The string value.
string value = 1;
}

// Wrapper message for `bytes`.
//
// The JSON representation for `BytesValue` is JSON string.
message BytesValue {
// The bytes value.
bytes value = 1;
}
Loading

0 comments on commit 5ecac57

Please sign in to comment.