示例#1
0
文件: pfsutil.go 项目: sr/pachyderm
func PutBlock(apiClient pfs.ApiClient, repoName string, commitID string, path string, reader io.Reader) (*pfs.Block, error) {
	value, err := ioutil.ReadAll(reader)
	if err != nil {
		return nil, err
	}
	return apiClient.PutBlock(
		context.Background(),
		&pfs.PutBlockRequest{
			File: &pfs.File{
				Commit: &pfs.Commit{
					Repo: &pfs.Repo{
						Name: repoName,
					},
					Id: commitID,
				},
				Path: path,
			},
			Value: value,
		},
	)
}