Skip to content
Snippets Groups Projects
Select Git revision
  • 6437439b0802db61767d06cd7b7f54dc4d45a2df
  • master default protected
  • 1.31
  • 4.25.3
  • 4.25.2
  • 4.25.1
  • 4.25.0
  • 4.24.3
  • 4.24.2
  • 4.24.1
  • 4.24.0
  • 4.23.6
  • 4.23.5
  • 4.23.4
  • 4.23.3
  • 4.23.2
  • 4.23.1
  • 4.23.0
  • 4.22.3
  • 4.22.2
  • 4.22.1
  • 4.22.0
  • 4.21.0
23 results

formatter.mjs

Blame
  • 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"`
    }