pages

package
v0.0.0-...-e270a8f Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HELP_MESSAGE string
View Source
var NAMES map[Index]string = map[Index]string{
	WELCOME:          "welcome",
	ENDPOINTS:        "endpoints",
	POPUP:            "popup",
	HELP:             "help",
	NEW_COLLECTION:   "new_collection",
	LIST_COLLECTIONS: "list_collections",
}
View Source
var WELCOME_MESSAGE string

Functions

This section is empty.

Types

type EndpointsPage

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

func (*EndpointsPage) Index

func (page *EndpointsPage) Index() Index

func (*EndpointsPage) Page

func (page *EndpointsPage) Page() tview.Primitive

func (*EndpointsPage) Setup

func (page *EndpointsPage) Setup() error

type HelpPage

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

func (*HelpPage) Index

func (page *HelpPage) Index() Index

func (*HelpPage) Page

func (page *HelpPage) Page() tview.Primitive

func (*HelpPage) Setup

func (page *HelpPage) Setup() error

type Index

type Index int
const (
	WELCOME Index = iota
	HELP
	ENDPOINTS
	NEW_COLLECTION
	LIST_COLLECTIONS

	POPUP
)

type ListCollectionsPage

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

func (*ListCollectionsPage) Index

func (page *ListCollectionsPage) Index() Index

func (*ListCollectionsPage) Page

func (page *ListCollectionsPage) Page() tview.Primitive

func (*ListCollectionsPage) Setup

func (page *ListCollectionsPage) Setup() error

func (*ListCollectionsPage) UpdateCollectionList

func (page *ListCollectionsPage) UpdateCollectionList() error

type Manager

type Manager struct {
	Welcome         *WelcomePage
	Endpoints       *EndpointsPage
	Help            *HelpPage
	NewCollection   *NewCollectionPage
	ListCollections *ListCollectionsPage
}

func New

func New(client *hyperHttp.HttpClient, database *db.Database, ppm *popup.Manager, popPage OnPopPageCallback) (*Manager, error)

func (*Manager) GetPage

func (pm *Manager) GetPage(index Index) (Page, error)

type NewCollectionPage

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

func (*NewCollectionPage) Index

func (page *NewCollectionPage) Index() Index

func (*NewCollectionPage) Page

func (page *NewCollectionPage) Page() tview.Primitive

func (*NewCollectionPage) Setup

func (page *NewCollectionPage) Setup() error

type OnAddNewCollectionCallback

type OnAddNewCollectionCallback func(name string) error

type OnListCollectionsCallback

type OnListCollectionsCallback func() ([]*models.Collection, error)

type OnListEndpointsCallback

type OnListEndpointsCallback func() ([]*models.Endpoint, error)

type OnPopPageCallback

type OnPopPageCallback func()

type OnRequestCallback

type OnRequestCallback func(http.Request) (*http.Response, error)

type OnShowPopupCallback

type OnShowPopupCallback func(kind popup.Kind, text string)

type OnUpdateCollectionList

type OnUpdateCollectionList func() error

type Page

type Page interface {
	Setup() error
	Index() Index
	Page() tview.Primitive
}

type WelcomePage

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

func (*WelcomePage) Index

func (page *WelcomePage) Index() Index

func (*WelcomePage) Page

func (page *WelcomePage) Page() tview.Primitive

func (*WelcomePage) Setup

func (page *WelcomePage) Setup() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳