MCPcopy Create free account
hub / github.com/brimdata/super / Load

Method Load

db/api/remote.go:105–117  ·  view source on GitHub ↗
(ctx context.Context, _ *super.Context, poolID ksuid.KSUID, branchName string, reader sio.Reader, commit api.CommitMessage)

Source from the content-addressed store, hash-verified

103}
104
105func (r *remote) Load(ctx context.Context, _ *super.Context, poolID ksuid.KSUID, branchName string, reader sio.Reader, commit api.CommitMessage) (ksuid.KSUID, error) {
106 pr, pw := io.Pipe()
107 go func() {
108 w := bsupio.NewWriter(sio.NopCloser(pw))
109 err := sio.CopyWithContext(ctx, w, reader)
110 if err2 := w.Close(); err == nil {
111 err = err2
112 }
113 pw.CloseWithError(err)
114 }()
115 res, err := r.conn.Load(ctx, poolID, branchName, api.MediaTypeBSUP, pr, commit)
116 return res.Commit, err
117}
118
119func (r *remote) Revert(ctx context.Context, poolID ksuid.KSUID, branchName string, commitID ksuid.KSUID, message api.CommitMessage) (ksuid.KSUID, error) {
120 res, err := r.conn.Revert(ctx, poolID, branchName, commitID, message)

Callers

nothing calls this directly

Calls 5

CloseMethod · 0.95
NewWriterFunction · 0.92
NopCloserFunction · 0.92
CopyWithContextFunction · 0.92
LoadMethod · 0.65

Tested by

no test coverage detected