当前位置: 首页>>代码示例>>Golang>>正文


Golang pfs.ApiClient类代码示例

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


在下文中一共展示了ApiClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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