MCPcopy Create free account
hub / github.com/libgit2/git2go / GetUserpassPlaintext

Method GetUserpassPlaintext

credentials.go:111–121  ·  view source on GitHub ↗

GetUserpassPlaintext returns the plaintext username/password combination stored in the Cred.

()

Source from the content-addressed store, hash-verified

109
110// GetUserpassPlaintext returns the plaintext username/password combination stored in the Cred.
111func (o *Credential) GetUserpassPlaintext() (username, password string, err error) {
112 if o.Type() != CredentialTypeUserpassPlaintext {
113 err = errors.New("credential is not userpass plaintext")
114 return
115 }
116
117 plaintextCredPtr := (*C.git_cred_userpass_plaintext)(unsafe.Pointer(o.ptr))
118 username = C.GoString(plaintextCredPtr.username)
119 password = C.GoString(plaintextCredPtr.password)
120 return
121}
122
123// GetSSHKey returns the SSH-specific key information from the Cred object.
124func (o *Credential) GetSSHKey() (username, publickey, privatekey, passphrase string, err error) {

Callers 1

sendRequestMethod · 0.80

Calls 1

TypeMethod · 0.95

Tested by

no test coverage detected