當前位置: 首頁>>代碼示例>>Golang>>正文


Golang pfs.APIClient類代碼示例

本文整理匯總了Golang中github.com/pachyderm/pachyderm/src/pfs.APIClient的典型用法代碼示例。如果您正苦於以下問題:Golang APIClient類的具體用法?Golang APIClient怎麽用?Golang APIClient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了APIClient類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的github.com/pachyderm/pachyderm/src/pfs.APIClient類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。