GetUserpassPlaintext returns the plaintext username/password combination stored in the Cred.
()
| 109 | |
| 110 | // GetUserpassPlaintext returns the plaintext username/password combination stored in the Cred. |
| 111 | func (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. |
| 124 | func (o *Credential) GetSSHKey() (username, publickey, privatekey, passphrase string, err error) { |