本文整理匯總了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
}