Documentation ¶
Index ¶
- func PrepareForCreateCredential(roundTripper *mhttp.MockRoundTripper, ...)
- func PrepareForCreateSecretCredential(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store string, ...)
- func PrepareForCreateUsernamePasswordCredential(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store string, ...)
- func PrepareForCredentialListJSON() string
- func PrepareForDeleteCredential(roundTripper *mhttp.MockRoundTripper, ...)
- func PrepareForGetCredentialList(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store string)
- type Credential
- type CredentialsManager
- func (c *CredentialsManager) Create(store, credential string) (err error)
- func (c *CredentialsManager) CreateSecret(store string, cred StringCredentials) (err error)
- func (c *CredentialsManager) CreateUsernamePassword(store string, cred UsernamePasswordCredential) (err error)
- func (c *CredentialsManager) Delete(store, id string) (err error)
- func (c *CredentialsManager) GetList(store string) (credentialList List, err error)
- type List
- type StringCredentials
- type UsernamePasswordCredential
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrepareForCreateCredential ¶
func PrepareForCreateCredential(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store, credential string)
PrepareForCreateCredential only for test
func PrepareForCreateSecretCredential ¶
func PrepareForCreateSecretCredential(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store string, cred StringCredentials)
PrepareForCreateSecretCredential only for test
func PrepareForCreateUsernamePasswordCredential ¶
func PrepareForCreateUsernamePasswordCredential(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store string, cred UsernamePasswordCredential)
PrepareForCreateUsernamePasswordCredential only for test
func PrepareForCredentialListJSON ¶
func PrepareForCredentialListJSON() string
PrepareForCredentialListJSON only for test
func PrepareForDeleteCredential ¶
func PrepareForDeleteCredential(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store, id string)
PrepareForDeleteCredential only for test
func PrepareForGetCredentialList ¶
func PrepareForGetCredentialList(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store string)
PrepareForGetCredentialList only for test
Types ¶
type Credential ¶
type Credential struct { Description string `json:"description"` DisplayName string Fingerprint interface{} FullName string ID string `json:"id"` TypeName string Class string `json:"$class"` Scope string `json:"scope"` }
Credential of Jenkins
type CredentialsManager ¶
type CredentialsManager struct {
core.JenkinsCore
}
CredentialsManager hold the info of credentials client
func (*CredentialsManager) Create ¶
func (c *CredentialsManager) Create(store, credential string) (err error)
Create create a credential in Jenkins
func (*CredentialsManager) CreateSecret ¶
func (c *CredentialsManager) CreateSecret(store string, cred StringCredentials) (err error)
CreateSecret create token credential in Jenkins
func (*CredentialsManager) CreateUsernamePassword ¶
func (c *CredentialsManager) CreateUsernamePassword(store string, cred UsernamePasswordCredential) (err error)
CreateUsernamePassword create username and password credential in Jenkins
func (*CredentialsManager) Delete ¶
func (c *CredentialsManager) Delete(store, id string) (err error)
Delete removes a credential by id from a store
type List ¶
type List struct { Description string DisplayName string FullDisplayName string FullName string Global bool URLName string Credentials []Credential }
List contains many credentials
type StringCredentials ¶
type StringCredentials struct { Credential `json:",inline"` Secret string `json:"secret"` }
StringCredentials hold a token
type UsernamePasswordCredential ¶
type UsernamePasswordCredential struct { Credential `json:",inline"` Username string `json:"username"` Password string `json:"password"` }
UsernamePasswordCredential hold the username and password