Documentation ¶
Index ¶
- Constants
- type BaseInfo
- type Content
- type Database
- type DatabaseTree
- type DocModifier
- func (d *DocModifier) Duplicate(ctx context.Context, db, coll string, rawDocument string) (primitive.ObjectID, error)
- func (d *DocModifier) Edit(ctx context.Context, db, coll string, _id interface{}, jsonDoc string) (string, error)
- func (d *DocModifier) Insert(ctx context.Context, db, coll string) (primitive.ObjectID, error)
- type Header
- type InputBar
- type Peeker
- type ViewType
Constants ¶
const ( ContentComponent = "Content" JsonViewComponent = "JsonView" QueryBarComponent = "QueryBar" SortBarComponent = "SortBar" ContentDeleteModal = "ContentDeleteModal" )
const ( DatabaseComponent = "Database" FilterBarView = "FilterBar" )
const ( InputModalView = "InputModal" ConfirmModalView = "ConfirmModal" DatabaseTreeComponent = "DatabaseTree" DatabaseDeleteModal = "DatabaseDeleteModal" )
const (
DocModifierView = "DocModifier"
)
const (
HeaderComponent = "Header"
)
const (
PeekerComponent = "Peeker"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶
type Content struct { *core.BaseElement *core.Flex // contains filtered or unexported fields }
Content is a view that displays documents in a table
func NewContent ¶
func NewContent() *Content
func (*Content) HandleDatabaseSelection ¶
HandleDatabaseSelection is called when a database/collection is selected in the DatabaseTree
type Database ¶
type Database struct { *core.BaseElement *core.Flex DbTree *DatabaseTree // contains filtered or unexported fields }
Database is flex container for DatabaseTree and InputBar
func NewDatabase ¶
func NewDatabase() *Database
type DatabaseTree ¶
type DatabaseTree struct { *core.BaseElement *core.TreeView // contains filtered or unexported fields }
func NewDatabaseTree ¶
func NewDatabaseTree() *DatabaseTree
func (*DatabaseTree) RefreshStyle ¶
func (t *DatabaseTree) RefreshStyle()
func (*DatabaseTree) Render ¶
func (t *DatabaseTree) Render(ctx context.Context, dbsWitColls []mongo.DBsWithCollections, expand bool)
func (*DatabaseTree) SetSelectFunc ¶
type DocModifier ¶
type DocModifier struct {
*core.BaseElement
}
DocModifier is a view that allows editing JSON documents
func NewDocModifier ¶
func NewDocModifier() *DocModifier
func (*DocModifier) Duplicate ¶
func (d *DocModifier) Duplicate(ctx context.Context, db, coll string, rawDocument string) (primitive.ObjectID, error)
Duplicate opens the editor with the document and saves it as a new document
type Header ¶
type Header struct { *core.BaseElement *core.Table // contains filtered or unexported fields }
Header is a view that displays basic information and keybindings in the header
func (*Header) SetBaseInfo ¶
SetBaseInfo sets the basic information about the database connection
type InputBar ¶
type InputBar struct { *core.BaseElement *core.InputField // contains filtered or unexported fields }
func NewInputBar ¶
func NewInputBar(barId tview.Identifier, label string) *InputBar
func (*InputBar) DoneFuncHandler ¶
DoneFuncHandler sets DoneFunc for the input bar It accepts two functions: accept and reject which are called when user accepts or rejects the input
func (*InputBar) EnableAutocomplete ¶
func (i *InputBar) EnableAutocomplete()
EnableAutocomplete enables autocomplete
func (*InputBar) EnableHistory ¶
func (i *InputBar) EnableHistory()
EnableHistory enables history modal
func (*InputBar) LoadNewKeys ¶
LoadNewKeys loads new keys for autocomplete It is used when switching databases or collections
func (*InputBar) SetDefaultText ¶
SetDefaultText sets default text for the input bar
type Peeker ¶
type Peeker struct { *core.BaseElement *core.ViewModal // contains filtered or unexported fields }
Peeker is a view that provides a modal view for peeking at a document
func (*Peeker) MoveToBottom ¶
func (p *Peeker) MoveToBottom()
func (*Peeker) SetDoneFunc ¶
func (p *Peeker) SetDoneFunc(doneFunc func())