當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。