MCPcopy Index your code
hub / github.com/bytebase/bytebase / newClientFromWorld

Function newClientFromWorld

action/command/root.go:64–76  ·  view source on GitHub ↗

newClientFromWorld creates a client using the authentication configured in World.

(w *world.World)

Source from the content-addressed store, hash-verified

62
63// newClientFromWorld creates a client using the authentication configured in World.
64func newClientFromWorld(w *world.World) (*client, error) {
65 options := defaultClientOptions()
66 if w.Timeout > 0 {
67 options.timeout = w.Timeout
68 }
69 options.customHeaders = w.CustomHeaders
70
71 // Access tokens take precedence when both auth modes are populated.
72 if w.AccessToken != "" {
73 return newClient(w.URL, w.AccessToken, "", "", options)
74 }
75 return newClient(w.URL, "", w.ServiceAccount, w.ServiceAccountSecret, options)
76}
77
78type customHeaderFlag struct {
79 headers *http.Header

Callers 3

runCheckFunction · 0.85
runRolloutFunction · 0.85

Calls 2

defaultClientOptionsFunction · 0.85
newClientFunction · 0.70

Tested by 1