2 Star 0 Fork 0

cockroachdb / gogoproto

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
models.go 753 Bytes
一键复制 编辑 原始数据 按行查看 历史
package typedecl
import (
"encoding/json"
"github.com/gogo/protobuf/jsonpb"
)
type Dropped struct {
Name string
Age int32
}
func (d *Dropped) Drop() bool {
return true
}
func (d *Dropped) UnmarshalJSONPB(u *jsonpb.Unmarshaler, b []byte) error {
return json.Unmarshal(b, d)
}
func (d *Dropped) MarshalJSONPB(*jsonpb.Marshaler) ([]byte, error) {
return json.Marshal(d)
}
type DroppedWithoutGetters struct {
Width int64
Height int64
}
func (d *DroppedWithoutGetters) GetHeight() int64 {
return d.Height
}
func (d *DroppedWithoutGetters) UnmarshalJSONPB(u *jsonpb.Unmarshaler, b []byte) error {
return json.Unmarshal(b, d)
}
func (d *DroppedWithoutGetters) MarshalJSONPB(*jsonpb.Marshaler) ([]byte, error) {
return json.Marshal(d)
}
1
https://gitee.com/mirrors_cockroachdb/gogoproto.git
git@gitee.com:mirrors_cockroachdb/gogoproto.git
mirrors_cockroachdb
gogoproto
gogoproto
v1.2.0

搜索帮助