1
0
Fork 0
forked from forgejo/forgejo

Vendor Update: go-gitlab v0.22.1 -> v0.31.0 (#11136)

* vendor update: go-gitlab to v0.31.0

* migrate client init to v0.31.0

* refactor
This commit is contained in:
6543 2020-04-19 22:23:05 +02:00 committed by GitHub
parent 5c092eb0ef
commit 82dbb34c9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
256 changed files with 36039 additions and 12965 deletions

View file

@ -44,6 +44,7 @@ type ProjectCluster struct {
ClusterType string `json:"cluster_type"`
User *User `json:"user"`
PlatformKubernetes *PlatformKubernetes `json:"platform_kubernetes"`
ManagementProject *ManagementProject `json:"management_project"`
Project *Project `json:"project"`
}
@ -60,11 +61,22 @@ type PlatformKubernetes struct {
AuthorizationType string `json:"authorization_type"`
}
// ManagementProject represents a GitLab Project Cluster management_project.
type ManagementProject struct {
ID int `json:"id"`
Description string `json:"description"`
Name string `json:"name"`
NameWithNamespace string `json:"name_with_namespace"`
Path string `json:"path"`
PathWithNamespace string `json:"path_with_namespace"`
CreatedAt *time.Time `json:"created_at"`
}
// ListClusters gets a list of all clusters in a project.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/project_clusters.html#list-project-clusters
func (s *ProjectClustersService) ListClusters(pid interface{}, options ...OptionFunc) ([]*ProjectCluster, *Response, error) {
func (s *ProjectClustersService) ListClusters(pid interface{}, options ...RequestOptionFunc) ([]*ProjectCluster, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@ -89,7 +101,7 @@ func (s *ProjectClustersService) ListClusters(pid interface{}, options ...Option
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/project_clusters.html#get-a-single-project-cluster
func (s *ProjectClustersService) GetCluster(pid interface{}, cluster int, options ...OptionFunc) (*ProjectCluster, *Response, error) {
func (s *ProjectClustersService) GetCluster(pid interface{}, cluster int, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@ -115,12 +127,13 @@ func (s *ProjectClustersService) GetCluster(pid interface{}, cluster int, option
// GitLab API docs:
// https://docs.gitlab.com/ee/api/project_clusters.html#add-existing-cluster-to-project
type AddClusterOptions struct {
Name *string `url:"name,omitempty" json:"name,omitempty"`
Domain *string `url:"domain,omitempty" json:"domain,omitempty"`
Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"`
Managed *bool `url:"managed,omitempty" json:"managed,omitempty"`
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
PlatformKubernetes *AddPlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"`
Name *string `url:"name,omitempty" json:"name,omitempty"`
Domain *string `url:"domain,omitempty" json:"domain,omitempty"`
Enabled *bool `url:"enabled,omitempty" json:"enabled,omitempty"`
Managed *bool `url:"managed,omitempty" json:"managed,omitempty"`
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
PlatformKubernetes *AddPlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"`
ManagementProjectID *string `url:"management_project_id,omitempty" json:"management_project_id,omitempty"`
}
// AddPlatformKubernetesOptions represents the available PlatformKubernetes options for adding.
@ -136,7 +149,7 @@ type AddPlatformKubernetesOptions struct {
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/project_clusters.html#add-existing-cluster-to-project
func (s *ProjectClustersService) AddCluster(pid interface{}, opt *AddClusterOptions, options ...OptionFunc) (*ProjectCluster, *Response, error) {
func (s *ProjectClustersService) AddCluster(pid interface{}, opt *AddClusterOptions, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@ -162,10 +175,11 @@ func (s *ProjectClustersService) AddCluster(pid interface{}, opt *AddClusterOpti
// GitLab API docs:
// https://docs.gitlab.com/ee/api/project_clusters.html#edit-project-cluster
type EditClusterOptions struct {
Name *string `url:"name,omitempty" json:"name,omitempty"`
Domain *string `url:"domain,omitempty" json:"domain,omitempty"`
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
PlatformKubernetes *EditPlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"`
Name *string `url:"name,omitempty" json:"name,omitempty"`
Domain *string `url:"domain,omitempty" json:"domain,omitempty"`
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
ManagementProjectID *string `url:"management_project_id,omitempty" json:"management_project_id,omitempty"`
PlatformKubernetes *EditPlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"`
}
// EditPlatformKubernetesOptions represents the available PlatformKubernetes options for editing.
@ -180,7 +194,7 @@ type EditPlatformKubernetesOptions struct {
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/project_clusters.html#edit-project-cluster
func (s *ProjectClustersService) EditCluster(pid interface{}, cluster int, opt *EditClusterOptions, options ...OptionFunc) (*ProjectCluster, *Response, error) {
func (s *ProjectClustersService) EditCluster(pid interface{}, cluster int, opt *EditClusterOptions, options ...RequestOptionFunc) (*ProjectCluster, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
@ -205,7 +219,7 @@ func (s *ProjectClustersService) EditCluster(pid interface{}, cluster int, opt *
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/project_clusters.html#delete-project-cluster
func (s *ProjectClustersService) DeleteCluster(pid interface{}, cluster int, options ...OptionFunc) (*Response, error) {
func (s *ProjectClustersService) DeleteCluster(pid interface{}, cluster int, options ...RequestOptionFunc) (*Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, err