MCPcopy Create free account
hub / github.com/convox/rack / currentClient

Method currentClient

pkg/cli/engine.go:39–66  ·  view source on GitHub ↗
(c *stdcli.Context)

Source from the content-addressed store, hash-verified

37}
38
39func (e *Engine) currentClient(c *stdcli.Context) sdk.Interface {
40 if e.Client != nil {
41 return e.Client
42 }
43
44 host, err := currentHost(c)
45 if err != nil {
46 c.Fail(err)
47 }
48
49 r := currentRack(c, host)
50
51 endpoint, err := currentEndpoint(c, r)
52 if err != nil {
53 c.Fail(err)
54 }
55
56 sc, err := sdk.New(endpoint)
57 if err != nil {
58 c.Fail(err)
59 }
60
61 sc.Authenticator = authenticator(c)
62 sc.Rack = r
63 sc.Session = currentSession(c)
64
65 return sc
66}
67
68var commands = []command{}
69

Callers 1

CommandMethod · 0.95

Calls 6

NewFunction · 0.92
currentHostFunction · 0.85
currentRackFunction · 0.85
currentEndpointFunction · 0.85
authenticatorFunction · 0.85
currentSessionFunction · 0.85

Tested by

no test coverage detected