lib

package
v0.0.0-...-968ba5a Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorDanger = lipgloss.Color("#F25D94")
	ColorOk     = lipgloss.AdaptiveColor{Light: "#43BF6D", Dark: "#73F59F"}
)
View Source
var (
	ANSIBlack         = "0"
	ANSIRed           = "1"
	ANSIGreen         = "2"
	ANSIYellow        = "3"
	ANSIBlue          = "4"
	ANSIMagenta       = "5"
	ANSICyan          = "6"
	ANSIWhite         = "7"
	ANSIBrightBlack   = "8"
	ANSIBrightRed     = "9"
	ANSIBrightGreen   = "10"
	ANSIBrightYellow  = "11"
	ANSIBrightBlue    = "12"
	ANSIBrightMagenta = "13"
	ANSIBrightCyan    = "14"
	ANSIBrightWhite   = "15"
	ANSILightRed      = "203"
	ANSILightGray     = "248"
)

ANSI Color Definitions

Functions

func EnterString

func EnterString(m tea.Model, keys string) tea.Model

func GetDefaultListDelegate

func GetDefaultListDelegate() list.DefaultDelegate
func NavigateLeft() tea.Msg
func NavigateRight() tea.Msg

Types

type Address

type Address struct {
	Url    string
	Method string
}

type Bookmark

type Bookmark struct {
	ID   uint   `gorm:"primaryKey"`
	Name string `gorm:"unique"`
	Url  string
}

type Client

type Client interface {
	MakeRequest(request Request) (Response, error)
	GetRawCookies() string
}
type Cookie struct {
	ID  uint `gorm:"primaryKey"`
	Raw string
}

type DbPersistence

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

func NewDbPersistence

func NewDbPersistence() (DbPersistence, error)

func (DbPersistence) AnnotateHistory

func (d DbPersistence) AnnotateHistory(id uint, annotation string) error

func (DbPersistence) GetBookmark

func (d DbPersistence) GetBookmark(name string) (Bookmark, error)

func (DbPersistence) GetBookmarks

func (d DbPersistence) GetBookmarks() []Bookmark

func (DbPersistence) GetHistory

func (d DbPersistence) GetHistory() []History

func (DbPersistence) GetRawCookies

func (d DbPersistence) GetRawCookies() string

func (DbPersistence) SaveBookmark

func (d DbPersistence) SaveBookmark(bookmark Bookmark)

func (DbPersistence) SaveHistory

func (d DbPersistence) SaveHistory(history History)

func (DbPersistence) SaveRawCookies

func (d DbPersistence) SaveRawCookies(rawCookie string)

type DefaultClient

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

func NewHttpClient

func NewHttpClient(rawCookies string) DefaultClient

func (DefaultClient) GetRawCookies

func (c DefaultClient) GetRawCookies() string

func (DefaultClient) MakeRequest

func (c DefaultClient) MakeRequest(request Request) (Response, error)

type Event

type Event int
var (
	NewRequest Event = 1
	LostFocus  Event = 2
	GainFocus  Event = 3

	TabLeft  Event = 4
	TabRight Event = 5

	UpdateHistory   Event = 6
	UpdateBookmarks Event = 7

	SavedResponse Event = 10

	Reset Event = 11
)

type FreeTextCommand

type FreeTextCommand string

type History

type History struct {
	ID                uint `gorm:"primaryKey"`
	Date              time.Time
	Method            string
	Url               string
	HeadersSerialized string
	Body              string
	Annotation        string
	Status            int

	Headers map[string][]string `gorm:"-"`
}

func (*History) AfterFind

func (h *History) AfterFind(tx *gorm.DB) error

func (*History) BeforeCreate

func (h *History) BeforeCreate(tx *gorm.DB) error

type Keymap

type Keymap struct {
	NextTab           key.Binding
	Quit              key.Binding
	ToggleCommandMode key.Binding
}

func DefaultKeyBinds

func DefaultKeyBinds() Keymap

type Mode

type Mode string
var (
	Url    Mode = "url"
	Cmd    Mode = "cmd"
	Detail Mode = "xfg"
)

type Pair

type Pair struct {
	Key   string
	Value string
	Ref   interface{}
}

func (Pair) Description

func (h Pair) Description() string

func (Pair) FilterValue

func (h Pair) FilterValue() string

func (Pair) Title

func (h Pair) Title() string

type Persistence

type Persistence interface {
	SaveHistory(history History)
	GetHistory() []History
	AnnotateHistory(id uint, annotation string) error
	SaveBookmark(bookmark Bookmark)
	GetBookmarks() []Bookmark
	GetBookmark(name string) (Bookmark, error)
	SaveRawCookies(rawCookie string)
	GetRawCookies() string
}

type Prettier

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

func ColoredPrettier

func ColoredPrettier() Prettier

func NoColorPrettier

func NoColorPrettier() Prettier

func (Prettier) HighlightJson

func (p Prettier) HighlightJson(content string) (string, error)

type Request

type Request struct {
	Address
	Headers http.Header
	Body    string
}

type RequestError

type RequestError struct {
	Err     error
	Request *Request // ref to the original request
}

type Response

type Response struct {
	Body    []byte
	Cookies []*http.Cookie
	Headers http.Header
	Status  int
	Time    int64
	Request Request
}

func (Response) Render

func (response Response) Render(pretty bool) string

type ShortMessage

type ShortMessage string // SMS

type Status

type Status int32
var (
	IDLE       Status = 0
	PROCESSING Status = 1
	ERROR      Status = 3
)

func (Status) GetValue

func (s Status) GetValue() int

Jump to

Keyboard shortcuts

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