本文整理汇总了Golang中code/google/com/p/goprotobuf/proto.UnmarshalJSONEnum函数的典型用法代码示例。如果您正苦于以下问题:Golang UnmarshalJSONEnum函数的具体用法?Golang UnmarshalJSONEnum怎么用?Golang UnmarshalJSONEnum使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UnmarshalJSONEnum函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: UnmarshalJSON
func (x *MyMessage_Color) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(MyMessage_Color_value, data, "MyMessage_Color")
if err != nil {
return err
}
*x = MyMessage_Color(value)
return nil
}
示例2: UnmarshalJSON
func (x *StringMaxLen) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(StringMaxLen_value, data, "StringMaxLen")
if err != nil {
return err
}
*x = StringMaxLen(value)
return nil
}
示例3: UnmarshalJSON
func (x *URLFetchRequest_RequestMethod) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(URLFetchRequest_RequestMethod_value, data, "URLFetchRequest_RequestMethod")
if err != nil {
return err
}
*x = URLFetchRequest_RequestMethod(value)
return nil
}
示例4: UnmarshalJSON
func (x *TaskState) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(TaskState_value, data, "TaskState")
if err != nil {
return err
}
*x = TaskState(value)
return nil
}
示例5: UnmarshalJSON
func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode")
if err != nil {
return err
}
*x = FileOptions_OptimizeMode(value)
return nil
}
示例6: UnmarshalJSON
func (x *msg_Cmd) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(msg_Cmd_value, data, "msg_Cmd")
if err != nil {
return err
}
*x = msg_Cmd(value)
return nil
}
示例7: UnmarshalJSON
func (x *response_Err) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(response_Err_value, data, "response_Err")
if err != nil {
return err
}
*x = response_Err(value)
return nil
}
示例8: UnmarshalJSON
func (x *Blob_CompressionInfo_CompressionType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(Blob_CompressionInfo_CompressionType_value, data, "Blob_CompressionInfo_CompressionType")
if err != nil {
return err
}
*x = Blob_CompressionInfo_CompressionType(value)
return nil
}
示例9: UnmarshalJSON
func (x *LS_UpdatePlayerCountResult_Result) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(LS_UpdatePlayerCountResult_Result_value, data, "LS_UpdatePlayerCountResult_Result")
if err != nil {
return err
}
*x = LS_UpdatePlayerCountResult_Result(value)
return nil
}
示例10: UnmarshalJSON
func (x *Header_MessageType) UnmarshalJSON(data []byte) error {
value, err := proto1.UnmarshalJSONEnum(Header_MessageType_value, data, "Header_MessageType")
if err != nil {
return err
}
*x = Header_MessageType(value)
return nil
}
示例11: UnmarshalJSON
func (x *Command) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(Command_value, data, "Command")
if err != nil {
return err
}
*x = Command(value)
return nil
}
示例12: UnmarshalJSON
func (x *Response_ErrorCode) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(Response_ErrorCode_value, data, "Response_ErrorCode")
if err != nil {
return err
}
*x = Response_ErrorCode(value)
return nil
}
示例13: UnmarshalJSON
func (x *Operation_Type) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(Operation_Type_value, data, "Operation_Type")
if err != nil {
return err
}
*x = Operation_Type(value)
return nil
}