mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
use io.WriterTo instead of custom
This commit is contained in:
parent
4343214001
commit
8ec801a732
1 changed files with 1 additions and 6 deletions
7
api.go
7
api.go
|
|
@ -271,15 +271,10 @@ func (api *API) SliceNodes(ctx context.Context, indexName string, slice uint64)
|
|||
return api.Cluster.SliceNodes(indexName, slice)
|
||||
}
|
||||
|
||||
// WriterTo is an interface for any Object which knows how to serialize itself to an io.Writer
|
||||
type WriterTo interface {
|
||||
WriteTo(w io.Writer) (n int64, err error)
|
||||
}
|
||||
|
||||
// MarshalFragment returns an object which can write the specified fragment's data
|
||||
// to an io.Writer. The serialized data can be read back into a fragment with
|
||||
// the UnmarshalFragment API call.
|
||||
func (api *API) MarshalFragment(ctx context.Context, indexName string, frameName string, viewName string, slice uint64) (WriterTo, error) {
|
||||
func (api *API) MarshalFragment(ctx context.Context, indexName string, frameName string, viewName string, slice uint64) (io.WriterTo, error) {
|
||||
// Retrieve fragment from holder.
|
||||
f := api.Holder.Fragment(indexName, frameName, viewName, slice)
|
||||
if f == nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue