()
| 37 | ) |
| 38 | |
| 39 | func (t CredentialType) String() string { |
| 40 | if t == 0 { |
| 41 | return "CredentialType(0)" |
| 42 | } |
| 43 | |
| 44 | var parts []string |
| 45 | |
| 46 | if (t & CredentialTypeUserpassPlaintext) != 0 { |
| 47 | parts = append(parts, "UserpassPlaintext") |
| 48 | t &= ^CredentialTypeUserpassPlaintext |
| 49 | } |
| 50 | if (t & CredentialTypeSSHKey) != 0 { |
| 51 | parts = append(parts, "SSHKey") |
| 52 | t &= ^CredentialTypeSSHKey |
| 53 | } |
| 54 | if (t & CredentialTypeSSHCustom) != 0 { |
| 55 | parts = append(parts, "SSHCustom") |
| 56 | t &= ^CredentialTypeSSHCustom |
| 57 | } |
| 58 | if (t & CredentialTypeDefault) != 0 { |
| 59 | parts = append(parts, "Default") |
| 60 | t &= ^CredentialTypeDefault |
| 61 | } |
| 62 | if (t & CredentialTypeSSHInteractive) != 0 { |
| 63 | parts = append(parts, "SSHInteractive") |
| 64 | t &= ^CredentialTypeSSHInteractive |
| 65 | } |
| 66 | if (t & CredentialTypeUsername) != 0 { |
| 67 | parts = append(parts, "Username") |
| 68 | t &= ^CredentialTypeUsername |
| 69 | } |
| 70 | if (t & CredentialTypeSSHMemory) != 0 { |
| 71 | parts = append(parts, "SSHMemory") |
| 72 | t &= ^CredentialTypeSSHMemory |
| 73 | } |
| 74 | |
| 75 | if t != 0 { |
| 76 | parts = append(parts, fmt.Sprintf("CredentialType(%#x)", t)) |
| 77 | } |
| 78 | |
| 79 | return strings.Join(parts, "|") |
| 80 | } |
| 81 | |
| 82 | type Credential struct { |
| 83 | doNotCompare |
nothing calls this directly
no outgoing calls
no test coverage detected