repo

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateRefCmd

func UpdateRefCmd(repo proto.Repository) tea.Cmd

UpdateRefCmd gets the repository's HEAD reference and sends a RefMsg.

Types

type CopyMsg

type CopyMsg struct {
	Text    string
	Message string
}

CopyMsg is a message to indicate copied text.

type CopyURLMsg

type CopyURLMsg struct{}

CopyURLMsg is a message to copy the URL of the current repository.

type EmptyRepoMsg

type EmptyRepoMsg struct{}

EmptyRepoMsg is a message to indicate that the repository is empty.

type FileBlameMsg

type FileBlameMsg *gitm.Blame

FileBlameMsg is a message that contains the blame of a file.

type FileContentMsg

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

FileContentMsg is a message that contains the content of a file.

type FileItem

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

FileItem is a list item for a file.

func (FileItem) Description

func (i FileItem) Description() string

Description returns the description of the file item.

func (FileItem) FilterValue

func (i FileItem) FilterValue() string

FilterValue implements list.Item.

func (FileItem) ID

func (i FileItem) ID() string

ID returns the ID of the file item.

func (FileItem) Mode

func (i FileItem) Mode() fs.FileMode

Mode returns the mode of the file item.

func (FileItem) Title

func (i FileItem) Title() string

Title returns the title of the file item.

type FileItemDelegate

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

FileItemDelegate is the delegate for the file item list.

func (FileItemDelegate) Height

func (d FileItemDelegate) Height() int

Height returns the height of the file item list. Implements list.ItemDelegate.

func (FileItemDelegate) Render

func (d FileItemDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

Render implements list.ItemDelegate.

func (FileItemDelegate) Spacing

func (d FileItemDelegate) Spacing() int

Spacing returns the spacing of the file item list. Implements list.ItemDelegate.

func (FileItemDelegate) Update

func (d FileItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

Update implements list.ItemDelegate.

type FileItems

type FileItems []FileItem

FileItems is a list of file items.

func (FileItems) Len

func (cl FileItems) Len() int

Len implements sort.Interface.

func (FileItems) Less

func (cl FileItems) Less(i, j int) bool

Less implements sort.Interface.

func (FileItems) Swap

func (cl FileItems) Swap(i, j int)

Swap implements sort.Interface.

type FileItemsMsg

type FileItemsMsg []selector.IdentifiableItem

FileItemsMsg is a message that contains a list of files.

type Files

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

Files is the model for the files view.

func NewFiles

func NewFiles(common common.Common) *Files

NewFiles creates a new files model.

func (*Files) FullHelp

func (f *Files) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Files) Init

func (f *Files) Init() tea.Cmd

Init implements tea.Model.

func (*Files) Path added in v0.7.4

func (f *Files) Path() string

Path implements common.TabComponent.

func (*Files) SetSize

func (f *Files) SetSize(width, height int)

SetSize implements common.Component.

func (*Files) ShortHelp

func (f *Files) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*Files) SpinnerID

func (f *Files) SpinnerID() int

SpinnerID implements common.TabComponent.

func (*Files) StatusBarInfo

func (f *Files) StatusBarInfo() string

StatusBarInfo returns the status bar info.

func (*Files) StatusBarValue

func (f *Files) StatusBarValue() string

StatusBarValue returns the status bar value.

func (*Files) TabName

func (f *Files) TabName() string

TabName returns the tab name.

func (*Files) Update

func (f *Files) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Files) View

func (f *Files) View() string

View implements tea.Model.

type GoBackMsg

type GoBackMsg struct{}

GoBackMsg is a message to go back to the previous view.

type Log

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

Log is a model that displays a list of commits and their diffs.

func NewLog

func NewLog(common common.Common) *Log

NewLog creates a new Log model.

func (*Log) FullHelp

func (l *Log) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Log) Init

func (l *Log) Init() tea.Cmd

Init implements tea.Model.

func (*Log) Path added in v0.7.4

func (l *Log) Path() string

Path implements common.TabComponent.

func (*Log) SetSize

func (l *Log) SetSize(width, height int)

SetSize implements common.Component.

func (*Log) ShortHelp

func (l *Log) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*Log) SpinnerID

func (l *Log) SpinnerID() int

SpinnerID implements common.TabComponent.

func (*Log) StatusBarInfo

func (l *Log) StatusBarInfo() string

StatusBarInfo returns the status bar info.

func (*Log) StatusBarValue

func (l *Log) StatusBarValue() string

StatusBarValue returns the status bar value.

func (*Log) TabName

func (l *Log) TabName() string

TabName returns the name of the tab.

func (*Log) Update

func (l *Log) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Log) View

func (l *Log) View() string

View implements tea.Model.

type LogCommitMsg

type LogCommitMsg *git.Commit

LogCommitMsg is a message that contains a git commit.

type LogCountMsg

type LogCountMsg int64

LogCountMsg is a message that contains the number of commits in a repo.

type LogDiffMsg

type LogDiffMsg *git.Diff

LogDiffMsg is a message that contains a git diff.

type LogItem

type LogItem struct {
	*git.Commit
}

LogItem is a item in the log list that displays a git commit.

func (LogItem) Description

func (i LogItem) Description() string

Description returns the item description. Implements list.DefaultItem.

func (LogItem) FilterValue

func (i LogItem) FilterValue() string

FilterValue implements list.Item.

func (LogItem) Hash

func (i LogItem) Hash() string

Hash returns the commit hash.

func (LogItem) ID

func (i LogItem) ID() string

ID implements selector.IdentifiableItem.

func (LogItem) Title

func (i LogItem) Title() string

Title returns the item title. Implements list.DefaultItem.

type LogItemDelegate

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

LogItemDelegate is the delegate for LogItem.

func (LogItemDelegate) Height

func (d LogItemDelegate) Height() int

Height returns the item height. Implements list.ItemDelegate.

func (LogItemDelegate) Render

func (d LogItemDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

Render renders the item. Implements list.ItemDelegate.

func (LogItemDelegate) Spacing

func (d LogItemDelegate) Spacing() int

Spacing returns the item spacing. Implements list.ItemDelegate.

func (LogItemDelegate) Update

func (d LogItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

Update updates the item. Implements list.ItemDelegate.

type LogItemsMsg

type LogItemsMsg []selector.IdentifiableItem

LogItemsMsg is a message that contains a slice of LogItem.

type Readme

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

Readme is the readme component page.

func NewReadme

func NewReadme(common common.Common) *Readme

NewReadme creates a new readme model.

func (*Readme) FullHelp

func (r *Readme) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Readme) Init

func (r *Readme) Init() tea.Cmd

Init implements tea.Model.

func (*Readme) Path added in v0.7.4

func (r *Readme) Path() string

Path implements common.TabComponent.

func (*Readme) SetSize

func (r *Readme) SetSize(width, height int)

SetSize implements common.Component.

func (*Readme) ShortHelp

func (r *Readme) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*Readme) SpinnerID

func (r *Readme) SpinnerID() int

SpinnerID implements common.TabComponent.

func (*Readme) StatusBarInfo

func (r *Readme) StatusBarInfo() string

StatusBarInfo implements statusbar.StatusBar.

func (*Readme) StatusBarValue

func (r *Readme) StatusBarValue() string

StatusBarValue implements statusbar.StatusBar.

func (*Readme) TabName

func (r *Readme) TabName() string

TabName returns the name of the tab.

func (*Readme) Update

func (r *Readme) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Readme) View

func (r *Readme) View() string

View implements tea.Model.

type ReadmeMsg

type ReadmeMsg struct {
	Content string
	Path    string
}

ReadmeMsg is a message sent when the readme is loaded.

type RefItem

type RefItem struct {
	*git.Reference
	*git.Tag
	*git.Commit
}

RefItem is a git reference item.

func (RefItem) Description

func (i RefItem) Description() string

Description implements list.DefaultItem.

func (RefItem) FilterValue

func (i RefItem) FilterValue() string

FilterValue implements list.Item.

func (RefItem) ID

func (i RefItem) ID() string

ID implements selector.IdentifiableItem.

func (RefItem) Short

func (i RefItem) Short() string

Short returns the short name of the reference.

func (RefItem) Title

func (i RefItem) Title() string

Title implements list.DefaultItem.

type RefItemDelegate

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

RefItemDelegate is the delegate for the ref item.

func (RefItemDelegate) Height

func (d RefItemDelegate) Height() int

Height implements list.ItemDelegate.

func (RefItemDelegate) Render

func (d RefItemDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

Render implements list.ItemDelegate.

func (RefItemDelegate) Spacing

func (d RefItemDelegate) Spacing() int

Spacing implements list.ItemDelegate.

func (RefItemDelegate) Update

func (d RefItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

Update implements list.ItemDelegate.

type RefItems

type RefItems []RefItem

RefItems is a list of git references.

func (RefItems) Len

func (cl RefItems) Len() int

Len implements sort.Interface.

func (RefItems) Less

func (cl RefItems) Less(i, j int) bool

Less implements sort.Interface.

func (RefItems) Swap

func (cl RefItems) Swap(i, j int)

Swap implements sort.Interface.

type RefItemsMsg

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

RefItemsMsg is a message that contains a list of RefItem.

type RefMsg

type RefMsg *git.Reference

RefMsg is a message that contains a git.Reference.

type Refs

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

Refs is a component that displays a list of references.

func NewRefs

func NewRefs(common common.Common, refPrefix string) *Refs

NewRefs creates a new Refs component.

func (*Refs) FullHelp

func (r *Refs) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Refs) Init

func (r *Refs) Init() tea.Cmd

Init implements tea.Model.

func (*Refs) Path added in v0.7.4

func (r *Refs) Path() string

Path implements common.TabComponent.

func (*Refs) SetSize

func (r *Refs) SetSize(width, height int)

SetSize implements common.Component.

func (*Refs) ShortHelp

func (r *Refs) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*Refs) SpinnerID

func (r *Refs) SpinnerID() int

SpinnerID implements common.TabComponent.

func (*Refs) StatusBarInfo

func (r *Refs) StatusBarInfo() string

StatusBarInfo implements statusbar.StatusBar.

func (*Refs) StatusBarValue

func (r *Refs) StatusBarValue() string

StatusBarValue implements statusbar.StatusBar.

func (*Refs) TabName

func (r *Refs) TabName() string

TabName returns the name of the tab.

func (*Refs) Update

func (r *Refs) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Refs) View

func (r *Refs) View() string

View implements tea.Model.

type Repo

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

Repo is a view for a git repository.

func New

func New(c common.Common, comps ...common.TabComponent) *Repo

New returns a new Repo.

func (*Repo) FullHelp

func (r *Repo) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Repo) Init

func (r *Repo) Init() tea.Cmd

Init implements tea.View.

func (*Repo) Path added in v0.7.4

func (r *Repo) Path() string

Path returns the current component path.

func (*Repo) SetSize

func (r *Repo) SetSize(width, height int)

SetSize implements common.Component.

func (*Repo) ShortHelp

func (r *Repo) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*Repo) Update

func (r *Repo) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Repo) View

func (r *Repo) View() string

View implements tea.Model.

type RepoMsg

type RepoMsg proto.Repository // nolint:revive

RepoMsg is a message that contains a git.Repository.

type Stash

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

Stash is the stash component page.

func NewStash

func NewStash(common common.Common) *Stash

NewStash creates a new stash model.

func (*Stash) FullHelp

func (s *Stash) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Stash) Init

func (s *Stash) Init() tea.Cmd

Init initializes the model.

func (*Stash) Path added in v0.7.4

func (s *Stash) Path() string

Path implements common.TabComponent.

func (*Stash) SetSize

func (s *Stash) SetSize(width, height int)

SetSize implements common.Component.

func (*Stash) ShortHelp

func (s *Stash) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*Stash) SpinnerID

func (s *Stash) SpinnerID() int

SpinnerID implements common.Component.

func (*Stash) StatusBarInfo

func (s *Stash) StatusBarInfo() string

StatusBarInfo implements common.Component.

func (*Stash) StatusBarValue

func (s *Stash) StatusBarValue() string

StatusBarValue implements common.Component.

func (*Stash) TabName

func (s *Stash) TabName() string

TabName returns the name of the tab.

func (*Stash) Update

func (s *Stash) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update updates the model.

func (*Stash) View

func (s *Stash) View() string

View returns the view.

type StashItem

type StashItem struct{ *gitm.Stash }

StashItem represents a stash item.

func (StashItem) Description

func (i StashItem) Description() string

Description returns the description of the stash item.

func (StashItem) FilterValue

func (i StashItem) FilterValue() string

FilterValue implements list.Item.

func (StashItem) ID

func (i StashItem) ID() string

ID returns the ID of the stash item.

func (StashItem) Title

func (i StashItem) Title() string

Title returns the title of the stash item.

type StashItemDelegate

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

StashItemDelegate is a delegate for stash items.

func (StashItemDelegate) Height

func (d StashItemDelegate) Height() int

Height returns the height of the stash item list. Implements list.ItemDelegate.

func (StashItemDelegate) Render

func (d StashItemDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

Render implements list.ItemDelegate.

func (StashItemDelegate) Spacing

func (d StashItemDelegate) Spacing() int

Spacing implements list.ItemDelegate.

func (StashItemDelegate) Update

func (d StashItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

Update implements list.ItemDelegate.

type StashItems

type StashItems []StashItem

StashItems is a list of stash items.

func (StashItems) Len

func (cl StashItems) Len() int

Len implements sort.Interface.

func (StashItems) Less

func (cl StashItems) Less(i, j int) bool

Less implements sort.Interface.

func (StashItems) Swap

func (cl StashItems) Swap(i, j int)

Swap implements sort.Interface.

type StashListMsg

type StashListMsg []*gitm.Stash

StashListMsg is a message sent when the stash list is loaded.

type StashPatchMsg

type StashPatchMsg struct{ *git.Diff }

StashPatchMsg is a message sent when the stash patch is loaded.

type SwitchTabMsg

type SwitchTabMsg common.TabComponent

SwitchTabMsg is a message to switch tabs.

Jump to

Keyboard shortcuts

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