forked from moby/swarmkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
37 lines (28 loc) · 863 Bytes
/
config.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
package agent
import (
"fmt"
"github.com/docker/swarmkit/agent/exec"
"github.com/docker/swarmkit/api"
"github.com/docker/swarmkit/picker"
"google.golang.org/grpc"
)
// Config provides values for an Agent.
type Config struct {
// Hostname the name of host for agent instance.
Hostname string
// Managers provides the manager backend used by the agent. It will be
// updated with managers weights as observed by the agent.
Managers picker.Remotes
// Executor specifies the executor to use for the agent.
Executor exec.Executor
// Conn specifies the client connection Agent will use
Conn *grpc.ClientConn
// NotifyRoleChange channel receives new roles from session messages.
NotifyRoleChange chan<- api.NodeRole
}
func (c *Config) validate() error {
if c.Conn == nil {
return fmt.Errorf("config: Connection is required")
}
return nil
}