本文整理匯總了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
}
示例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
}
示例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
}