当前位置: 首页>>代码示例>>Golang>>正文


Golang Writer.WriteBool方法代码示例

本文整理汇总了Golang中github.com/tinylib/msgp/msgp.Writer.WriteBool方法的典型用法代码示例。如果您正苦于以下问题:Golang Writer.WriteBool方法的具体用法?Golang Writer.WriteBool怎么用?Golang Writer.WriteBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/tinylib/msgp/msgp.Writer的用法示例。


在下文中一共展示了Writer.WriteBool方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: EncodeMsg

// EncodeMsg implements msgp.Encodable
func (z *MethodT) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 6
	// write "MethodId"
	err = en.Append(0x86, 0xa8, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x49, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteInt64(z.MethodId)
	if err != nil {
		return
	}
	// write "Name"
	err = en.Append(0xa4, 0x4e, 0x61, 0x6d, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Name)
	if err != nil {
		return
	}
	// write "Inputs"
	err = en.Append(0xa6, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73)
	if err != nil {
		return err
	}
	err = z.Inputs.EncodeMsg(en)
	if err != nil {
		return
	}
	// write "Returns"
	err = en.Append(0xa7, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73)
	if err != nil {
		return err
	}
	err = z.Returns.EncodeMsg(en)
	if err != nil {
		return
	}
	// write "Deprecated"
	err = en.Append(0xaa, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteBool(z.Deprecated)
	if err != nil {
		return
	}
	// write "Comment"
	err = en.Append(0xa7, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74)
	if err != nil {
		return err
	}
	err = en.WriteString(z.Comment)
	if err != nil {
		return
	}
	return
}
开发者ID:glycerine,项目名称:zebra,代码行数:59,代码来源:zebra_gen.go

示例2: EncodeMsg

// EncodeMsg implements msgp.Encodable
func (z *CacheRegistry) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 6
	// write "CacheKey"
	err = en.Append(0x86, 0xa8, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4b, 0x65, 0x79)
	if err != nil {
		return err
	}
	err = en.WriteString(z.CacheKey)
	if err != nil {
		return
	}
	// write "Payload"
	err = en.Append(0xa7, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64)
	if err != nil {
		return err
	}
	err = en.WriteIntf(z.Payload)
	if err != nil {
		return
	}
	// write "StoreTTL"
	err = en.Append(0xa8, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x54, 0x4c)
	if err != nil {
		return err
	}
	err = en.WriteFloat64(z.StoreTTL)
	if err != nil {
		return
	}
	// write "CacheTime"
	err = en.Append(0xa9, 0x43, 0x61, 0x63, 0x68, 0x65, 0x54, 0x69, 0x6d, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteTime(z.CacheTime)
	if err != nil {
		return
	}
	// write "HasValue"
	err = en.Append(0xa8, 0x48, 0x61, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteBool(z.HasValue)
	if err != nil {
		return
	}
	// write "TypeName"
	err = en.Append(0xa8, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteString(z.TypeName)
	if err != nil {
		return
	}
	return
}
开发者ID:darciopacifico,项目名称:enablecache,代码行数:59,代码来源:manager_gen.go

示例3: EncodeMsg

// EncodeMsg implements msgp.Encodable
func (z *roaringArray) EncodeMsg(en *msgp.Writer) (err error) {
	// map header, size 4
	// write "keys"
	err = en.Append(0x84, 0xa4, 0x6b, 0x65, 0x79, 0x73)
	if err != nil {
		return err
	}
	err = en.WriteArrayHeader(uint32(len(z.keys)))
	if err != nil {
		return
	}
	for zhct := range z.keys {
		err = en.WriteUint16(z.keys[zhct])
		if err != nil {
			return
		}
	}
	// write "needCopyOnWrite"
	err = en.Append(0xaf, 0x6e, 0x65, 0x65, 0x64, 0x43, 0x6f, 0x70, 0x79, 0x4f, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteArrayHeader(uint32(len(z.needCopyOnWrite)))
	if err != nil {
		return
	}
	for zcua := range z.needCopyOnWrite {
		err = en.WriteBool(z.needCopyOnWrite[zcua])
		if err != nil {
			return
		}
	}
	// write "copyOnWrite"
	err = en.Append(0xab, 0x63, 0x6f, 0x70, 0x79, 0x4f, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65)
	if err != nil {
		return err
	}
	err = en.WriteBool(z.copyOnWrite)
	if err != nil {
		return
	}
	// write "conserz"
	err = en.Append(0xa7, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x72, 0x7a)
	if err != nil {
		return err
	}
	err = en.WriteArrayHeader(uint32(len(z.conserz)))
	if err != nil {
		return
	}
	for zxhx := range z.conserz {
		// map header, size 2
		// write "t"
		err = en.Append(0x82, 0xa1, 0x74)
		if err != nil {
			return err
		}
		err = en.WriteUint8(uint8(z.conserz[zxhx].t))
		if err != nil {
			return
		}
		// write "r"
		err = en.Append(0xa1, 0x72)
		if err != nil {
			return err
		}
		err = z.conserz[zxhx].r.EncodeMsg(en)
		if err != nil {
			return
		}
	}
	return
}
开发者ID:RoaringBitmap,项目名称:roaring,代码行数:74,代码来源:roaringarray_gen.go

示例4: EncodeMsg

// EncodeMsg implements msgp.Encodable
func (z *Incident) EncodeMsg(en *msgp.Writer) (err error) {
	err = en.WriteMapHeader(9)
	if err != nil {
		return
	}
	err = en.WriteString("event_name")
	if err != nil {
		return
	}
	err = en.WriteBytes(z.EventName)
	if err != nil {
		return
	}
	err = en.WriteString("time")
	if err != nil {
		return
	}
	err = en.WriteInt64(z.Time)
	if err != nil {
		return
	}
	err = en.WriteString("id")
	if err != nil {
		return
	}
	err = en.WriteInt64(z.Id)
	if err != nil {
		return
	}
	err = en.WriteString("active")
	if err != nil {
		return
	}
	err = en.WriteBool(z.Active)
	if err != nil {
		return
	}
	err = en.WriteString("escalation")
	if err != nil {
		return
	}
	err = en.WriteString(z.Escalation)
	if err != nil {
		return
	}
	err = en.WriteString("description")
	if err != nil {
		return
	}
	err = en.WriteString(z.Description)
	if err != nil {
		return
	}
	err = en.WriteString("policy")
	if err != nil {
		return
	}
	err = en.WriteString(z.Policy)
	if err != nil {
		return
	}
	err = en.WriteString("Status")
	if err != nil {
		return
	}
	err = en.WriteInt(z.Status)
	if err != nil {
		return
	}
	err = en.WriteString("Event")
	if err != nil {
		return
	}
	err = z.Event.EncodeMsg(en)
	if err != nil {
		return
	}
	return
}
开发者ID:postfix,项目名称:bangarang,代码行数:80,代码来源:incident_gen.go


注:本文中的github.com/tinylib/msgp/msgp.Writer.WriteBool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。