MCPcopy
hub / github.com/cli/cli / Set

Function Set

internal/keyring/keyring.go:22–34  ·  view source on GitHub ↗

Set secret in keyring for user.

(service, user, secret string)

Source from the content-addressed store, hash-verified

20
21// Set secret in keyring for user.
22func Set(service, user, secret string) error {
23 ch := make(chan error, 1)
24 go func() {
25 defer close(ch)
26 ch <- keyring.Set(service, user, secret)
27 }()
28 select {
29 case err := <-ch:
30 return err
31 case <-time.After(3 * time.Second):
32 return &TimeoutError{"timeout while trying to set secret in keyring"}
33 }
34}
35
36// Get secret from keyring given service and user name.
37func Get(service, user string) (string, error) {

Callers 11

TestTokenFromKeyringFunction · 0.92
preMigrationLoginFunction · 0.92
LoginMethod · 0.92
SwitchUserMethod · 0.92
activateUserMethod · 0.92
migrateTokenFunction · 0.92

Calls 1

SetMethod · 0.65