MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / getAuthenticatedClient

Function getAuthenticatedClient

cmd/helpers.go:16–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14}
15
16func getAuthenticatedClient() (*api.Client, error) {
17 config, err := LoadConfig()
18 if err != nil {
19 return nil, usageErr("not authenticated. Please run 'tnr login' first")
20 }
21 if config.Token == "" {
22 return nil, usageErr("no authentication token found. Please run 'tnr login'")
23 }
24 return api.NewClient(config.Token, config.APIURL), nil
25}

Callers 9

runPortsForwardFunction · 0.85
RunStatusFunction · 0.85
runPortsListFunction · 0.85
runSnapshotListFunction · 0.85
runDeleteFunction · 0.85
runModifyFunction · 0.85
runCreateFunction · 0.85
runSnapshotCreateFunction · 0.85
runSnapshotDeleteFunction · 0.85

Calls 3

NewClientFunction · 0.92
LoadConfigFunction · 0.85
usageErrFunction · 0.85

Tested by

no test coverage detected