本文整理汇总了Golang中github.com/pachyderm/pachyderm/src/pfs.ApiClient类的典型用法代码示例。如果您正苦于以下问题:Golang ApiClient类的具体用法?Golang ApiClient怎么用?Golang ApiClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ApiClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: 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:sr,项目名称:pachyderm,代码行数:25,代码来源:pfsutil.go
示例2: GetFile
func GetFile(apiClient pfs.ApiClient, repositoryName string, commitID string, path string, offset int64, size int64, writer io.Writer) error {
apiGetFileClient, err := apiClient.GetFile(
context.Background(),
&pfs.GetFileRequest{
Path: &pfs.Path{
Commit: &pfs.Commit{
Repository: &pfs.Repository{
Name: repositoryName,
},
Id: commitID,
},
Path: path,
},
OffsetBytes: offset,
SizeBytes: size,
},
)
if err != nil {
return err
}
if err := protostream.WriteFromStreamingBytesClient(apiGetFileClient, writer); err != nil {
return err
}
return nil
}
开发者ID:kunthar,项目名称:pachyderm,代码行数:25,代码来源:pfsutil.go
示例3: InspectServer
func InspectServer(apiClient pfs.ApiClient, serverID string) (*pfs.ServerInfo, error) {
return apiClient.InspectServer(
context.Background(),
&pfs.InspectServerRequest{
Server: &pfs.Server{
Id: serverID,
},
},
)
}
开发者ID:sr,项目名称:pachyderm,代码行数:10,代码来源:pfsutil.go
示例4: ListCommits
func ListCommits(apiClient pfs.ApiClient, repositoryName string) (*pfs.CommitInfos, error) {
return apiClient.ListCommits(
context.Background(),
&pfs.ListCommitsRequest{
Repository: &pfs.Repository{
Name: repositoryName,
},
},
)
}
开发者ID:kunthar,项目名称:pachyderm,代码行数:10,代码来源:pfsutil.go
示例5: 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:sr,项目名称:pachyderm,代码行数:10,代码来源: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:sr,项目名称:pachyderm,代码行数:10,代码来源:pfsutil.go
示例7: InitRepository
func InitRepository(apiClient pfs.ApiClient, repositoryName string) error {
_, err := apiClient.InitRepository(
context.Background(),
&pfs.InitRepositoryRequest{
Repository: &pfs.Repository{
Name: repositoryName,
},
},
)
return err
}
开发者ID:kunthar,项目名称:pachyderm,代码行数:11,代码来源:pfsutil.go
示例8: DeleteRepo
func DeleteRepo(apiClient pfs.ApiClient, repoName string) error {
_, err := apiClient.DeleteRepo(
context.Background(),
&pfs.DeleteRepoRequest{
Repo: &pfs.Repo{
Name: repoName,
},
},
)
return err
}
开发者ID:sr,项目名称:pachyderm,代码行数:11,代码来源:pfsutil.go
示例9: Branch
func Branch(apiClient pfs.ApiClient, repositoryName string, commitID string) (*pfs.Commit, error) {
return apiClient.Branch(
context.Background(),
&pfs.BranchRequest{
Commit: &pfs.Commit{
Repository: &pfs.Repository{
Name: repositoryName,
},
Id: commitID,
},
},
)
}
开发者ID:kunthar,项目名称:pachyderm,代码行数:13,代码来源:pfsutil.go
示例10: GetCommitInfo
func GetCommitInfo(apiClient pfs.ApiClient, repositoryName string, commitID string) (*pfs.GetCommitInfoResponse, error) {
return apiClient.GetCommitInfo(
context.Background(),
&pfs.GetCommitInfoRequest{
Commit: &pfs.Commit{
Repository: &pfs.Repository{
Name: repositoryName,
},
Id: commitID,
},
},
)
}
开发者ID:henrylee2cn,项目名称:pachyderm,代码行数:13,代码来源:pfsutil.go
示例11: Write
func Write(apiClient pfs.ApiClient, repositoryName string, commitID string) error {
_, err := apiClient.Write(
context.Background(),
&pfs.WriteRequest{
Commit: &pfs.Commit{
Repository: &pfs.Repository{
Name: repositoryName,
},
Id: commitID,
},
},
)
return err
}
开发者ID:kunthar,项目名称:pachyderm,代码行数:14,代码来源:pfsutil.go
示例12: FinishCommit
func FinishCommit(apiClient pfs.ApiClient, repoName string, commitID string) error {
_, err := apiClient.FinishCommit(
context.Background(),
&pfs.FinishCommitRequest{
Commit: &pfs.Commit{
Repo: &pfs.Repo{
Name: repoName,
},
Id: commitID,
},
},
)
return err
}
开发者ID:sr,项目名称:pachyderm,代码行数:14,代码来源:pfsutil.go
示例13: 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:sr,项目名称:pachyderm,代码行数:14,代码来源:pfsutil.go
示例14: InspectRepo
func InspectRepo(apiClient pfs.ApiClient, repoName string) (*pfs.RepoInfo, error) {
repoInfo, err := apiClient.InspectRepo(
context.Background(),
&pfs.InspectRepoRequest{
Repo: &pfs.Repo{
Name: repoName,
},
},
)
if err != nil {
return nil, err
}
return repoInfo, nil
}
开发者ID:sr,项目名称:pachyderm,代码行数:14,代码来源:pfsutil.go
示例15: 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:sr,项目名称:pachyderm,代码行数:14,代码来源:pfsutil.go
示例16: 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:sr,项目名称:pachyderm,代码行数:15,代码来源:pfsutil.go
示例17: GetFileInfo
func GetFileInfo(apiClient pfs.ApiClient, repositoryName string, commitID string, path string) (*pfs.FileInfo, error) {
return apiClient.GetFileInfo(
context.Background(),
&pfs.GetFileInfoRequest{
Path: &pfs.Path{
Commit: &pfs.Commit{
Repository: &pfs.Repository{
Name: repositoryName,
},
Id: commitID,
},
Path: path,
},
},
)
}
开发者ID:kunthar,项目名称:pachyderm,代码行数:16,代码来源:pfsutil.go
示例18: StartCommit
func StartCommit(apiClient pfs.ApiClient, repoName string, parentCommit string) (*pfs.Commit, error) {
commit, err := apiClient.StartCommit(
context.Background(),
&pfs.StartCommitRequest{
Parent: &pfs.Commit{
Repo: &pfs.Repo{
Name: repoName,
},
Id: parentCommit,
},
},
)
if err != nil {
return nil, err
}
return commit, nil
}
开发者ID:sr,项目名称:pachyderm,代码行数:17,代码来源:pfsutil.go
示例19: GetBlock
func GetBlock(apiClient pfs.ApiClient, hash string, writer io.Writer) error {
apiGetBlockClient, err := apiClient.GetBlock(
context.Background(),
&pfs.GetBlockRequest{
Block: &pfs.Block{
Hash: hash,
},
},
)
if err != nil {
return err
}
if err := protostream.WriteFromStreamingBytesClient(apiGetBlockClient, writer); err != nil {
return err
}
return nil
}
开发者ID:sr,项目名称:pachyderm,代码行数:17,代码来源:pfsutil.go
示例20: DeleteFile
func DeleteFile(apiClient pfs.ApiClient, repoName string, commitID string, path string) error {
_, err := apiClient.DeleteFile(
context.Background(),
&pfs.DeleteFileRequest{
File: &pfs.File{
Commit: &pfs.Commit{
Repo: &pfs.Repo{
Name: repoName,
},
Id: commitID,
},
Path: path,
},
},
)
return err
}
开发者ID:sr,项目名称:pachyderm,代码行数:17,代码来源:pfsutil.go
注:本文中的github.com/pachyderm/pachyderm/src/pfs.ApiClient类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论