Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrAuthInfoInvalidXML = errors.New("invalid XML")
)
Functions ¶
This section is empty.
Types ¶
type AuthInfo ¶
type AuthInfo interface { // CreateGitlabClient returns a new Gitlab Client based on the // authentication information provided by the user. The options // parameter is the same "options" parameter that is passed into // the gitlab.New*Client() methods which can be used to tailor the // client for the user's purpose. CreateGitlabClient(options ...gitlab.ClientOptionFunc) (*gitlab.Client, error) }
Interface implemented by types that return information used for authentication.
type BasicAuthInfo ¶
BasicAuthInfo holds username and password used for HTTP basic authentication.
func NewBasicAuthInfo ¶
func NewBasicAuthInfo(username, password string) BasicAuthInfo
NewBasicAuthInfo creates a new set of authentication information for HTTP basic authentication.
func NewBasicAuthInfoFromXML ¶
func NewBasicAuthInfoFromXML(r io.Reader) (BasicAuthInfo, error)
NewBasicAuthInfoFromXML creates a new set of authentication information for HTTP basic authentication from the XML accessible through the io.Reader. The format of the XML is as follows:
<AuthInfo> <username></username> <password></password> </AuthInfo>
func (*BasicAuthInfo) CreateGitlabClient ¶
func (authInfo *BasicAuthInfo) CreateGitlabClient(options ...gitlab.ClientOptionFunc) (*gitlab.Client, error)
CreateGitlabClient returns a new Gitlab Client that uses HTTP basic authentication. The options parameter is the same "options" parameter that is passed into the gitlab.New*Client() methods which can be used to tailor the client for the user's purpose.
type OAuthToken ¶
type OAuthToken struct {
Token string `xml:"oauth-token"`
}
OAuthToken holds an OAuth access token.
func NewOAuthToken ¶
func NewOAuthToken(token string) OAuthToken
NewOAuthToken creates a new set of authentication information for OAuth authentication.
func NewOAuthTokenFromXML ¶
func NewOAuthTokenFromXML(r io.Reader) (OAuthToken, error)
NewOAuthTokenFromXML creates a new set of authentication information for OAuth authentication from the XML accessible through the io.Reader. The format of the XML is as follows:
<AuthInfo> <oauth-token></oauth-token> </AuthInfo>
func (*OAuthToken) CreateGitlabClient ¶
func (token *OAuthToken) CreateGitlabClient(options ...gitlab.ClientOptionFunc) (*gitlab.Client, error)
CreateGitlabClient returns a new Gitlab Client that uses OAuth authentication. The options parameter is the same "options" parameter that is passed into the gitlab.New*Client() methods which can be used to tailor the client for the user's purpose.
type PrivateToken ¶
type PrivateToken struct {
Token string `xml:"private-token"`
}
PrivateToken holds a private or personal access token.
func NewPrivateToken ¶
func NewPrivateToken(token string) PrivateToken
NewPrivateToken creates a new set of authentication information for private token or personal token authentication.
func NewPrivateTokenFromXML ¶
func NewPrivateTokenFromXML(r io.Reader) (PrivateToken, error)
NewPrivateTokenFromXML creates a new set of authentication information for private token or personal token authentication from the XML accessible through the io.Reader. The format of the XML is as follows:
<AuthInfo> <private-token></private-token> <AuthInfo>
func (*PrivateToken) CreateGitlabClient ¶
func (token *PrivateToken) CreateGitlabClient(options ...gitlab.ClientOptionFunc) (*gitlab.Client, error)
CreateGitlabClient returns a new Gitlab Client that uses private token or personal token authentication. The options parameter is the same "options" parameter that is passed into the gitlab.New*Client() methods which can be used to tailor the client for the user's purpose.