trv

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Nullable bool   `json:"nullable"`
	Defaul   bool   `json:"default"`
	Comment  string `json:"comment"`
}

type Config

type Config struct {
	Source []Source `json:"source"`
}

func (Config) Exists added in v0.0.11

func (c Config) Exists() (bool, error)

Check if there is a config file

type DB

type DB struct {
	Tables []Table `json:"tables"`
	Name   string  `json:"name"`
	Desc   string  `json:"desc"`
}

type Info added in v0.0.40

type Info struct {
	Table  Table
	Column Column
}

type Repositories added in v0.0.25

type Repositories interface {
	GetContents(ctx context.Context, owner string, repo string, path string, opt *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, resp *github.Response, err error)
}

type Source

type Source struct {
	Owner        string `json:"owner"`
	Repo         string `json:"repo"`
	Path         string `json:"path"`
	IsEnterprise bool   `json:"isEnterprise"`
	Token        string `json:"token"`
	BaseURL      string `json:"baseURL"`
	UploadURL    string `json:"uploadURL"`
}

func (Source) NewClient

func (s Source) NewClient() (*github.Client, context.Context, error)

Generate GitHub client

type Table

type Table struct {
	Name        string   `json:"name"`
	Description string   `json:"comment"`
	Columns     []Column `json:"columns"`
}

type Trv

type Trv struct {
	Config         Config
	Source         []string
	DB             DB
	Tables         []Table
	SourceSelecter *tview.DropDown
	TableViewer    *tview.Table
	Searcher       *tview.InputField
	Pages          *tview.Pages
	DetailsLayout  *tview.Grid
	DetailsText    *tview.TextView
	Info           *tview.Grid
	InfoText       *tview.TextView
	App            *tview.Application
	Layout         *tview.Grid
	Modal          tview.Primitive
	ErrorModal     tview.Primitive
	Form           *tview.Form
	ErrorWindow    *tview.Modal
}

func (Trv) CreateConfig added in v0.0.11

func (t Trv) CreateConfig()

set Configuration form

func (Trv) Draw

func (t Trv) Draw()

drawing

func (*Trv) Init

func (t *Trv) Init() error

Prepare to start trv. Specifically, loading the configuration, loading the data, and preparing the TUI.

func (*Trv) SetInfoText added in v0.0.41

func (t *Trv) SetInfoText(s string)

Jump to

Keyboard shortcuts

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