func (stream *Stream) History() []uint64 { for { ret := C.zlog_stream_history(C.zlog_stream_t(stream.stream), nil, 0) pos := make([]uint64, ret) ret = C.zlog_stream_history(C.zlog_stream_t(stream.stream), (*C.uint64_t)(&pos[0]), (C.size_t)(len(pos))) if len(pos) == int(ret) { return pos } } }
func (stream *Stream) Sync() error { ret := C.zlog_stream_sync(C.zlog_stream_t(stream.stream)) if ret == 0 { return nil } else { return ZlogError(int(ret)) } }
func (stream *Stream) ReadNext(data []byte) (int, uint64, error) { var c_position C.uint64_t ret := C.zlog_stream_readnext(C.zlog_stream_t(stream.stream), unsafe.Pointer(&data[0]), (C.size_t)(len(data)), &c_position) if ret >= 0 { return int(ret), uint64(c_position), nil } else { return 0, 0, ZlogError(int(ret)) } }
func (stream *Stream) Append(data []byte) (uint64, error) { var c_position C.uint64_t ret := C.zlog_stream_append(C.zlog_stream_t(stream.stream), unsafe.Pointer(&data[0]), (C.size_t)(len(data)), &c_position) if ret == 0 { return uint64(c_position), nil } else { return 0, ZlogError(int(ret)) } }
func (stream *Stream) Id() uint64 { ret := C.zlog_stream_id(C.zlog_stream_t(stream.stream)) return uint64(ret) }