Documentation
¶
Index ¶
- Constants
- func SetLogger(l Logger)
- func UnmarshalErrorMessage(body []byte) error
- type ErrorMessage
- type GitlabGroup
- type GitlabProject
- type GitlabService
- func (s *GitlabService) ExportProject(project *GitlabProject, archiveFilePath string) (err error)
- func (s *GitlabService) GetGroup(groupID int) (res GitlabGroup, err error)
- func (s *GitlabService) GetProject(projectID int) (res GitlabProject, err error)
- func (s *GitlabService) GetProjectsLst(groupID int) (res []GitlabProject, err error)
- func (s *GitlabService) GetProjectsOfGroup(groupID int) (res []GitlabProject, err error)
- func (s *GitlabService) GetSubgroups(groupID int) (res []GitlabGroup, err error)
- func (r *GitlabService) SetGitlabEndpoint(gitlabApiEndpoint string)
- func (r *GitlabService) SetHttpClient(httpClient *http.Client)
- func (r *GitlabService) SetToken(token string)
- type Logger
- type ProjectAccessToken
Constants ¶
const GitlabApiEndpoint = "https://gitlab.com/api/v4"
Variables ¶
This section is empty.
Functions ¶
func UnmarshalErrorMessage ¶ added in v1.10.0
UnmarshalErrorMessage unmarshals the error message from the Gitlab API
Types ¶
type ErrorMessage ¶ added in v1.5.0
type ErrorMessage struct {
Message string `json:"message"`
}
ErrorMessage is a struct that contains an error message It is returned by the Gitlab API when an error occurs
type GitlabGroup ¶
GitlabGroup represents a Gitlab group https://docs.gitlab.com/ee/api/groups.html struct fields are not exhaustive - most of them won't be used
type GitlabProject ¶
type GitlabProject struct {
Id int `json:"id"`
Name string `json:"name"`
Archived bool `json:"archived"`
ExportStatus string `json:"export_status"`
}
GitlabProject represents a Gitlab project https://docs.gitlab.com/ee/api/projects.html struct fields are not exhaustive - most of them won't be used
type GitlabService ¶
type GitlabService struct {
// contains filtered or unexported fields
}
func NewGitlabService ¶
func NewGitlabService() *GitlabService
NewRequest returns a new GitlabService
func (*GitlabService) ExportProject ¶ added in v1.2.0
func (s *GitlabService) ExportProject(project *GitlabProject, archiveFilePath string) (err error)
SaveProject saves the project in the given storage
func (*GitlabService) GetGroup ¶
func (s *GitlabService) GetGroup(groupID int) (res GitlabGroup, err error)
GetGroup returns the gitlab group from the given ID
func (*GitlabService) GetProject ¶
func (s *GitlabService) GetProject(projectID int) (res GitlabProject, err error)
GetProject returns informations of the project that matches the given ID
func (*GitlabService) GetProjectsLst ¶ added in v1.2.0
func (s *GitlabService) GetProjectsLst(groupID int) (res []GitlabProject, err error)
GetProjectsLst returns the list of projects of the group
func (*GitlabService) GetProjectsOfGroup ¶ added in v1.10.0
func (s *GitlabService) GetProjectsOfGroup(groupID int) (res []GitlabProject, err error)
GetProjectsOfGroup returns the list of every projects of the group and subgroups
func (*GitlabService) GetSubgroups ¶ added in v1.10.0
func (s *GitlabService) GetSubgroups(groupID int) (res []GitlabGroup, err error)
GetSubgroups returns the list of subgroups of the group It's a recursive function that will return all subgroups of the group
func (*GitlabService) SetGitlabEndpoint ¶
func (r *GitlabService) SetGitlabEndpoint(gitlabApiEndpoint string)
SetGitlabEndpoint sets the Gitlab API endpoint default: https://gitlab.com/v4/api/
func (*GitlabService) SetHttpClient ¶
func (r *GitlabService) SetHttpClient(httpClient *http.Client)
SetHttpClient sets the http client default: http.Client{}
func (*GitlabService) SetToken ¶
func (r *GitlabService) SetToken(token string)
SetToken sets the Gitlab API token default: GITLAB_TOKEN env variable
type ProjectAccessToken ¶ added in v1.10.0
type ProjectAccessToken struct {
Id int `json:"id"`
Name string `json:"name"`
Revoked bool `json:"revoked"`
CreatedAt string `json:"created_at"`
Scopes []string `json:"scopes"`
UserId int `json:"user_id"`
LastUsedAt string `json:"last_used_at"`
Active bool `json:"active"`
ExpiresAt string `json:"expires_at"`
AccessLevel int `json:"access_level"`
}
GetProject returns the gitlab project from the given ID