本文整理汇总了Golang中github.com/aerospike/aerospike-client-go/utils/buffer.Int64ToBytes函数的典型用法代码示例。如果您正苦于以下问题:Golang Int64ToBytes函数的具体用法?Golang Int64ToBytes怎么用?Golang Int64ToBytes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Int64ToBytes函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: PackLong
func (pckr *packer) PackLong(valType int, val int64) {
pckr.buffer.WriteByte(byte(valType))
pos := pckr.grow(_b8)
Buffer.Int64ToBytes(val, pckr.buffer.Bytes(), pos)
}
开发者ID:Kavec,项目名称:aerospike-client-go,代码行数:5,代码来源:packer.go
示例2: PackULong
func (pckr *packer) PackULong(val uint64) {
pckr.buffer.WriteByte(byte(0xcf))
pos := pckr.grow(_b8)
Buffer.Int64ToBytes(int64(val), pckr.buffer.Bytes(), pos)
}
开发者ID:Kavec,项目名称:aerospike-client-go,代码行数:5,代码来源:packer.go
示例3: end
func (cmd *baseCommand) end() {
var size = int64(cmd.dataOffset-8) | (_CL_MSG_VERSION << 56) | (_AS_MSG_TYPE << 48)
Buffer.Int64ToBytes(size, cmd.dataBuffer, 0)
}
开发者ID:atomx,项目名称:aerospike-client-go,代码行数:4,代码来源:command.go
示例4: setQuery
//.........这里部分代码省略.........
cmd.estimateOperationSizeForBinName(binName)
}
}
}
if err := cmd.sizeBuffer(); err != nil {
return nil
}
operationCount := 0
if len(statement.Filters) == 0 && len(statement.BinNames) > 0 {
operationCount = len(statement.BinNames)
}
if write {
cmd.writeHeader(policy.BasePolicy, _INFO1_READ, _INFO2_WRITE, fieldCount, operationCount)
} else {
cmd.writeHeader(policy.BasePolicy, _INFO1_READ, 0, fieldCount, operationCount)
}
if statement.Namespace != "" {
cmd.writeFieldString(statement.Namespace, NAMESPACE)
}
if statement.IndexName != "" {
cmd.writeFieldString(statement.IndexName, INDEX_NAME)
}
if statement.SetName != "" {
cmd.writeFieldString(statement.SetName, TABLE)
}
cmd.writeFieldHeader(8, TRAN_ID)
Buffer.Int64ToBytes(int64(statement.TaskId), cmd.dataBuffer, cmd.dataOffset)
cmd.dataOffset += 8
if len(statement.Filters) > 0 {
if len(statement.Filters) >= 1 {
idxType := statement.Filters[0].IndexCollectionType()
if idxType != ICT_DEFAULT {
cmd.writeFieldHeader(1, INDEX_TYPE)
cmd.dataBuffer[cmd.dataOffset] = byte(idxType)
cmd.dataOffset++
}
}
cmd.writeFieldHeader(filterSize, INDEX_RANGE)
cmd.dataBuffer[cmd.dataOffset] = byte(len(statement.Filters))
cmd.dataOffset++
for _, filter := range statement.Filters {
cmd.dataOffset, err = filter.write(cmd.dataBuffer, cmd.dataOffset)
if err != nil {
return err
}
}
if len(statement.BinNames) > 0 {
cmd.writeFieldHeader(binNameSize, QUERY_BINLIST)
cmd.dataBuffer[cmd.dataOffset] = byte(len(statement.BinNames))
cmd.dataOffset++
for _, binName := range statement.BinNames {
len := copy(cmd.dataBuffer[cmd.dataOffset+1:], binName)
cmd.dataBuffer[cmd.dataOffset] = byte(len)
开发者ID:atomx,项目名称:aerospike-client-go,代码行数:67,代码来源:command.go
示例5: reader
func (vl LongValue) reader() io.Reader {
return bytes.NewReader(Buffer.Int64ToBytes(int64(vl), nil, 0))
}
开发者ID:bookerzzz,项目名称:aerospike-client-go,代码行数:3,代码来源:value.go
示例6: write
func (vl LongValue) write(buffer []byte, offset int) (int, error) {
Buffer.Int64ToBytes(int64(vl), buffer, offset)
return 8, nil
}
开发者ID:bookerzzz,项目名称:aerospike-client-go,代码行数:4,代码来源:value.go
示例7: writeSize
func (acmd *AdminCommand) writeSize() {
// Write total size of message which is the current offset.
var size = int64(acmd.dataOffset-8) | (_MSG_VERSION << 56) | (_MSG_TYPE << 48)
Buffer.Int64ToBytes(size, acmd.dataBuffer, 0)
}
开发者ID:mantyr,项目名称:aerospike-client-go,代码行数:5,代码来源:admin_command.go
注:本文中的github.com/aerospike/aerospike-client-go/utils/buffer.Int64ToBytes函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论