grinfo

package module
v0.0.0-...-9d1115b Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 10 Imported by: 0

README

grinfo

❯ grinfo --help
grinfo - find latest commits in local repositories and the corresponding remote repositories

Usage:

  grinfo [flags]

Flags:
  -buffer int
         (default 100)
  -worker int
         (default 4)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGit = errors.New("Git")
)

Functions

func IsDone

func IsDone(ctx context.Context) bool

Types

type Git

type Git struct {
	Dir string
}

func NewGit

func NewGit(dir string) *Git

func (*Git) Fetch

func (g *Git) Fetch(ctx context.Context) error

func (*Git) LatestRemoteCommitHash

func (g *Git) LatestRemoteCommitHash(ctx context.Context, url string) (string, error)

func (Git) Log

func (g Git) Log(ctx context.Context, revision string) (*GitLog, error)

func (*Git) RemoteOriginURL

func (g *Git) RemoteOriginURL(ctx context.Context) (string, error)

type GitLog

type GitLog struct {
	Hash      string
	Tree      string
	Parent    []string
	Author    GitLogMember
	Committer GitLogMember
	Message   string
}

type GitLogMember

type GitLogMember struct {
	Name    string
	Email   string
	Date    time.Time
	RelDate string
}

type Lines

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

func (*Lines) All

func (n *Lines) All(r io.Reader) iter.Seq[string]

func (Lines) Err

func (n Lines) Err() error

type Log

type Log struct {
	URL      string      `json:"url"`
	Dir      string      `json:"dir"`
	TimeDiff LogTimeDiff `json:"timediff"`
	Local    LogElement  `json:"local"`
	Remote   LogElement  `json:"remote"`
}

type LogElement

type LogElement struct {
	Hash      string    `json:"hash"`
	Tree      string    `json:"tree"`
	Parent    []string  `json:"parent"`
	Message   string    `json:"message"`
	Author    LogMember `json:"author"`
	Committer LogMember `json:"committer"`
}

type LogMember

type LogMember struct {
	Name      string `json:"name"`
	Email     string `json:"email"`
	RelDate   string `json:"reldate"`
	Date      string `json:"date"`
	Timestamp int64  `json:"timestamp"`
}

type LogTimeDiff

type LogTimeDiff struct {
	String string `json:"string"`
	Second int64  `json:"second"`
	Day    int    `json:"day"`
}

type Logger

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

func NewLogger

func NewLogger(cmd *Git) *Logger

func (*Logger) Get

func (l *Logger) Get(ctx context.Context) (*Log, error)

type Result

type Result struct {
	Err error
	Log *Log
}

type Worker

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

func NewWorker

func NewWorker(workerNum, bufferSize int) *Worker

func (*Worker) All

func (w *Worker) All(ctx context.Context, lines iter.Seq[string]) iter.Seq[*Result]

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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