-
Notifications
You must be signed in to change notification settings - Fork 9
/
local.go
52 lines (44 loc) · 1.08 KB
/
local.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 2022 Target Brands, Inc. All rights reserved.
//
// Use of this source code is governed by the LICENSE file in this repository.
package local
import (
"sync"
"github.com/go-vela/sdk-go/vela"
"github.com/go-vela/types/library"
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/runtime"
)
type (
// client manages communication with the pipeline resources.
client struct {
Vela *vela.Client
Runtime runtime.Engine
Hostname string
Version string
// private fields
init *pipeline.Container
build *library.Build
pipeline *pipeline.Build
repo *library.Repo
services sync.Map
steps sync.Map
user *library.User
err error
}
)
// New returns an Executor implementation that integrates with the local system.
//
// nolint: golint // ignore unexported type as it is intentional
func New(opts ...Opt) (*client, error) {
// create new local client
c := new(client)
// apply all provided configuration options
for _, opt := range opts {
err := opt(c)
if err != nil {
return nil, err
}
}
return c, nil
}