git

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentBranch

func GetCurrentBranch() (string, error)

func GetDevelopmentBranch added in v0.4.0

func GetDevelopmentBranch() (string, error)

func GetGitLabProjectNamespace added in v0.4.0

func GetGitLabProjectNamespace() (string, error)

func GetLocalBranches added in v0.4.0

func GetLocalBranches() ([]string, error)

func GetRemoteBranches added in v0.4.0

func GetRemoteBranches() ([]string, error)

func GetRemoteURL added in v0.4.0

func GetRemoteURL() (string, error)

func ParseIssueKey

func ParseIssueKey(param string) (string, error)

TODO: Probably not here

Types

type Gist

type Gist struct {
	ID    string              `json:"id"`
	Files map[string]GistFile `json:"files"`
}

type GistFile

type GistFile struct {
	Filename string `json:"filename"`
	Type     string `json:"type"`
	Language string `json:"language"`
	RawURL   string `json:"raw_url"`
	Size     int    `json:"size"`
	Content  string `json:"content"`
	Encoding string `json:"encoding"`
}

type GitClient

type GitClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg *config.Config) *GitClient

func (*GitClient) GetGist

func (c *GitClient) GetGist(id string) (*Gist, error)

type GitLabClient added in v0.4.0

type GitLabClient struct {
	// contains filtered or unexported fields
}

func NewGitLabClient added in v0.4.0

func NewGitLabClient(cfg *config.Config) *GitLabClient

func (*GitLabClient) CacheProjectID added in v0.4.0

func (c *GitLabClient) CacheProjectID(namespace string, id int) error

func (*GitLabClient) CreateMergeRequest added in v0.4.0

func (c *GitLabClient) CreateMergeRequest(namespace string, payload map[string]interface{}) (*MergeRequest, error)

func (*GitLabClient) GetCachedProjectID added in v0.4.0

func (c *GitLabClient) GetCachedProjectID(namespace string) (int, error)

func (*GitLabClient) GetMergeRequests added in v0.4.0

func (c *GitLabClient) GetMergeRequests(namespace, sourceBranch string) ([]MergeRequest, error)

func (*GitLabClient) GetPipelines added in v0.4.0

func (c *GitLabClient) GetPipelines(projectID int, branch string) ([]Pipeline, error)

func (*GitLabClient) GetProjectByNamespace added in v0.4.0

func (c *GitLabClient) GetProjectByNamespace(namespace string) (*Project, error)

type MergeRequest added in v0.4.0

type MergeRequest struct {
	ID           int    `json:"id"`
	IID          int    `json:"iid"`
	ProjectID    int    `json:"project_id"`
	Title        string `json:"title"`
	Description  string `json:"description"`
	State        string `json:"state"`
	WebURL       string `json:"web_url"`
	SourceBranch string `json:"source_branch"`
	TargetBranch string `json:"target_branch"`
	References   struct {
		Full string `json:"full"`
	} `json:"references"`
}

type Pipeline added in v0.4.0

type Pipeline struct {
	ID        int       `json:"id"`
	Status    string    `json:"status"`
	Source    string    `json:"source"`
	Ref       string    `json:"ref"`
	WebURL    string    `json:"web_url"`
	Duration  int       `json:"duration"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Project added in v0.4.0

type Project struct {
	ID                int    `json:"id"`
	Name              string `json:"name"`
	PathWithNamespace string `json:"path_with_namespace"`
}

type ProjectMap added in v0.4.0

type ProjectMap struct {
	Namespaces map[string]int `json:"map"`
}

Jump to

Keyboard shortcuts

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