git

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHead

func GetHead(mrs []*MergeRequest, head string) string

func GetSQL

func GetSQL(mrs []*MergeRequest) string

func GroupByPrefix

func GroupByPrefix(mrs []*MergeRequest) map[string][]*MergeRequest

func Select

func Select(tags []*Tag, query string) ([]*Tag, *Tag, error)

Types

type Diff

type Diff struct {
	OldPath     string `json:"old_path"`
	NewPath     string `json:"new_path"`
	AMode       string `json:"a_mode"`
	BMode       string `json:"b_mode"`
	Diff        string `json:"diff"`
	NewFile     bool   `json:"new_file"`
	RenamedFile bool   `json:"renamed_file"`
	DeletedFile bool   `json:"deleted_file"`
}

func (Diff) String

func (d Diff) String() string

type GitClient

type GitClient interface {
	GetTags() []*Tag
	GetMergeRequests(from, end *Tag) []*MergeRequest
	CreateTag(tag string, desc string)
	GetMRChanges(mr *MergeRequest)
}

type MergeRequest

type MergeRequest struct {
	ID          int
	IID         int
	Title       string     `json:"title"`
	MergedAt    *time.Time `json:"merged_at"`
	Description string     `json:"description"`
	Changes     []Diff
	Author      string `json:"author"`
	SHA         string `json:"sha"`
	WebURL      string `json:"web_url"`
}

func (*MergeRequest) GetChangeSQL

func (m *MergeRequest) GetChangeSQL() string

func (*MergeRequest) GetHeadChange

func (m *MergeRequest) GetHeadChange(title string) string

type Tag

type Tag struct {
	Name     string
	Subject  string
	Date     time.Time
	Next     *Tag
	Previous *Tag
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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