lister

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigKey

func ConfigKey(name string) string

func GetAttachedTmuxSession

func GetAttachedTmuxSession(l *RealLister) (model.SeshSession, bool)

Types

type CachingLister

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

CachingLister wraps a Lister with stale-while-revalidate caching for List(). All other Lister methods delegate directly to the inner lister.

func NewCachingLister

func NewCachingLister(inner Lister, c cache.Cache) *CachingLister

NewCachingLister creates a CachingLister that decorates inner with file-based caching.

func (*CachingLister) FindConfigSession

func (cl *CachingLister) FindConfigSession(name string) (model.SeshSession, bool)

func (*CachingLister) FindConfigWildcard

func (cl *CachingLister) FindConfigWildcard(path string) (model.WildcardConfig, bool)

func (*CachingLister) FindTmuxSession

func (cl *CachingLister) FindTmuxSession(name string) (model.SeshSession, bool)

func (*CachingLister) FindTmuxinatorConfig

func (cl *CachingLister) FindTmuxinatorConfig(name string) (model.SeshSession, bool)

func (*CachingLister) FindZellijSession

func (cl *CachingLister) FindZellijSession(name string) (model.SeshSession, bool)

func (*CachingLister) FindZoxideSession

func (cl *CachingLister) FindZoxideSession(name string) (model.SeshSession, bool)

func (*CachingLister) GetAttachedTmuxSession

func (cl *CachingLister) GetAttachedTmuxSession() (model.SeshSession, bool)

func (*CachingLister) GetLastTmuxSession

func (cl *CachingLister) GetLastTmuxSession() (model.SeshSession, bool)

func (*CachingLister) GetLastZellijSession

func (cl *CachingLister) GetLastZellijSession() (model.SeshSession, bool)

func (*CachingLister) List

func (cl *CachingLister) List(opts ListOptions) (model.SeshSessions, error)

List implements Lister. It returns cached data when available, triggering a background refresh when the cache is older than the soft TTL. The cache always stores the full unfiltered list; source filters, HideDuplicates, and HideAttached are applied after reading from cache.

func (*CachingLister) ListTmuxPanes

func (cl *CachingLister) ListTmuxPanes() (model.SeshSessions, error)

func (*CachingLister) RefreshCache

func (cl *CachingLister) RefreshCache(opts ListOptions)

RefreshCache fetches live data from the inner lister and writes it to the cache. This bypasses the cache read entirely, intended for use after sesh connect.

func (*CachingLister) Wait

func (cl *CachingLister) Wait()

Wait blocks until all background refresh goroutines have completed. Call this before process exit to avoid truncated cache writes.

type ListOptions

type ListOptions struct {
	Config         bool
	HideAttached   bool
	Icons          bool
	NoColor        bool
	Json           bool
	Tmux           bool
	Zellij         bool
	Zoxide         bool
	Tmuxinator     bool
	HideDuplicates bool
	Panes          bool
	Blacklisted    bool
}

type Lister

type Lister interface {
	List(opts ListOptions) (model.SeshSessions, error)
	ListTmuxPanes() (model.SeshSessions, error)
	FindTmuxSession(name string) (model.SeshSession, bool)
	FindZellijSession(name string) (model.SeshSession, bool)
	GetAttachedTmuxSession() (model.SeshSession, bool)
	GetLastTmuxSession() (model.SeshSession, bool)
	GetLastZellijSession() (model.SeshSession, bool)
	FindConfigSession(name string) (model.SeshSession, bool)
	FindConfigWildcard(path string) (model.WildcardConfig, bool)
	FindZoxideSession(name string) (model.SeshSession, bool)
	FindTmuxinatorConfig(name string) (model.SeshSession, bool)
}

func NewLister

func NewLister(config model.Config, home home.Home, tmux tmux.Tmux, zoxide zoxide.Zoxide, tmuxinator tmuxinator.Tmuxinator) Lister

func NewListerWithMux

func NewListerWithMux(config model.Config, home home.Home, tmux tmux.Tmux, zellij tmux.Tmux, mux tmux.Tmux, zoxide zoxide.Zoxide, tmuxinator tmuxinator.Tmuxinator) Lister

type MockLister

type MockLister struct {
	mock.Mock
}

MockLister is an autogenerated mock type for the Lister type

func NewMockLister

func NewMockLister(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockLister

NewMockLister creates a new instance of MockLister. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockLister) EXPECT

func (_m *MockLister) EXPECT() *MockLister_Expecter

func (*MockLister) FindConfigSession

func (_m *MockLister) FindConfigSession(name string) (model.SeshSession, bool)

FindConfigSession provides a mock function with given fields: name

func (*MockLister) FindConfigWildcard

func (_m *MockLister) FindConfigWildcard(path string) (model.WildcardConfig, bool)

FindConfigWildcard provides a mock function with given fields: path

func (*MockLister) FindTmuxSession

func (_m *MockLister) FindTmuxSession(name string) (model.SeshSession, bool)

FindTmuxSession provides a mock function with given fields: name

func (*MockLister) FindTmuxinatorConfig

func (_m *MockLister) FindTmuxinatorConfig(name string) (model.SeshSession, bool)

FindTmuxinatorConfig provides a mock function with given fields: name

func (*MockLister) FindZellijSession

func (_m *MockLister) FindZellijSession(name string) (model.SeshSession, bool)

FindZellijSession provides a mock function with given fields: name

func (*MockLister) FindZoxideSession

func (_m *MockLister) FindZoxideSession(name string) (model.SeshSession, bool)

FindZoxideSession provides a mock function with given fields: name

func (*MockLister) GetAttachedTmuxSession

func (_m *MockLister) GetAttachedTmuxSession() (model.SeshSession, bool)

GetAttachedTmuxSession provides a mock function with no fields

func (*MockLister) GetLastTmuxSession

func (_m *MockLister) GetLastTmuxSession() (model.SeshSession, bool)

GetLastTmuxSession provides a mock function with no fields

func (*MockLister) GetLastZellijSession

func (_m *MockLister) GetLastZellijSession() (model.SeshSession, bool)

GetLastZellijSession provides a mock function with no fields

func (*MockLister) List

func (_m *MockLister) List(opts ListOptions) (model.SeshSessions, error)

List provides a mock function with given fields: opts

func (*MockLister) ListTmuxPanes

func (_m *MockLister) ListTmuxPanes() (model.SeshSessions, error)

ListTmuxPanes provides a mock function with no fields

type MockLister_Expecter

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

func (*MockLister_Expecter) FindConfigSession

func (_e *MockLister_Expecter) FindConfigSession(name interface{}) *MockLister_FindConfigSession_Call

FindConfigSession is a helper method to define mock.On call

  • name string

func (*MockLister_Expecter) FindConfigWildcard

func (_e *MockLister_Expecter) FindConfigWildcard(path interface{}) *MockLister_FindConfigWildcard_Call

FindConfigWildcard is a helper method to define mock.On call

  • path string

func (*MockLister_Expecter) FindTmuxSession

func (_e *MockLister_Expecter) FindTmuxSession(name interface{}) *MockLister_FindTmuxSession_Call

FindTmuxSession is a helper method to define mock.On call

  • name string

func (*MockLister_Expecter) FindTmuxinatorConfig

func (_e *MockLister_Expecter) FindTmuxinatorConfig(name interface{}) *MockLister_FindTmuxinatorConfig_Call

FindTmuxinatorConfig is a helper method to define mock.On call

  • name string

func (*MockLister_Expecter) FindZellijSession

func (_e *MockLister_Expecter) FindZellijSession(name interface{}) *MockLister_FindZellijSession_Call

FindZellijSession is a helper method to define mock.On call

  • name string

func (*MockLister_Expecter) FindZoxideSession

func (_e *MockLister_Expecter) FindZoxideSession(name interface{}) *MockLister_FindZoxideSession_Call

FindZoxideSession is a helper method to define mock.On call

  • name string

func (*MockLister_Expecter) GetAttachedTmuxSession

func (_e *MockLister_Expecter) GetAttachedTmuxSession() *MockLister_GetAttachedTmuxSession_Call

GetAttachedTmuxSession is a helper method to define mock.On call

func (*MockLister_Expecter) GetLastTmuxSession

func (_e *MockLister_Expecter) GetLastTmuxSession() *MockLister_GetLastTmuxSession_Call

GetLastTmuxSession is a helper method to define mock.On call

func (*MockLister_Expecter) GetLastZellijSession

func (_e *MockLister_Expecter) GetLastZellijSession() *MockLister_GetLastZellijSession_Call

GetLastZellijSession is a helper method to define mock.On call

func (*MockLister_Expecter) List

func (_e *MockLister_Expecter) List(opts interface{}) *MockLister_List_Call

List is a helper method to define mock.On call

  • opts ListOptions

func (*MockLister_Expecter) ListTmuxPanes

ListTmuxPanes is a helper method to define mock.On call

type MockLister_FindConfigSession_Call

type MockLister_FindConfigSession_Call struct {
	*mock.Call
}

MockLister_FindConfigSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindConfigSession'

func (*MockLister_FindConfigSession_Call) Return

func (*MockLister_FindConfigSession_Call) Run

func (*MockLister_FindConfigSession_Call) RunAndReturn

type MockLister_FindConfigWildcard_Call

type MockLister_FindConfigWildcard_Call struct {
	*mock.Call
}

MockLister_FindConfigWildcard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindConfigWildcard'

func (*MockLister_FindConfigWildcard_Call) Return

func (*MockLister_FindConfigWildcard_Call) Run

func (*MockLister_FindConfigWildcard_Call) RunAndReturn

type MockLister_FindTmuxSession_Call

type MockLister_FindTmuxSession_Call struct {
	*mock.Call
}

MockLister_FindTmuxSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTmuxSession'

func (*MockLister_FindTmuxSession_Call) Return

func (*MockLister_FindTmuxSession_Call) Run

func (*MockLister_FindTmuxSession_Call) RunAndReturn

type MockLister_FindTmuxinatorConfig_Call

type MockLister_FindTmuxinatorConfig_Call struct {
	*mock.Call
}

MockLister_FindTmuxinatorConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindTmuxinatorConfig'

func (*MockLister_FindTmuxinatorConfig_Call) Return

func (*MockLister_FindTmuxinatorConfig_Call) Run

func (*MockLister_FindTmuxinatorConfig_Call) RunAndReturn

type MockLister_FindZellijSession_Call

type MockLister_FindZellijSession_Call struct {
	*mock.Call
}

MockLister_FindZellijSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindZellijSession'

func (*MockLister_FindZellijSession_Call) Return

func (*MockLister_FindZellijSession_Call) Run

func (*MockLister_FindZellijSession_Call) RunAndReturn

type MockLister_FindZoxideSession_Call

type MockLister_FindZoxideSession_Call struct {
	*mock.Call
}

MockLister_FindZoxideSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindZoxideSession'

func (*MockLister_FindZoxideSession_Call) Return

func (*MockLister_FindZoxideSession_Call) Run

func (*MockLister_FindZoxideSession_Call) RunAndReturn

type MockLister_GetAttachedTmuxSession_Call

type MockLister_GetAttachedTmuxSession_Call struct {
	*mock.Call
}

MockLister_GetAttachedTmuxSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAttachedTmuxSession'

func (*MockLister_GetAttachedTmuxSession_Call) Return

func (*MockLister_GetAttachedTmuxSession_Call) Run

func (*MockLister_GetAttachedTmuxSession_Call) RunAndReturn

type MockLister_GetLastTmuxSession_Call

type MockLister_GetLastTmuxSession_Call struct {
	*mock.Call
}

MockLister_GetLastTmuxSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLastTmuxSession'

func (*MockLister_GetLastTmuxSession_Call) Return

func (*MockLister_GetLastTmuxSession_Call) Run

func (*MockLister_GetLastTmuxSession_Call) RunAndReturn

type MockLister_GetLastZellijSession_Call

type MockLister_GetLastZellijSession_Call struct {
	*mock.Call
}

MockLister_GetLastZellijSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLastZellijSession'

func (*MockLister_GetLastZellijSession_Call) Return

func (*MockLister_GetLastZellijSession_Call) Run

func (*MockLister_GetLastZellijSession_Call) RunAndReturn

type MockLister_ListTmuxPanes_Call

type MockLister_ListTmuxPanes_Call struct {
	*mock.Call
}

MockLister_ListTmuxPanes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTmuxPanes'

func (*MockLister_ListTmuxPanes_Call) Return

func (*MockLister_ListTmuxPanes_Call) Run

func (*MockLister_ListTmuxPanes_Call) RunAndReturn

type MockLister_List_Call

type MockLister_List_Call struct {
	*mock.Call
}

MockLister_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'

func (*MockLister_List_Call) Return

func (*MockLister_List_Call) Run

func (_c *MockLister_List_Call) Run(run func(opts ListOptions)) *MockLister_List_Call

func (*MockLister_List_Call) RunAndReturn

type RealLister

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

func (*RealLister) FindConfigSession

func (l *RealLister) FindConfigSession(name string) (model.SeshSession, bool)

func (*RealLister) FindConfigWildcard

func (l *RealLister) FindConfigWildcard(path string) (model.WildcardConfig, bool)

func (*RealLister) FindTmuxSession

func (l *RealLister) FindTmuxSession(name string) (model.SeshSession, bool)

func (*RealLister) FindTmuxinatorConfig

func (l *RealLister) FindTmuxinatorConfig(name string) (model.SeshSession, bool)

func (*RealLister) FindZellijSession

func (l *RealLister) FindZellijSession(name string) (model.SeshSession, bool)

func (*RealLister) FindZoxideSession

func (l *RealLister) FindZoxideSession(path string) (model.SeshSession, bool)

func (*RealLister) GetAttachedTmuxSession

func (l *RealLister) GetAttachedTmuxSession() (model.SeshSession, bool)

func (*RealLister) GetLastTmuxSession

func (l *RealLister) GetLastTmuxSession() (model.SeshSession, bool)

func (*RealLister) GetLastZellijSession

func (l *RealLister) GetLastZellijSession() (model.SeshSession, bool)

func (*RealLister) List

func (l *RealLister) List(opts ListOptions) (model.SeshSessions, error)

func (*RealLister) ListTmuxPanes

func (l *RealLister) ListTmuxPanes() (model.SeshSessions, error)

Jump to

Keyboard shortcuts

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