mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-13 03:10:03 -05:00
b33cab2b34
This is in preparation for renaming the 'Commit' abstraction to DataStore. So we will essentially have a 'chunkstore' abstraction and a 'datastore' abstraction.
17 lines
314 B
Go
17 lines
314 B
Go
package enc
|
|
|
|
import (
|
|
"github.com/attic-labs/noms/chunks"
|
|
"github.com/attic-labs/noms/ref"
|
|
"github.com/attic-labs/noms/types"
|
|
)
|
|
|
|
func WriteValue(v types.Value, cs chunks.ChunkSink) (ref.Ref, error) {
|
|
switch v := v.(type) {
|
|
case types.Blob:
|
|
return blobEncode(v, cs)
|
|
default:
|
|
return jsonEncode(v, cs)
|
|
}
|
|
}
|