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

Method Load

api/client/connection.go:330–340  ·  view source on GitHub ↗

Load loads data from r. contentType is a media type for r or the empty string, in which case the server will attempt to detect r's format.

(ctx context.Context, poolID ksuid.KSUID, branchName, contentType string, r io.Reader, message api.CommitMessage)

Source from the content-addressed store, hash-verified

328// Load loads data from r. contentType is a media type for r or the empty
329// string, in which case the server will attempt to detect r's format.
330func (c *Connection) Load(ctx context.Context, poolID ksuid.KSUID, branchName, contentType string, r io.Reader, message api.CommitMessage) (api.CommitResponse, error) {
331 path := urlPath("pool", poolID.String(), "branch", branchName)
332 req := c.NewRequest(ctx, http.MethodPost, path, r)
333 req.Header.Set("Content-Type", contentType)
334 if err := encodeCommitMessage(req, message); err != nil {
335 return api.CommitResponse{}, err
336 }
337 var commit api.CommitResponse
338 err := c.doAndUnmarshal(req, &commit)
339 return commit, err
340}
341
342func encodeCommitMessage(req *Request, message api.CommitMessage) error {
343 encoded, err := json.Marshal(message)

Callers

nothing calls this directly

Calls 6

NewRequestMethod · 0.95
doAndUnmarshalMethod · 0.95
urlPathFunction · 0.85
encodeCommitMessageFunction · 0.85
StringMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected