status-go/protocol/protobuf/service.go

18 lines
571 B
Go
Raw Normal View History

package protobuf
import (
"github.com/golang/protobuf/proto"
)
2020-10-02 14:43:43 +00:00
//go:generate protoc --go_out=. ./chat_message.proto ./application_metadata_message.proto ./membership_update_message.proto ./command.proto ./contact.proto ./pairing.proto ./push_notifications.proto ./emoji_reaction.proto ./enums.proto ./group_chat_invitation.proto ./chat_identity.proto
func Unmarshal(payload []byte) (*ApplicationMetadataMessage, error) {
var message ApplicationMetadataMessage
err := proto.Unmarshal(payload, &message)
if err != nil {
return nil, err
}
return &message, nil
}