Documentation ¶
Overview ¶
Package lib contains code shared by httplive packages.
Index ¶
- Variables
- func APIMiddleware() gin.HandlerFunc
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func CORSMiddleware() gin.HandlerFunc
- func CloseDb()
- func ConfigJsMiddleware() gin.HandlerFunc
- func CreateDbBucket() error
- func CreateEndpointKey(method string, endpoint string) string
- func DeleteEndpoint(endpointKey string) error
- func GetBodyJSON(c *gin.Context) interface{}
- func GetFormBody(c *gin.Context) interface{}
- func GetHeaders(c *gin.Context) map[string]string
- func GetIP(c *gin.Context) string
- func GetMultiPartFormValue(c *gin.Context) interface{}
- func GetRequestBody(c *gin.Context) interface{}
- func HandleMessages()
- func InitDbValues()
- func MustAsset(name string) []byte
- func NewUUID() (string, error)
- func OpenDb() error
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func SaveEndpoint(model *APIDataModel) error
- func StaticFileMiddleware() gin.HandlerFunc
- type APIDataModel
- type BasicAuthResponse
- type CookiesResponse
- type DeflateResponse
- type EndpointModel
- type EnvironmentVariables
- type GetResponse
- type GzipResponse
- type HeadersResponse
- type IPResponse
- type JSONResponse
- type JsTreeDataModel
- type Pair
- type PairList
- type PostResponse
- type UserAgentResponse
- type WebCliController
- func (ctrl WebCliController) Backup(c *gin.Context)
- func (ctrl WebCliController) DeleteEndpoint(c *gin.Context)
- func (ctrl WebCliController) Endpoint(c *gin.Context)
- func (ctrl WebCliController) Save(c *gin.Context)
- func (ctrl WebCliController) SaveEndpoint(c *gin.Context)
- func (ctrl WebCliController) Tree(c *gin.Context)
- type WsMessage
Constants ¶
This section is empty.
Variables ¶
var Broadcast = make(chan WsMessage)
Broadcast ...
var Clients = make(map[*websocket.Conn]bool)
Clients ...
var Database = "httplive.db"
Database ...
var DatabasePath string
DatabasePath ...
var Environments = EnvironmentVariables{DatabaseName: "httplive.db"}
Environments ...
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func CreateEndpointKey ¶
CreateEndpointKey ...
func GetMultiPartFormValue ¶
GetMultiPartFormValue ...
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type APIDataModel ¶
type APIDataModel struct { ID int `json:"id"` Endpoint string `json:"endpoint"` Method string `json:"method"` Body string `json:"body"` }
APIDataModel ...
type BasicAuthResponse ¶
type BasicAuthResponse struct { Authenticated bool `json:"authenticated"` User string `json:"string"` }
BasicAuthResponse ...
type CookiesResponse ¶
CookiesResponse ...
type DeflateResponse ¶
type DeflateResponse struct { HeadersResponse IPResponse Deflated bool `json:"deflated"` }
DeflateResponse ...
type EndpointModel ¶
type EndpointModel struct { OriginKey string `json:originKey` Endpoint string `json:"endpoint"` Method string `json:"method"` }
EndpointModel ...
type EnvironmentVariables ¶
type EnvironmentVariables struct { DbFile string DatabaseName string DatabaseAttachedFullPath string DefaultPort string HasMultiplePort bool }
EnvironmentVariables ...
type GetResponse ¶
type GetResponse struct { Args map[string][]string `json:"args"` HeadersResponse IPResponse URL string `json:"url"` }
GetResponse ...
type GzipResponse ¶
type GzipResponse struct { HeadersResponse IPResponse Gzipped bool `json:"gzipped"` }
GzipResponse ...
type HeadersResponse ¶
HeadersResponse ...
type JsTreeDataModel ¶
type JsTreeDataModel struct { ID int `json:"id"` Key string `json:"key"` OriginKey string `json:"originKey"` Text string `json:"text"` Type string `json:"type"` Children []JsTreeDataModel `json:"children"` }
JsTreeDataModel ...
type PostResponse ¶
type PostResponse struct { Args map[string][]string `json:"args"` Data JSONResponse `json:"data"` Form map[string]string `json:"form"` HeadersResponse IPResponse URL string `json:"url"` }
PostResponse ...
type UserAgentResponse ¶
type UserAgentResponse struct {
UserAgent string `json:"user-agent"`
}
UserAgentResponse ...
type WebCliController ¶
type WebCliController struct {
Port string
}
WebCliController ...
func (WebCliController) DeleteEndpoint ¶
func (ctrl WebCliController) DeleteEndpoint(c *gin.Context)
DeleteEndpoint ...
func (WebCliController) Endpoint ¶
func (ctrl WebCliController) Endpoint(c *gin.Context)
Endpoint ...
func (WebCliController) SaveEndpoint ¶
func (ctrl WebCliController) SaveEndpoint(c *gin.Context)
SaveEndpoint ...