api

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 22 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DbClient represents the active database connection in a single-session mode
	DbClient *client.Client

	// DbSessions represents the mapping for client connections
	DbSessions = map[string]*client.Client{}
)

Functions

func Connect

func Connect(c *gin.Context)

Connect creates a new client connection

func ConnectWithBackend added in v0.9.9

func ConnectWithBackend(c *gin.Context)

ConnectWithBackend creates a new connection based on backend resource

func DB added in v0.8.0

func DB(c *gin.Context) *client.Client

DB returns a database connection from the client context

func DataExport added in v0.9.9

func DataExport(c *gin.Context)

DataExport performs database table export

func Disconnect added in v0.9.2

func Disconnect(c *gin.Context)

Disconnect closes the current database connection

func ExplainQuery

func ExplainQuery(c *gin.Context)

ExplainQuery renders query analyze profile

func GetActivity

func GetActivity(c *gin.Context)

GetActivity renders a list of running queries

func GetAsset

func GetAsset(c *gin.Context)

GetAsset renders the requested static asset

func GetBookmarks

func GetBookmarks(c *gin.Context)

GetBookmarks renders the list of available bookmarks

func GetConnectionInfo

func GetConnectionInfo(c *gin.Context)

GetConnectionInfo renders information about current connection

func GetDatabases

func GetDatabases(c *gin.Context)

GetDatabases renders a list of all databases on the server

func GetHistory

func GetHistory(c *gin.Context)

GetHistory renders a list of recent queries

func GetHome

func GetHome(c *gin.Context)

GetHome renderes the home page

func GetInfo

func GetInfo(c *gin.Context)

GetInfo renders the pgweb system information

func GetObjects added in v0.9.0

func GetObjects(c *gin.Context)

GetObjects renders a list of database objects

func GetSchemas

func GetSchemas(c *gin.Context)

GetSchemas renders list of available schemas

func GetSessions added in v0.8.0

func GetSessions(c *gin.Context)

GetSessions renders the number of active sessions

func GetTable

func GetTable(c *gin.Context)

GetTable renders table information

func GetTableConstraints added in v0.7.0

func GetTableConstraints(c *gin.Context)

GetTableConstraints renders a list of database constraints

func GetTableIndexes

func GetTableIndexes(c *gin.Context)

GetTableIndexes renders a list of database table indexes

func GetTableInfo

func GetTableInfo(c *gin.Context)

GetTableInfo renders a selected table information

func GetTableRows

func GetTableRows(c *gin.Context)

GetTableRows renders table rows

func HandleQuery

func HandleQuery(query string, c *gin.Context)

HandleQuery runs the database query

func RunQuery

func RunQuery(c *gin.Context)

RunQuery executes the query

func SetupMiddlewares added in v0.6.3

func SetupMiddlewares(group *gin.RouterGroup)

func SetupRoutes

func SetupRoutes(router *gin.Engine)

func StartSessionCleanup added in v0.9.9

func StartSessionCleanup()

StartSessionCleanup starts a goroutine to cleanup idle database sessions

func SwitchDb added in v0.9.6

func SwitchDb(c *gin.Context)

SwitchDb perform database switch for the client connection

Types

type Backend added in v0.9.9

type Backend struct {
	Endpoint    string
	Token       string
	PassHeaders string
}

Backend represents a third party configuration source

func (Backend) FetchCredential added in v0.9.9

func (be Backend) FetchCredential(resource string, c *gin.Context) (*BackendCredential, error)

FetchCredential sends an authentication request to a third-party service

type BackendCredential added in v0.9.9

type BackendCredential struct {
	DatabaseURL string `json:"database_url"`
}

BackendCredential represents the third-party response

type BackendRequest added in v0.9.9

type BackendRequest struct {
	Resource string            `json:"resource"`
	Token    string            `json:"token"`
	Headers  map[string]string `json:"headers"`
}

BackendRequest represents a payload sent to the third-party source

type Error

type Error struct {
	Message string `json:"error"`
}

func NewError

func NewError(err error) Error

Jump to

Keyboard shortcuts

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