mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-22 16:24:00 +01:00
Added local customized version of bubbles/table with horizontal cell scroll
This commit is contained in:
parent
f502cbee1d
commit
3c468f46aa
@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
"github.com/charmbracelet/bubbles/spinner"
|
"github.com/charmbracelet/bubbles/spinner"
|
||||||
"github.com/charmbracelet/bubbles/table"
|
"github.com/ddworken/hishtory/client/table"
|
||||||
"github.com/charmbracelet/bubbles/textinput"
|
"github.com/charmbracelet/bubbles/textinput"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
@ -372,6 +372,14 @@ func makeTable(ctx *context.Context, rows []table.Row) (table.Model, error) {
|
|||||||
key.WithKeys("end"),
|
key.WithKeys("end"),
|
||||||
key.WithHelp("end", "go to end"),
|
key.WithHelp("end", "go to end"),
|
||||||
),
|
),
|
||||||
|
MoveLeft: key.NewBinding(
|
||||||
|
key.WithKeys("shift+left"),
|
||||||
|
key.WithHelp("Shift+←", "move left"),
|
||||||
|
),
|
||||||
|
MoveRight: key.NewBinding(
|
||||||
|
key.WithKeys("shift+right"),
|
||||||
|
key.WithHelp("Shift+→", "move right"),
|
||||||
|
),
|
||||||
}
|
}
|
||||||
_, terminalHeight, err := getTerminalSize()
|
_, terminalHeight, err := getTerminalSize()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
485
client/table/table.go
Normal file
485
client/table/table.go
Normal file
@ -0,0 +1,485 @@
|
|||||||
|
package table
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/bubbles/key"
|
||||||
|
"github.com/charmbracelet/bubbles/viewport"
|
||||||
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
"github.com/mattn/go-runewidth"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Model defines a state for the table widget.
|
||||||
|
type Model struct {
|
||||||
|
KeyMap KeyMap
|
||||||
|
|
||||||
|
cols []Column
|
||||||
|
rows []Row
|
||||||
|
cursor int
|
||||||
|
focus bool
|
||||||
|
styles Styles
|
||||||
|
|
||||||
|
viewport viewport.Model
|
||||||
|
start int
|
||||||
|
end int
|
||||||
|
|
||||||
|
hcol int
|
||||||
|
hstep int
|
||||||
|
hcursor int
|
||||||
|
}
|
||||||
|
|
||||||
|
// Row represents one line in the table.
|
||||||
|
type Row []string
|
||||||
|
|
||||||
|
// Column defines the table structure.
|
||||||
|
type Column struct {
|
||||||
|
Title string
|
||||||
|
Width int
|
||||||
|
}
|
||||||
|
|
||||||
|
// KeyMap defines keybindings. It satisfies to the help.KeyMap interface, which
|
||||||
|
// is used to render the menu menu.
|
||||||
|
type KeyMap struct {
|
||||||
|
LineUp key.Binding
|
||||||
|
LineDown key.Binding
|
||||||
|
PageUp key.Binding
|
||||||
|
PageDown key.Binding
|
||||||
|
HalfPageUp key.Binding
|
||||||
|
HalfPageDown key.Binding
|
||||||
|
GotoTop key.Binding
|
||||||
|
GotoBottom key.Binding
|
||||||
|
MoveLeft key.Binding
|
||||||
|
MoveRight key.Binding
|
||||||
|
}
|
||||||
|
|
||||||
|
// DefaultKeyMap returns a default set of keybindings.
|
||||||
|
func DefaultKeyMap() KeyMap {
|
||||||
|
const spacebar = " "
|
||||||
|
return KeyMap{
|
||||||
|
LineUp: key.NewBinding(
|
||||||
|
key.WithKeys("up", "k"),
|
||||||
|
key.WithHelp("↑/k", "up"),
|
||||||
|
),
|
||||||
|
LineDown: key.NewBinding(
|
||||||
|
key.WithKeys("down", "j"),
|
||||||
|
key.WithHelp("↓/j", "down"),
|
||||||
|
),
|
||||||
|
PageUp: key.NewBinding(
|
||||||
|
key.WithKeys("b", "pgup"),
|
||||||
|
key.WithHelp("b/pgup", "page up"),
|
||||||
|
),
|
||||||
|
PageDown: key.NewBinding(
|
||||||
|
key.WithKeys("f", "pgdown", spacebar),
|
||||||
|
key.WithHelp("f/pgdn", "page down"),
|
||||||
|
),
|
||||||
|
HalfPageUp: key.NewBinding(
|
||||||
|
key.WithKeys("u", "ctrl+u"),
|
||||||
|
key.WithHelp("u", "½ page up"),
|
||||||
|
),
|
||||||
|
HalfPageDown: key.NewBinding(
|
||||||
|
key.WithKeys("d", "ctrl+d"),
|
||||||
|
key.WithHelp("d", "½ page down"),
|
||||||
|
),
|
||||||
|
GotoTop: key.NewBinding(
|
||||||
|
key.WithKeys("home", "g"),
|
||||||
|
key.WithHelp("g/home", "go to start"),
|
||||||
|
),
|
||||||
|
GotoBottom: key.NewBinding(
|
||||||
|
key.WithKeys("end", "G"),
|
||||||
|
key.WithHelp("G/end", "go to end"),
|
||||||
|
),
|
||||||
|
MoveLeft: key.NewBinding(
|
||||||
|
key.WithKeys("shift+left"),
|
||||||
|
key.WithHelp("Shift+←", "move left"),
|
||||||
|
),
|
||||||
|
MoveRight: key.NewBinding(
|
||||||
|
key.WithKeys("shift+right"),
|
||||||
|
key.WithHelp("Shift+→", "move right"),
|
||||||
|
),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Styles contains style definitions for this list component. By default, these
|
||||||
|
// values are generated by DefaultStyles.
|
||||||
|
type Styles struct {
|
||||||
|
Header lipgloss.Style
|
||||||
|
Cell lipgloss.Style
|
||||||
|
Selected lipgloss.Style
|
||||||
|
}
|
||||||
|
|
||||||
|
// DefaultStyles returns a set of default style definitions for this table.
|
||||||
|
func DefaultStyles() Styles {
|
||||||
|
return Styles{
|
||||||
|
Selected: lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("212")),
|
||||||
|
Header: lipgloss.NewStyle().Bold(true).Padding(0, 1),
|
||||||
|
Cell: lipgloss.NewStyle().Padding(0, 1),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStyles sets the table styles.
|
||||||
|
func (m *Model) SetStyles(s Styles) {
|
||||||
|
m.styles = s
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Option is used to set options in New. For example:
|
||||||
|
//
|
||||||
|
// table := New(WithColumns([]Column{{Title: "ID", Width: 10}}))
|
||||||
|
type Option func(*Model)
|
||||||
|
|
||||||
|
// New creates a new model for the table widget.
|
||||||
|
func New(opts ...Option) Model {
|
||||||
|
m := Model{
|
||||||
|
cursor: 0,
|
||||||
|
viewport: viewport.New(0, 20),
|
||||||
|
|
||||||
|
KeyMap: DefaultKeyMap(),
|
||||||
|
styles: DefaultStyles(),
|
||||||
|
|
||||||
|
hcol: -1,
|
||||||
|
hstep: 10,
|
||||||
|
hcursor: 0,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(&m)
|
||||||
|
}
|
||||||
|
|
||||||
|
m.UpdateViewport()
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithColumns sets the table columns (headers).
|
||||||
|
func WithColumns(cols []Column) Option {
|
||||||
|
return func(m *Model) {
|
||||||
|
m.cols = cols
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithRows sets the table rows (data).
|
||||||
|
func WithRows(rows []Row) Option {
|
||||||
|
return func(m *Model) {
|
||||||
|
m.rows = rows
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithHeight sets the height of the table.
|
||||||
|
func WithHeight(h int) Option {
|
||||||
|
return func(m *Model) {
|
||||||
|
m.viewport.Height = h
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithWidth sets the width of the table.
|
||||||
|
func WithWidth(w int) Option {
|
||||||
|
return func(m *Model) {
|
||||||
|
m.viewport.Width = w
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithFocused sets the focus state of the table.
|
||||||
|
func WithFocused(f bool) Option {
|
||||||
|
return func(m *Model) {
|
||||||
|
m.focus = f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStyles sets the table styles.
|
||||||
|
func WithStyles(s Styles) Option {
|
||||||
|
return func(m *Model) {
|
||||||
|
m.styles = s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithKeyMap sets the key map.
|
||||||
|
func WithKeyMap(km KeyMap) Option {
|
||||||
|
return func(m *Model) {
|
||||||
|
m.KeyMap = km
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is the Bubble Tea update loop.
|
||||||
|
func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
|
||||||
|
if !m.focus {
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var cmds []tea.Cmd
|
||||||
|
|
||||||
|
switch msg := msg.(type) {
|
||||||
|
case tea.KeyMsg:
|
||||||
|
switch {
|
||||||
|
case key.Matches(msg, m.KeyMap.LineUp):
|
||||||
|
m.MoveUp(1)
|
||||||
|
case key.Matches(msg, m.KeyMap.LineDown):
|
||||||
|
m.MoveDown(1)
|
||||||
|
case key.Matches(msg, m.KeyMap.PageUp):
|
||||||
|
m.MoveUp(m.viewport.Height)
|
||||||
|
case key.Matches(msg, m.KeyMap.PageDown):
|
||||||
|
m.MoveDown(m.viewport.Height)
|
||||||
|
case key.Matches(msg, m.KeyMap.HalfPageUp):
|
||||||
|
m.MoveUp(m.viewport.Height / 2)
|
||||||
|
case key.Matches(msg, m.KeyMap.HalfPageDown):
|
||||||
|
m.MoveDown(m.viewport.Height / 2)
|
||||||
|
case key.Matches(msg, m.KeyMap.LineDown):
|
||||||
|
m.MoveDown(1)
|
||||||
|
case key.Matches(msg, m.KeyMap.GotoTop):
|
||||||
|
m.GotoTop()
|
||||||
|
case key.Matches(msg, m.KeyMap.GotoBottom):
|
||||||
|
m.GotoBottom()
|
||||||
|
case key.Matches(msg, m.KeyMap.MoveLeft):
|
||||||
|
m.MoveLeft(m.hstep)
|
||||||
|
case key.Matches(msg, m.KeyMap.MoveRight):
|
||||||
|
m.MoveRight(m.hstep)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return m, tea.Batch(cmds...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Focused returns the focus state of the table.
|
||||||
|
func (m Model) Focused() bool {
|
||||||
|
return m.focus
|
||||||
|
}
|
||||||
|
|
||||||
|
// Focus focusses the table, allowing the user to move around the rows and
|
||||||
|
// interact.
|
||||||
|
func (m *Model) Focus() {
|
||||||
|
m.focus = true
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Blur blurs the table, preventing selection or movement.
|
||||||
|
func (m *Model) Blur() {
|
||||||
|
m.focus = false
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// View renders the component.
|
||||||
|
func (m Model) View() string {
|
||||||
|
return m.headersView() + "\n" + m.viewport.View()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateViewport updates the list content based on the previously defined
|
||||||
|
// columns and rows.
|
||||||
|
func (m *Model) UpdateViewport() {
|
||||||
|
renderedRows := make([]string, 0, len(m.rows))
|
||||||
|
|
||||||
|
// Render only rows from: m.cursor-m.viewport.Height to: m.cursor+m.viewport.Height
|
||||||
|
// Constant runtime, independent of number of rows in a table.
|
||||||
|
// Limits the number of renderedRows to a maximum of 2*m.viewport.Height
|
||||||
|
if m.cursor >= 0 {
|
||||||
|
m.start = clamp(m.cursor-m.viewport.Height, 0, m.cursor)
|
||||||
|
} else {
|
||||||
|
m.start = 0
|
||||||
|
}
|
||||||
|
m.end = clamp(m.cursor+m.viewport.Height, m.cursor, len(m.rows))
|
||||||
|
for i := m.start; i < m.end; i++ {
|
||||||
|
renderedRows = append(renderedRows, m.renderRow(i))
|
||||||
|
}
|
||||||
|
|
||||||
|
m.viewport.SetContent(
|
||||||
|
lipgloss.JoinVertical(lipgloss.Left, renderedRows...),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SelectedRow returns the selected row.
|
||||||
|
// You can cast it to your own implementation.
|
||||||
|
func (m Model) SelectedRow() Row {
|
||||||
|
return m.rows[m.cursor]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rows returns the current rows.
|
||||||
|
func (m Model) Rows() []Row {
|
||||||
|
return m.rows
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetRows set a new rows state.
|
||||||
|
func (m *Model) SetRows(r []Row) {
|
||||||
|
m.rows = r
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetColumns set a new columns state.
|
||||||
|
func (m *Model) SetColumns(c []Column) {
|
||||||
|
m.cols = c
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// ColIndex gets the index of a column n, where if n is positive it returns n clamped, and if n is negative it reutrns the column index counting from the right
|
||||||
|
func (m *Model) ColIndex(n int) int {
|
||||||
|
if n < 0 {
|
||||||
|
return clamp(len(m.cols)-n, 0, len(m.cols)-1)
|
||||||
|
} else {
|
||||||
|
return clamp(n, 0, len(m.cols)-1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gets the maximum useful horizontal scroll
|
||||||
|
func (m *Model) MaxHScroll() int {
|
||||||
|
maxWidth := 0
|
||||||
|
index := m.ColIndex(m.hcol)
|
||||||
|
for _, row := range m.rows {
|
||||||
|
if len(row) > index {
|
||||||
|
maxWidth = max(len(row[index]), maxWidth)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return max(maxWidth-m.cols[index].Width+1, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetWidth sets the width of the viewport of the table.
|
||||||
|
func (m *Model) SetWidth(w int) {
|
||||||
|
m.viewport.Width = w
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHeight sets the height of the viewport of the table.
|
||||||
|
func (m *Model) SetHeight(h int) {
|
||||||
|
m.viewport.Height = h
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Height returns the viewport height of the table.
|
||||||
|
func (m Model) Height() int {
|
||||||
|
return m.viewport.Height
|
||||||
|
}
|
||||||
|
|
||||||
|
// Width returns the viewport width of the table.
|
||||||
|
func (m Model) Width() int {
|
||||||
|
return m.viewport.Width
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cursor returns the index of the selected row.
|
||||||
|
func (m Model) Cursor() int {
|
||||||
|
return m.cursor
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetCursor sets the cursor position in the table.
|
||||||
|
func (m *Model) SetCursor(n int) {
|
||||||
|
m.cursor = clamp(n, 0, len(m.rows)-1)
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// MoveUp moves the selection up by any number of row.
|
||||||
|
// It can not go above the first row.
|
||||||
|
func (m *Model) MoveUp(n int) {
|
||||||
|
m.cursor = clamp(m.cursor-n, 0, len(m.rows)-1)
|
||||||
|
switch {
|
||||||
|
case m.start == 0:
|
||||||
|
m.viewport.SetYOffset(clamp(m.viewport.YOffset, 0, m.cursor))
|
||||||
|
case m.start < m.viewport.Height:
|
||||||
|
m.viewport.SetYOffset(clamp(m.viewport.YOffset+n, 0, m.cursor))
|
||||||
|
case m.viewport.YOffset >= 1:
|
||||||
|
m.viewport.YOffset = clamp(m.viewport.YOffset+n, 1, m.viewport.Height)
|
||||||
|
}
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// MoveDown moves the selection down by any number of row.
|
||||||
|
// It can not go below the last row.
|
||||||
|
func (m *Model) MoveDown(n int) {
|
||||||
|
m.cursor = clamp(m.cursor+n, 0, len(m.rows)-1)
|
||||||
|
m.UpdateViewport()
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case m.end == len(m.rows):
|
||||||
|
m.viewport.SetYOffset(clamp(m.viewport.YOffset-n, 1, m.viewport.Height))
|
||||||
|
case m.cursor > (m.end-m.start)/2:
|
||||||
|
m.viewport.SetYOffset(clamp(m.viewport.YOffset-n, 1, m.cursor))
|
||||||
|
case m.viewport.YOffset > 1:
|
||||||
|
case m.cursor > m.viewport.YOffset+m.viewport.Height-1:
|
||||||
|
m.viewport.SetYOffset(clamp(m.viewport.YOffset+1, 0, 1))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GotoTop moves the selection to the first row.
|
||||||
|
func (m *Model) GotoTop() {
|
||||||
|
m.MoveUp(m.cursor)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GotoBottom moves the selection to the last row.
|
||||||
|
func (m *Model) GotoBottom() {
|
||||||
|
m.MoveDown(len(m.rows))
|
||||||
|
}
|
||||||
|
|
||||||
|
// MoveLeft scrolls left
|
||||||
|
func (m *Model) MoveLeft(n int) {
|
||||||
|
m.hcursor = clamp(m.hcursor-n, 0, m.MaxHScroll())
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// MoveRight scrolls right
|
||||||
|
func (m *Model) MoveRight(n int) {
|
||||||
|
m.hcursor = clamp(m.hcursor+n, 0, m.MaxHScroll())
|
||||||
|
m.UpdateViewport()
|
||||||
|
}
|
||||||
|
|
||||||
|
// FromValues create the table rows from a simple string. It uses `\n` by
|
||||||
|
// default for getting all the rows and the given separator for the fields on
|
||||||
|
// each row.
|
||||||
|
func (m *Model) FromValues(value, separator string) {
|
||||||
|
rows := []Row{}
|
||||||
|
for _, line := range strings.Split(value, "\n") {
|
||||||
|
r := Row{}
|
||||||
|
for _, field := range strings.Split(line, separator) {
|
||||||
|
r = append(r, field)
|
||||||
|
}
|
||||||
|
rows = append(rows, r)
|
||||||
|
}
|
||||||
|
|
||||||
|
m.SetRows(rows)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m Model) headersView() string {
|
||||||
|
var s = make([]string, 0, len(m.cols))
|
||||||
|
for _, col := range m.cols {
|
||||||
|
style := lipgloss.NewStyle().Width(col.Width).MaxWidth(col.Width).Inline(true)
|
||||||
|
renderedCell := style.Render(runewidth.Truncate(col.Title, col.Width, "…"))
|
||||||
|
s = append(s, m.styles.Header.Render(renderedCell))
|
||||||
|
}
|
||||||
|
return lipgloss.JoinHorizontal(lipgloss.Left, s...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Model) renderRow(rowID int) string {
|
||||||
|
var s = make([]string, 0, len(m.cols))
|
||||||
|
for i, value := range m.rows[rowID] {
|
||||||
|
style := lipgloss.NewStyle().Width(m.cols[i].Width).MaxWidth(m.cols[i].Width).Inline(true)
|
||||||
|
var renderedCell string
|
||||||
|
if i == m.ColIndex(m.hcol) && m.hcursor > 0 {
|
||||||
|
renderedCell = m.styles.Cell.Render(style.Render(runewidth.Truncate(runewidth.TruncateLeft(value, m.hcursor, "…"), m.cols[i].Width, "…")))
|
||||||
|
} else {
|
||||||
|
renderedCell = m.styles.Cell.Render(style.Render(runewidth.Truncate(value, m.cols[i].Width, "…")))
|
||||||
|
}
|
||||||
|
s = append(s, renderedCell)
|
||||||
|
}
|
||||||
|
|
||||||
|
row := lipgloss.JoinHorizontal(lipgloss.Left, s...)
|
||||||
|
|
||||||
|
if rowID == m.cursor {
|
||||||
|
return m.styles.Selected.Render(row)
|
||||||
|
}
|
||||||
|
|
||||||
|
return row
|
||||||
|
}
|
||||||
|
|
||||||
|
func max(a, b int) int {
|
||||||
|
if a > b {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
func min(a, b int) int {
|
||||||
|
if a < b {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
func clamp(v, low, high int) int {
|
||||||
|
return min(max(v, low), high)
|
||||||
|
}
|
24
go.mod
24
go.mod
@ -3,20 +3,27 @@ module github.com/ddworken/hishtory
|
|||||||
go 1.18
|
go 1.18
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/DataDog/datadog-go v4.8.3+incompatible
|
||||||
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
|
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
|
||||||
github.com/charmbracelet/bubbles v0.14.1-0.20221006154229-d1775121146a
|
github.com/charmbracelet/bubbles v0.15.0
|
||||||
github.com/charmbracelet/bubbletea v0.23.0
|
github.com/charmbracelet/bubbletea v0.23.1
|
||||||
github.com/charmbracelet/lipgloss v0.6.0
|
github.com/charmbracelet/lipgloss v0.6.0
|
||||||
github.com/fatih/color v1.13.0
|
github.com/fatih/color v1.13.0
|
||||||
github.com/glebarez/sqlite v1.4.7
|
github.com/glebarez/sqlite v1.4.7
|
||||||
github.com/go-test/deep v1.0.8
|
github.com/go-test/deep v1.0.8
|
||||||
github.com/google/go-cmp v0.5.9
|
github.com/google/go-cmp v0.5.9
|
||||||
github.com/google/uuid v1.3.0
|
github.com/google/uuid v1.3.0
|
||||||
|
github.com/jackc/pgx/v4 v4.14.1
|
||||||
github.com/lib/pq v1.10.4
|
github.com/lib/pq v1.10.4
|
||||||
|
github.com/mattn/go-runewidth v0.0.14
|
||||||
github.com/muesli/termenv v0.13.0
|
github.com/muesli/termenv v0.13.0
|
||||||
github.com/rodaine/table v1.0.1
|
github.com/rodaine/table v1.0.1
|
||||||
|
github.com/sirupsen/logrus v1.9.0
|
||||||
github.com/slsa-framework/slsa-verifier v1.3.2
|
github.com/slsa-framework/slsa-verifier v1.3.2
|
||||||
|
github.com/spf13/cobra v1.6.1
|
||||||
golang.org/x/term v0.2.0
|
golang.org/x/term v0.2.0
|
||||||
|
gopkg.in/DataDog/dd-trace-go.v1 v1.43.1
|
||||||
|
gopkg.in/natefinch/lumberjack.v2 v2.0.0
|
||||||
gorm.io/driver/postgres v1.3.1
|
gorm.io/driver/postgres v1.3.1
|
||||||
gorm.io/driver/sqlite v1.3.6
|
gorm.io/driver/sqlite v1.3.6
|
||||||
gorm.io/gorm v1.23.8
|
gorm.io/gorm v1.23.8
|
||||||
@ -36,15 +43,11 @@ require (
|
|||||||
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
||||||
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
||||||
github.com/DataDog/datadog-agent/pkg/obfuscate v0.40.1 // indirect
|
github.com/DataDog/datadog-agent/pkg/obfuscate v0.40.1 // indirect
|
||||||
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
|
|
||||||
github.com/DataDog/datadog-go/v5 v5.1.1 // indirect
|
github.com/DataDog/datadog-go/v5 v5.1.1 // indirect
|
||||||
github.com/DataDog/gostackparse v0.5.0 // indirect
|
github.com/DataDog/gostackparse v0.5.0 // indirect
|
||||||
github.com/DataDog/sketches-go v1.4.1 // indirect
|
github.com/DataDog/sketches-go v1.4.1 // indirect
|
||||||
github.com/Microsoft/go-winio v0.6.0 // indirect
|
github.com/Microsoft/go-winio v0.6.0 // indirect
|
||||||
github.com/PaesslerAG/gval v1.0.0 // indirect
|
|
||||||
github.com/PaesslerAG/jsonpath v0.1.1 // indirect
|
|
||||||
github.com/ThalesIgnite/crypto11 v1.2.5 // indirect
|
github.com/ThalesIgnite/crypto11 v1.2.5 // indirect
|
||||||
github.com/alecthomas/kong v0.7.1 // indirect
|
|
||||||
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect
|
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect
|
||||||
github.com/alibabacloud-go/cr-20160607 v1.0.1 // indirect
|
github.com/alibabacloud-go/cr-20160607 v1.0.1 // indirect
|
||||||
github.com/alibabacloud-go/cr-20181201 v1.0.10 // indirect
|
github.com/alibabacloud-go/cr-20181201 v1.0.10 // indirect
|
||||||
@ -104,7 +107,6 @@ require (
|
|||||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||||
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
|
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
|
||||||
github.com/envoyproxy/protoc-gen-validate v0.6.2 // indirect
|
github.com/envoyproxy/protoc-gen-validate v0.6.2 // indirect
|
||||||
github.com/felixge/fgprof v0.9.3 // indirect
|
|
||||||
github.com/fsnotify/fsnotify v1.5.4 // indirect
|
github.com/fsnotify/fsnotify v1.5.4 // indirect
|
||||||
github.com/fullstorydev/grpcurl v1.8.7 // indirect
|
github.com/fullstorydev/grpcurl v1.8.7 // indirect
|
||||||
github.com/ghodss/yaml v1.0.0 // indirect
|
github.com/ghodss/yaml v1.0.0 // indirect
|
||||||
@ -149,7 +151,6 @@ require (
|
|||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
|
||||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||||
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
|
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
|
||||||
github.com/hashicorp/golang-lru v0.5.4 // indirect
|
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/imdario/mergo v0.3.12 // indirect
|
github.com/imdario/mergo v0.3.12 // indirect
|
||||||
github.com/in-toto/in-toto-golang v0.3.4-0.20220709202702-fa494aaa0add // indirect
|
github.com/in-toto/in-toto-golang v0.3.4-0.20220709202702-fa494aaa0add // indirect
|
||||||
@ -161,7 +162,6 @@ require (
|
|||||||
github.com/jackc/pgproto3/v2 v2.2.0 // indirect
|
github.com/jackc/pgproto3/v2 v2.2.0 // indirect
|
||||||
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
|
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
|
||||||
github.com/jackc/pgtype v1.9.1 // indirect
|
github.com/jackc/pgtype v1.9.1 // indirect
|
||||||
github.com/jackc/pgx/v4 v4.14.1 // indirect
|
|
||||||
github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b // indirect
|
github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b // indirect
|
||||||
github.com/jhump/protoreflect v1.13.0 // indirect
|
github.com/jhump/protoreflect v1.13.0 // indirect
|
||||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||||
@ -179,7 +179,6 @@ require (
|
|||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.16 // indirect
|
github.com/mattn/go-isatty v0.0.16 // indirect
|
||||||
github.com/mattn/go-localereader v0.0.1 // indirect
|
github.com/mattn/go-localereader v0.0.1 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.14 // indirect
|
|
||||||
github.com/mattn/go-sqlite3 v1.14.15 // indirect
|
github.com/mattn/go-sqlite3 v1.14.15 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
||||||
github.com/miekg/pkcs11 v1.1.1 // indirect
|
github.com/miekg/pkcs11 v1.1.1 // indirect
|
||||||
@ -200,7 +199,6 @@ require (
|
|||||||
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
|
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
|
||||||
github.com/philhofer/fwd v1.1.1 // indirect
|
github.com/philhofer/fwd v1.1.1 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/pkg/profile v1.7.0 // indirect
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/prometheus/client_golang v1.13.0 // indirect
|
github.com/prometheus/client_golang v1.13.0 // indirect
|
||||||
github.com/prometheus/client_model v0.2.0 // indirect
|
github.com/prometheus/client_model v0.2.0 // indirect
|
||||||
@ -217,13 +215,11 @@ require (
|
|||||||
github.com/sigstore/fulcio v0.6.0 // indirect
|
github.com/sigstore/fulcio v0.6.0 // indirect
|
||||||
github.com/sigstore/rekor v1.0.0 // indirect
|
github.com/sigstore/rekor v1.0.0 // indirect
|
||||||
github.com/sigstore/sigstore v1.4.5 // indirect
|
github.com/sigstore/sigstore v1.4.5 // indirect
|
||||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
|
||||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
|
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
|
||||||
github.com/slsa-framework/slsa-github-generator v1.2.0 // indirect
|
github.com/slsa-framework/slsa-github-generator v1.2.0 // indirect
|
||||||
github.com/soheilhy/cmux v0.1.5 // indirect
|
github.com/soheilhy/cmux v0.1.5 // indirect
|
||||||
github.com/spf13/afero v1.8.2 // indirect
|
github.com/spf13/afero v1.8.2 // indirect
|
||||||
github.com/spf13/cast v1.5.0 // indirect
|
github.com/spf13/cast v1.5.0 // indirect
|
||||||
github.com/spf13/cobra v1.6.1 // indirect
|
|
||||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/spf13/viper v1.13.0 // indirect
|
github.com/spf13/viper v1.13.0 // indirect
|
||||||
@ -283,11 +279,9 @@ require (
|
|||||||
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a // indirect
|
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a // indirect
|
||||||
google.golang.org/grpc v1.50.1 // indirect
|
google.golang.org/grpc v1.50.1 // indirect
|
||||||
google.golang.org/protobuf v1.28.1 // indirect
|
google.golang.org/protobuf v1.28.1 // indirect
|
||||||
gopkg.in/DataDog/dd-trace-go.v1 v1.43.1 // indirect
|
|
||||||
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
|
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
|
||||||
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
|
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
|
Loading…
Reference in New Issue
Block a user