• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang pfs.APIClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/pachyderm/pachyderm/src/pfs.APIClient的典型用法代码示例。如果您正苦于以下问题:Golang APIClient类的具体用法?Golang APIClient怎么用?Golang APIClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了APIClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: GetFile

func GetFile(apiClient pfs.APIClient, repoName string, commitID string, path string, offset int64, size int64, shard *pfs.Shard, writer io.Writer) error {
	if size == 0 {
		size = math.MaxInt64
	}
	apiGetFileClient, err := apiClient.GetFile(
		context.Background(),
		&pfs.GetFileRequest{
			File: &pfs.File{
				Commit: &pfs.Commit{
					Repo: &pfs.Repo{
						Name: repoName,
					},
					Id: commitID,
				},
				Path: path,
			},
			Shard:       shard,
			OffsetBytes: offset,
			SizeBytes:   size,
		},
	)
	if err != nil {
		return err
	}
	if err := protostream.WriteFromStreamingBytesClient(apiGetFileClient, writer); err != nil {
		return err
	}
	return nil
}
开发者ID:Manikandan-Selvaganesh,项目名称:pachyderm,代码行数:29,代码来源:pfsutil.go


示例2: MakeDirectory

func MakeDirectory(apiClient pfs.APIClient, repoName string, commitID string, path string) (retErr error) {
	putFileClient, err := apiClient.PutFile(context.Background())
	if err != nil {
		return err
	}
	defer func() {
		if _, err := putFileClient.CloseAndRecv(); err != nil && retErr == nil {
			retErr = err
		}
	}()
	return putFileClient.Send(
		&pfs.PutFileRequest{
			File: &pfs.File{
				Commit: &pfs.Commit{
					Repo: &pfs.Repo{
						Name: repoName,
					},
					Id: commitID,
				},
				Path: path,
			},
			FileType: pfs.FileType_FILE_TYPE_DIR,
		},
	)
}
开发者ID:Manikandan-Selvaganesh,项目名称:pachyderm,代码行数:25,代码来源:pfsutil.go


示例3: FinishCommit

func FinishCommit(apiClient pfs.APIClient, repoName string, commitID string) error {
	_, err := apiClient.FinishCommit(
		context.Background(),
		&pfs.FinishCommitRequest{
			Commit: NewCommit(repoName, commitID),
		},
	)
	return err
}
开发者ID:tv42,项目名称:pachyderm,代码行数:9,代码来源:pfsutil.go


示例4: DeleteFile

func DeleteFile(apiClient pfs.APIClient, repoName string, commitID string, path string) error {
	_, err := apiClient.DeleteFile(
		context.Background(),
		&pfs.DeleteFileRequest{
			File: NewFile(repoName, commitID, path),
		},
	)
	return err
}
开发者ID:tv42,项目名称:pachyderm,代码行数:9,代码来源:pfsutil.go


示例5: DeleteRepo

func DeleteRepo(apiClient pfs.APIClient, repoName string) error {
	_, err := apiClient.DeleteRepo(
		context.Background(),
		&pfs.DeleteRepoRequest{
			Repo: NewRepo(repoName),
		},
	)
	return err
}
开发者ID:tv42,项目名称:pachyderm,代码行数:9,代码来源:pfsutil.go


示例6: ListServer

func ListServer(apiClient pfs.APIClient) ([]*pfs.ServerInfo, error) {
	serverInfos, err := apiClient.ListServer(
		context.Background(),
		&pfs.ListServerRequest{},
	)
	if err != nil {
		return nil, err
	}
	return serverInfos.ServerInfo, nil
}
开发者ID:mehulsbhatt,项目名称:pachyderm,代码行数:10,代码来源:pfsutil.go


示例7: ListRepo

func ListRepo(apiClient pfs.APIClient) ([]*pfs.RepoInfo, error) {
	repoInfos, err := apiClient.ListRepo(
		context.Background(),
		&pfs.ListRepoRequest{},
	)
	if err != nil {
		return nil, err
	}
	return repoInfos.RepoInfo, nil
}
开发者ID:Manikandan-Selvaganesh,项目名称:pachyderm,代码行数:10,代码来源:pfsutil.go


示例8: InspectServer

func InspectServer(apiClient pfs.APIClient, serverID string) (*pfs.ServerInfo, error) {
	return apiClient.InspectServer(
		context.Background(),
		&pfs.InspectServerRequest{
			Server: &pfs.Server{
				Id: serverID,
			},
		},
	)
}
开发者ID:mehulsbhatt,项目名称:pachyderm,代码行数:10,代码来源:pfsutil.go


示例9: CreateRepo

func CreateRepo(apiClient pfs.APIClient, repoName string) error {
	_, err := apiClient.CreateRepo(
		context.Background(),
		&pfs.CreateRepoRequest{
			Repo: &pfs.Repo{
				Name: repoName,
			},
		},
	)
	return err
}
开发者ID:Manikandan-Selvaganesh,项目名称:pachyderm,代码行数:11,代码来源:pfsutil.go


示例10: ListBlock

func ListBlock(apiClient pfs.APIClient, shard *pfs.Shard) ([]*pfs.BlockInfo, error) {
	blockInfos, err := apiClient.ListBlock(
		context.Background(),
		&pfs.ListBlockRequest{
			Shard: shard,
		},
	)
	if err != nil {
		return nil, err
	}
	return blockInfos.BlockInfo, nil
}
开发者ID:klucar,项目名称:pachyderm,代码行数:12,代码来源:pfsutil.go


示例11: InspectRepo

func InspectRepo(apiClient pfs.APIClient, repoName string) (*pfs.RepoInfo, error) {
	repoInfo, err := apiClient.InspectRepo(
		context.Background(),
		&pfs.InspectRepoRequest{
			Repo: NewRepo(repoName),
		},
	)
	if err != nil {
		return nil, err
	}
	return repoInfo, nil
}
开发者ID:tv42,项目名称:pachyderm,代码行数:12,代码来源:pfsutil.go


示例12: InspectCommit

func InspectCommit(apiClient pfs.APIClient, repoName string, commitID string) (*pfs.CommitInfo, error) {
	commitInfo, err := apiClient.InspectCommit(
		context.Background(),
		&pfs.InspectCommitRequest{
			Commit: NewCommit(repoName, commitID),
		},
	)
	if err != nil {
		return nil, err
	}
	return commitInfo, nil
}
开发者ID:tv42,项目名称:pachyderm,代码行数:12,代码来源:pfsutil.go


示例13: StartCommit

func StartCommit(apiClient pfs.APIClient, repoName string, parentCommit string) (*pfs.Commit, error) {
	commit, err := apiClient.StartCommit(
		context.Background(),
		&pfs.StartCommitRequest{
			Parent: NewCommit(repoName, parentCommit),
		},
	)
	if err != nil {
		return nil, err
	}
	return commit, nil
}
开发者ID:tv42,项目名称:pachyderm,代码行数:12,代码来源:pfsutil.go


示例14: setupPFSRepo

func setupPFSRepo(t *testing.T, pfsAPIClient pfs.APIClient, repoName string) *pfs.Repo {
	repo := &pfs.Repo{
		Name: repoName,
	}
	_, err := pfsAPIClient.CreateRepo(
		context.Background(),
		&pfs.CreateRepoRequest{
			Repo: repo,
		},
	)
	require.NoError(t, err)
	return repo
}
开发者ID:alexdebrie,项目名称:pachyderm,代码行数:13,代码来源:testing_test.go


示例15: DeleteCommit

func DeleteCommit(apiClient pfs.APIClient, repoName string, commitID string) error {
	_, err := apiClient.DeleteCommit(
		context.Background(),
		&pfs.DeleteCommitRequest{
			Commit: &pfs.Commit{
				Repo: &pfs.Repo{
					Name: repoName,
				},
				Id: commitID,
			},
		},
	)
	return err
}
开发者ID:Manikandan-Selvaganesh,项目名称:pachyderm,代码行数:14,代码来源:pfsutil.go


示例16: ListCommit

func ListCommit(apiClient pfs.APIClient, repoName string) ([]*pfs.CommitInfo, error) {
	commitInfos, err := apiClient.ListCommit(
		context.Background(),
		&pfs.ListCommitRequest{
			Repo: &pfs.Repo{
				Name: repoName,
			},
		},
	)
	if err != nil {
		return nil, err
	}
	return commitInfos.CommitInfo, nil
}
开发者ID:klucar,项目名称:pachyderm,代码行数:14,代码来源:pfsutil.go


示例17: ListFile

func ListFile(apiClient pfs.APIClient, repoName string, commitID string, path string, fromCommitID string, shard *pfs.Shard) ([]*pfs.FileInfo, error) {
	fileInfos, err := apiClient.ListFile(
		context.Background(),
		&pfs.ListFileRequest{
			File:       NewFile(repoName, commitID, path),
			Shard:      shard,
			FromCommit: newFromCommit(repoName, fromCommitID),
		},
	)
	if err != nil {
		return nil, err
	}
	return fileInfos.FileInfo, nil
}
开发者ID:tv42,项目名称:pachyderm,代码行数:14,代码来源:pfsutil.go


示例18: InspectBlock

func InspectBlock(apiClient pfs.APIClient, hash string) (*pfs.BlockInfo, error) {
	blockInfo, err := apiClient.InspectBlock(
		context.Background(),
		&pfs.InspectBlockRequest{
			Block: &pfs.Block{
				Hash: hash,
			},
		},
	)
	if err != nil {
		return nil, err
	}
	return blockInfo, nil
}
开发者ID:mehulsbhatt,项目名称:pachyderm,代码行数:14,代码来源:pfsutil.go


示例19: ListBlock

func ListBlock(apiClient pfs.APIClient, shard uint64, modulus uint64) ([]*pfs.BlockInfo, error) {
	blockInfos, err := apiClient.ListBlock(
		context.Background(),
		&pfs.ListBlockRequest{
			Shard: &pfs.Shard{
				Number: shard,
				Modulo: modulus,
			},
		},
	)
	if err != nil {
		return nil, err
	}
	return blockInfos.BlockInfo, nil
}
开发者ID:mehulsbhatt,项目名称:pachyderm,代码行数:15,代码来源:pfsutil.go


示例20: ListCommit

func ListCommit(apiClient pfs.APIClient, repoNames []string) ([]*pfs.CommitInfo, error) {
	var repos []*pfs.Repo
	for _, repoName := range repoNames {
		repos = append(repos, &pfs.Repo{Name: repoName})
	}
	commitInfos, err := apiClient.ListCommit(
		context.Background(),
		&pfs.ListCommitRequest{
			Repo: repos,
		},
	)
	if err != nil {
		return nil, err
	}
	return commitInfos.CommitInfo, nil
}
开发者ID:Manikandan-Selvaganesh,项目名称:pachyderm,代码行数:16,代码来源:pfsutil.go



注:本文中的github.com/pachyderm/pachyderm/src/pfs.APIClient类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang pfs.API_GetFileServer类代码示例发布时间:2022-05-28
下一篇:
Golang pfs.NewInternalApiClient函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap