Skip to content

Commit

Permalink
iFix formating
Browse files Browse the repository at this point in the history
  • Loading branch information
nitisht committed Oct 22, 2023
1 parent 87805f5 commit b4e91d5
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"io"
"net/http"
"net/url"
"pb/pkg/config"
"time"

"pb/pkg/config"
)

type HTTPClient struct {
Expand Down
1 change: 1 addition & 0 deletions cmd/pre.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package cmd
import (
"errors"
"os"

"pb/pkg/config"

"github.com/spf13/cobra"
Expand Down
1 change: 1 addition & 0 deletions cmd/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"net/url"
"os"

"pb/pkg/config"
"pb/pkg/model/credential"
"pb/pkg/model/defaultprofile"
Expand Down
3 changes: 2 additions & 1 deletion cmd/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import (
"fmt"
"io"
"os"
"pb/pkg/model/role"
"strings"
"sync"

"pb/pkg/model/role"

tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/spf13/cobra"
Expand Down
1 change: 1 addition & 0 deletions cmd/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"

"pb/pkg/config"

"github.com/apache/arrow/go/v13/arrow/array"
Expand Down
3 changes: 2 additions & 1 deletion cmd/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ import (
"fmt"
"io"
"os"
"pb/pkg/model/role"
"sync"

"pb/pkg/model/role"

tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/spf13/cobra"
Expand Down
3 changes: 2 additions & 1 deletion pkg/model/credential/credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
package credential

import (
"pb/pkg/model/button"
"strings"

"pb/pkg/model/button"

"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
Expand Down
1 change: 1 addition & 0 deletions pkg/model/defaultprofile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package defaultprofile
import (
"fmt"
"io"

"pb/pkg/config"

"github.com/charmbracelet/bubbles/list"
Expand Down
10 changes: 5 additions & 5 deletions pkg/model/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ import (
)

const (
datetimeWidth = 26
datetimeKey = "p_timestamp"
dateTimeWidth = 26
dateTimeKey = "p_timestamp"
tagKey = "p_tags"
metadataKey = "p_metadata"
)
Expand Down Expand Up @@ -567,14 +567,14 @@ func fetchData(client *http.Client, profile *config.Profile, query string, start

func (m *QueryModel) UpdateTable(data FetchData) {
// pin p_timestamp to left if available
containsTimestamp := slices.Contains(data.schema, datetimeKey)
containsTimestamp := slices.Contains(data.schema, dateTimeKey)
containsTags := slices.Contains(data.schema, tagKey)
containsMetadata := slices.Contains(data.schema, metadataKey)
columns := make([]table.Column, len(data.schema))
columnIndex := 0

if containsTimestamp {
columns[0] = table.NewColumn(datetimeKey, datetimeKey, datetimeWidth)
columns[0] = table.NewColumn(dateTimeKey, dateTimeKey, dateTimeWidth)
columnIndex++
}

Expand All @@ -588,7 +588,7 @@ func (m *QueryModel) UpdateTable(data FetchData) {

for _, title := range data.schema {
switch title {
case datetimeKey, tagKey, metadataKey:
case dateTimeKey, tagKey, metadataKey:
continue
default:
width := inferWidthForColumns(title, &data.data, 100, 100) + 1
Expand Down
3 changes: 2 additions & 1 deletion pkg/model/role/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ package role

import (
"fmt"
"strings"

"pb/pkg/model/button"
"pb/pkg/model/selection"
"strings"

"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
Expand Down

0 comments on commit b4e91d5

Please sign in to comment.