bookmarks

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 8 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path(overrideDir string) string

Path returns bookmarks storage path

func ReadAll

func ReadAll(path string) (map[string]Bookmark, error)

ReadAll returns all available bookmarks

Types

type Bookmark

type Bookmark struct {
	URL      string          `json:"url"`      // Postgres connection URL
	Host     string          `json:"host"`     // Server hostname
	Port     int             `json:"port"`     // Server port
	User     string          `json:"user"`     // Database user
	Password string          `json:"password"` // User password
	Database string          `json:"database"` // Database name
	Ssl      string          `json:"ssl"`      // Connection SSL mode
	SSH      *shared.SSHInfo `json:"ssh"`      // SSH tunnel config
}

Bookmark contains information about bookmarked database connection

func GetBookmark added in v0.9.6

func GetBookmark(bookmarkPath string, bookmarkName string) (Bookmark, error)

GetBookmark reads an existing bookmark

func (Bookmark) ConvertToOptions added in v0.9.6

func (b Bookmark) ConvertToOptions() command.Options

ConvertToOptions returns an options struct from connection details

func (Bookmark) SSHInfoIsEmpty added in v0.9.6

func (b Bookmark) SSHInfoIsEmpty() bool

SSHInfoIsEmpty returns true if ssh configration is not provided

Jump to

Keyboard shortcuts

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