Something went wrong on our end
Select Git revision
formatter.mjs
-
Volker Schukai authoredVolker Schukai authored
packages.go 7.91 KiB
//
// Copyright 2021, Kordian Bruck
//
// 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.
//
package gitlab
import (
"fmt"
"net/http"
"time"
)
// PackagesService handles communication with the packages related methods
// of the GitLab API.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/packages.html
type PackagesService struct {
client *Client
}
// Package represents a GitLab package.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/packages.html
type Package struct {
ID int `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
PackageType string `json:"package_type"`
Status string `json:"status"`
Links *PackageLinks `json:"_links"`
CreatedAt *time.Time `json:"created_at"`
LastDownloadedAt *time.Time `json:"last_downloaded_at"`
Tags []PackageTag `json:"tags"`
}
func (s Package) String() string {
return Stringify(s)
}
// GroupPackage represents a GitLab group package.
//
// GitLab API docs: https://docs.gitlab.com/ee/api/packages.html
type GroupPackage struct {
Package
ProjectID int `json:"project_id"`
ProjectPath string `json:"project_path"`
}
func (s GroupPackage) String() string {
return Stringify(s)
}
// PackageLinks holds links for itself and deleting.
type PackageLinks struct {
WebPath string `json:"web_path"`
DeleteAPIPath string `json:"delete_api_path"`
}