本文整理汇总了Golang中github.com/pachyderm/pachyderm/src/pfs.StartCommitRequest类的典型用法代码示例。如果您正苦于以下问题:Golang StartCommitRequest类的具体用法?Golang StartCommitRequest怎么用?Golang StartCommitRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StartCommitRequest类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: StartCommit
func (a *apiServer) StartCommit(ctx context.Context, request *pfs.StartCommitRequest) (response *pfs.Commit, retErr error) {
defer func(start time.Time) { a.Log(request, response, retErr, time.Since(start)) }(time.Now())
a.versionLock.RLock()
defer a.versionLock.RUnlock()
ctx = versionToContext(a.version, ctx)
clientConns, err := a.router.GetAllClientConns(a.version)
if err != nil {
return nil, err
}
if request.Commit == nil {
if request.Parent == nil {
return nil, fmt.Errorf("one of Parent or Commit must be non nil")
}
request.Commit = &pfs.Commit{
Repo: request.Parent.Repo,
Id: uuid.NewWithoutDashes(),
}
if request.Parent.Id == "" {
request.Parent = nil
}
}
request.Started = prototime.TimeToTimestamp(time.Now())
for _, clientConn := range clientConns {
if _, err := pfs.NewInternalAPIClient(clientConn).StartCommit(ctx, request); err != nil {
return nil, err
}
}
return request.Commit, nil
}
开发者ID:fausto-svds,项目名称:pachyderm,代码行数:29,代码来源:api_server.go
示例2: StartCommit
func (a *apiServer) StartCommit(ctx context.Context, request *pfs.StartCommitRequest) (*pfs.Commit, error) {
a.versionLock.RLock()
defer a.versionLock.RUnlock()
ctx = versionToContext(a.version, ctx)
clientConns, err := a.router.GetAllClientConns(a.version)
if err != nil {
return nil, err
}
if request.Commit == nil {
request.Commit = &pfs.Commit{
Repo: request.Parent.Repo,
Id: uuid.NewWithoutDashes(),
}
}
for _, clientConn := range clientConns {
if _, err := pfs.NewInternalAPIClient(clientConn).StartCommit(ctx, request); err != nil {
return nil, err
}
}
return request.Commit, nil
}
开发者ID:mehulsbhatt,项目名称:pachyderm,代码行数:21,代码来源:api_server.go
示例3: StartCommit
func (a *apiServer) StartCommit(ctx context.Context, request *pfs.StartCommitRequest) (*pfs.Commit, error) {
version, ctx, err := a.versionAndCtx(ctx)
if err != nil {
return nil, err
}
clientConns, err := a.router.GetAllClientConns(version)
if err != nil {
return nil, err
}
if request.Commit == nil {
request.Commit = &pfs.Commit{
Repo: request.Parent.Repo,
Id: strings.Replace(uuid.NewV4().String(), "-", "", -1),
}
}
for _, clientConn := range clientConns {
if _, err := pfs.NewInternalApiClient(clientConn).StartCommit(ctx, request); err != nil {
return nil, err
}
}
return request.Commit, nil
}
开发者ID:sr,项目名称:pachyderm,代码行数:22,代码来源:api_server.go
注:本文中的github.com/pachyderm/pachyderm/src/pfs.StartCommitRequest类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论