Documentation ¶
Overview ¶
* Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
Constants ¶
const ( ZipUrlPattern = "https://%s/api/v4/projects/%s/repository/archive.zip?sha=%s" TagsUrlPattern = "https://%s/api/v4/projects/%s/releases" LatestTagUrlPattern = "https://%s/api/v4/projects/%s/releases?per_page=1&page=1" )
Variables ¶
This section is empty.
Functions ¶
func NewRepoInfo ¶
NewRepoInfo returns the RepoInfo built by repository url Repository url e.g. https://gitlab.com/{{owner}}/{{repo}}
Types ¶
type DefaultRepoInfo ¶
type DefaultRepoInfo struct {
// contains filtered or unexported fields
}
func (DefaultRepoInfo) LatestTagUrl ¶
func (in DefaultRepoInfo) LatestTagUrl() string
LatestTagUrl returns the Gitlab API URL for get latest tag release e.g. https://yourhost/api/v4/projects/{{owner}}%2F{{repo}}/releases?page=1&size=1
func (DefaultRepoInfo) TagsUrl ¶
func (in DefaultRepoInfo) TagsUrl() string
TagsUrl returns the Gitlab API URL for get all tags e.g. https://yourhost/api/v4/projects/{{owner}}%2F{{repo}}/releases
func (DefaultRepoInfo) Token ¶
func (in DefaultRepoInfo) Token() string
func (DefaultRepoInfo) TokenHeader ¶
func (in DefaultRepoInfo) TokenHeader() string
TokenHeader returns the Authorization value formatted for Gitlab API integration e.g. "f39c5aca-858f-4a04-9ca3-5104d02b9c56"
func (DefaultRepoInfo) ZipUrl ¶
func (in DefaultRepoInfo) ZipUrl(version string) string
ZipUrl returns the Gitlab API URL for download zipball repository e.g. https://yourhost/{{owner}}/{{repo}}/-/archive/{{tag-version}}/{{repo}}-{{tag-version}}.zip
type RepoManager ¶
type RepoManager struct {
// contains filtered or unexported fields
}
func NewRepoManager ¶
func NewRepoManager(client *http.Client) RepoManager
func (RepoManager) Zipball ¶
func (re RepoManager) Zipball(info git.RepoInfo, version string) (io.ReadCloser, error)