cmd

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

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 © 2022 NAME HERE <EMAIL ADDRESS>

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 © 2022 NAME HERE <EMAIL ADDRESS>

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 © 2021 NAME HERE <EMAIL ADDRESS>

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

This section is empty.

Variables

This section is empty.

Functions

func CreateMR added in v0.0.5

func CreateMR(projectID int, title string, src string, dst string, description string, squash bool, removeSource bool) (string, error)

func CreateMR(projectID int, title string, body string, src string, dst string) (string, error) {

func Execute

func Execute()

func ReadWorkTreeRef added in v0.0.5

func ReadWorkTreeRef(filePath string) (string, error)

Types

type MergeRequest added in v0.0.5

type MergeRequest struct {
	ID               int        `json:"id"`
	IID              int        `json:"iid"`
	TargetBranch     string     `json:"target_branch"`
	SourceBranch     string     `json:"source_branch"`
	ProjectID        int        `json:"project_id"`
	Title            string     `json:"title"`
	State            string     `json:"state"`
	CreatedAt        *time.Time `json:"created_at"`
	UpdatedAt        *time.Time `json:"updated_at"`
	Description      string     `json:"description"`
	MergeStatus      string     `json:"merge_status"`
	MergeError       string     `json:"merge_error"`
	MergedAt         *time.Time `json:"merged_at"`
	ClosedAt         *time.Time `json:"closed_at"`
	HasConflicts     bool       `json:"has_conflicts"`
	WebURL           string     `json:"web_url"`
	Error            string     `json:"error"`
	ErrorDescription string     `json:"error_description"`
	Scope            string     `json:"scope"`
}

MergeRequest represents a GitLab merge request.

GitLab API docs: https://docs.gitlab.com/ce/api/merge_requests.html

type Pipeline

type Pipeline []struct {
	ID        int       `json:"id"`
	ProjectID int       `json:"project_id"`
	Sha       string    `json:"sha"`
	Ref       string    `json:"ref"`
	Status    string    `json:"status"`
	Source    string    `json:"source"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	WebURL    string    `json:"web_url"`
}

type PipelineJob

type PipelineJob []struct {
	ID             int         `json:"id"`
	Status         string      `json:"status"`
	Stage          string      `json:"stage"`
	Name           string      `json:"name"`
	Ref            string      `json:"ref"`
	Tag            bool        `json:"tag"`
	Coverage       interface{} `json:"coverage"`
	AllowFailure   bool        `json:"allow_failure"`
	CreatedAt      time.Time   `json:"created_at"`
	StartedAt      time.Time   `json:"started_at"`
	FinishedAt     time.Time   `json:"finished_at"`
	Duration       float64     `json:"duration"`
	QueuedDuration float64     `json:"queued_duration"`
	User           struct {
		ID              int         `json:"id"`
		Name            string      `json:"name"`
		Username        string      `json:"username"`
		State           string      `json:"state"`
		AvatarURL       string      `json:"avatar_url"`
		WebURL          string      `json:"web_url"`
		CreatedAt       time.Time   `json:"created_at"`
		Bio             string      `json:"bio"`
		BioHTML         string      `json:"bio_html"`
		Location        string      `json:"location"`
		PublicEmail     string      `json:"public_email"`
		Skype           string      `json:"skype"`
		Linkedin        string      `json:"linkedin"`
		Twitter         string      `json:"twitter"`
		WebsiteURL      string      `json:"website_url"`
		Organization    string      `json:"organization"`
		JobTitle        string      `json:"job_title"`
		Pronouns        string      `json:"pronouns"`
		Bot             bool        `json:"bot"`
		WorkInformation interface{} `json:"work_information"`
		Followers       int         `json:"followers"`
		Following       int         `json:"following"`
	} `json:"user"`
	Commit struct {
		ID             string    `json:"id"`
		ShortID        string    `json:"short_id"`
		CreatedAt      time.Time `json:"created_at"`
		ParentIds      []string  `json:"parent_ids"`
		Title          string    `json:"title"`
		Message        string    `json:"message"`
		AuthorName     string    `json:"author_name"`
		AuthorEmail    string    `json:"author_email"`
		AuthoredDate   time.Time `json:"authored_date"`
		CommitterName  string    `json:"committer_name"`
		CommitterEmail string    `json:"committer_email"`
		CommittedDate  time.Time `json:"committed_date"`
		Trailers       struct {
		} `json:"trailers"`
		WebURL string `json:"web_url"`
	} `json:"commit"`
	Pipeline struct {
		ID        int       `json:"id"`
		ProjectID int       `json:"project_id"`
		Sha       string    `json:"sha"`
		Ref       string    `json:"ref"`
		Status    string    `json:"status"`
		Source    string    `json:"source"`
		CreatedAt time.Time `json:"created_at"`
		UpdatedAt time.Time `json:"updated_at"`
		WebURL    string    `json:"web_url"`
	} `json:"pipeline"`
	WebURL    string `json:"web_url"`
	Artifacts []struct {
		FileType   string      `json:"file_type"`
		Size       int         `json:"size"`
		Filename   string      `json:"filename"`
		FileFormat interface{} `json:"file_format"`
	} `json:"artifacts"`
	Runner struct {
		ID          int    `json:"id"`
		Description string `json:"description"`
		IPAddress   string `json:"ip_address"`
		Active      bool   `json:"active"`
		IsShared    bool   `json:"is_shared"`
		RunnerType  string `json:"runner_type"`
		Name        string `json:"name"`
		Online      bool   `json:"online"`
		Status      string `json:"status"`
	} `json:"runner"`
	ArtifactsExpireAt interface{} `json:"artifacts_expire_at"`
	TagList           []string    `json:"tag_list"`
}

type Project

type Project []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"`
	DefaultBranch     string        `json:"default_branch"`
	TagList           []interface{} `json:"tag_list"`
	Topics            []interface{} `json:"topics"`
	SSHURLToRepo      string        `json:"ssh_url_to_repo"`
	HTTPURLToRepo     string        `json:"http_url_to_repo"`
	WebURL            string        `json:"web_url"`
	ReadmeURL         string        `json:"readme_url"`
	AvatarURL         interface{}   `json:"avatar_url"`
	ForksCount        int           `json:"forks_count"`
	StarCount         int           `json:"star_count"`
	LastActivityAt    time.Time     `json:"last_activity_at"`
	Namespace         struct {
		ID        int         `json:"id"`
		Name      string      `json:"name"`
		Path      string      `json:"path"`
		Kind      string      `json:"kind"`
		FullPath  string      `json:"full_path"`
		ParentID  int         `json:"parent_id"`
		AvatarURL interface{} `json:"avatar_url"`
		WebURL    string      `json:"web_url"`
	} `json:"namespace"`
	ContainerRegistryImagePrefix string `json:"container_registry_image_prefix"`
	Links                        struct {
		Self          string `json:"self"`
		Issues        string `json:"issues"`
		MergeRequests string `json:"merge_requests"`
		RepoBranches  string `json:"repo_branches"`
		Labels        string `json:"labels"`
		Events        string `json:"events"`
		Members       string `json:"members"`
	} `json:"_links"`
	PackagesEnabled                bool   `json:"packages_enabled"`
	EmptyRepo                      bool   `json:"empty_repo"`
	Archived                       bool   `json:"archived"`
	Visibility                     string `json:"visibility"`
	ResolveOutdatedDiffDiscussions bool   `json:"resolve_outdated_diff_discussions"`
	ContainerExpirationPolicy      struct {
		Cadence       string      `json:"cadence"`
		Enabled       bool        `json:"enabled"`
		KeepN         int         `json:"keep_n"`
		OlderThan     string      `json:"older_than"`
		NameRegex     string      `json:"name_regex"`
		NameRegexKeep interface{} `json:"name_regex_keep"`
		NextRunAt     time.Time   `json:"next_run_at"`
	} `json:"container_expiration_policy"`
	IssuesEnabled                             bool          `json:"issues_enabled"`
	MergeRequestsEnabled                      bool          `json:"merge_requests_enabled"`
	WikiEnabled                               bool          `json:"wiki_enabled"`
	JobsEnabled                               bool          `json:"jobs_enabled"`
	SnippetsEnabled                           bool          `json:"snippets_enabled"`
	ContainerRegistryEnabled                  bool          `json:"container_registry_enabled"`
	ServiceDeskEnabled                        bool          `json:"service_desk_enabled"`
	ServiceDeskAddress                        string        `json:"service_desk_address"`
	CanCreateMergeRequestIn                   bool          `json:"can_create_merge_request_in"`
	IssuesAccessLevel                         string        `json:"issues_access_level"`
	RepositoryAccessLevel                     string        `json:"repository_access_level"`
	MergeRequestsAccessLevel                  string        `json:"merge_requests_access_level"`
	ForkingAccessLevel                        string        `json:"forking_access_level"`
	WikiAccessLevel                           string        `json:"wiki_access_level"`
	BuildsAccessLevel                         string        `json:"builds_access_level"`
	SnippetsAccessLevel                       string        `json:"snippets_access_level"`
	PagesAccessLevel                          string        `json:"pages_access_level"`
	OperationsAccessLevel                     string        `json:"operations_access_level"`
	AnalyticsAccessLevel                      string        `json:"analytics_access_level"`
	ContainerRegistryAccessLevel              string        `json:"container_registry_access_level"`
	EmailsDisabled                            interface{}   `json:"emails_disabled"`
	SharedRunnersEnabled                      bool          `json:"shared_runners_enabled"`
	LfsEnabled                                bool          `json:"lfs_enabled"`
	CreatorID                                 int           `json:"creator_id"`
	ImportStatus                              string        `json:"import_status"`
	OpenIssuesCount                           int           `json:"open_issues_count"`
	CiDefaultGitDepth                         int           `json:"ci_default_git_depth"`
	CiForwardDeploymentEnabled                bool          `json:"ci_forward_deployment_enabled"`
	CiJobTokenScopeEnabled                    bool          `json:"ci_job_token_scope_enabled"`
	PublicJobs                                bool          `json:"public_jobs"`
	BuildTimeout                              int           `json:"build_timeout"`
	AutoCancelPendingPipelines                string        `json:"auto_cancel_pending_pipelines"`
	BuildCoverageRegex                        interface{}   `json:"build_coverage_regex"`
	CiConfigPath                              string        `json:"ci_config_path"`
	SharedWithGroups                          []interface{} `json:"shared_with_groups"`
	OnlyAllowMergeIfPipelineSucceeds          bool          `json:"only_allow_merge_if_pipeline_succeeds"`
	AllowMergeOnSkippedPipeline               interface{}   `json:"allow_merge_on_skipped_pipeline"`
	RestrictUserDefinedVariables              bool          `json:"restrict_user_defined_variables"`
	RequestAccessEnabled                      bool          `json:"request_access_enabled"`
	OnlyAllowMergeIfAllDiscussionsAreResolved bool          `json:"only_allow_merge_if_all_discussions_are_resolved"`
	RemoveSourceBranchAfterMerge              bool          `json:"remove_source_branch_after_merge"`
	PrintingMergeRequestLinkEnabled           bool          `json:"printing_merge_request_link_enabled"`
	MergeMethod                               string        `json:"merge_method"`
	SquashOption                              string        `json:"squash_option"`
	SuggestionCommitMessage                   interface{}   `json:"suggestion_commit_message"`
	AutoDevopsEnabled                         bool          `json:"auto_devops_enabled"`
	AutoDevopsDeployStrategy                  string        `json:"auto_devops_deploy_strategy"`
	AutocloseReferencedIssues                 bool          `json:"autoclose_referenced_issues"`
	KeepLatestArtifact                        bool          `json:"keep_latest_artifact"`
	ExternalAuthorizationClassificationLabel  string        `json:"external_authorization_classification_label"`
	RequirementsEnabled                       bool          `json:"requirements_enabled"`
	SecurityAndComplianceEnabled              bool          `json:"security_and_compliance_enabled"`
	ComplianceFrameworks                      []interface{} `json:"compliance_frameworks"`
}

type WorktreeRef added in v0.0.5

type WorktreeRef struct {
	Gitdir string `yaml:"gitdir"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL