2017-06-14 05:22:37 +02:00
|
|
|
package typedeclall
|
|
|
|
|
2017-12-29 12:38:00 +01:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
|
|
|
|
"github.com/gogo/protobuf/jsonpb"
|
|
|
|
)
|
|
|
|
|
2017-06-14 05:22:37 +02:00
|
|
|
type Dropped struct {
|
|
|
|
Name string
|
|
|
|
Age int32
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Dropped) Drop() bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2017-12-29 12:38:00 +01:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2017-06-14 05:22:37 +02:00
|
|
|
type DroppedWithoutGetters struct {
|
|
|
|
Width int64
|
|
|
|
Height int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *DroppedWithoutGetters) GetHeight() int64 {
|
|
|
|
return d.Height
|
|
|
|
}
|
2017-12-29 12:38:00 +01:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|