tabs

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package tabs contains helper functions for managing tabs in Altid services

go get github.com/altid/server/tabs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Manager is used to manage tabs accurately for a service

func FromFile

func FromFile(dir string) (*Manager, error)

FromFile returns a Manager with all tabs listed in a file added

func (*Manager) Active

func (m *Manager) Active(name string)

Active incements the count on a named tab

func (*Manager) Default

func (m *Manager) Default() string

Default returns the first tab from the list or none if no tabs exist

func (*Manager) Done

func (m *Manager) Done(name string)

Done decrements the count on a named tab if the tab reference count is 0, mark it as inactive

func (*Manager) List

func (m *Manager) List() []*Tab

List returns all currently tracked tabs

func (*Manager) Remove

func (m *Manager) Remove(name string) error

Remove a named tab from the internal list

func (*Manager) Tab

func (m *Manager) Tab(name string) *Tab

Tab returns a named tab, creating and appending to our list if none exists

type Tab

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

Tab represents the state of one open buffer

func (*Tab) Activity

func (t *Tab) Activity()

Activity updates the tab if tab is active, it will clear any remaining unreads/alerts if inactive, it will increment the unread count

func (*Tab) Alert

func (t *Tab) Alert()

func (*Tab) IsActive

func (t *Tab) IsActive() bool

func (*Tab) String

func (t *Tab) String() string

Jump to

Keyboard shortcuts

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