Documentation ¶
Overview ¶
Package lib contains code shared by httplive packages.
Index ¶
- Constants
- Variables
- func APIMiddleware() gin.HandlerFunc
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetNames() []string
- func Broadcast(c *gin.Context)
- 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 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 InitDbValues()
- func NewUUID() (string, error)
- func OpenDb() error
- func SaveEndpoint(model *APIDataModel) error
- func StaticFileMiddleware() gin.HandlerFunc
- func TryBind(c *gin.Context) interface{}
- func TryGetAssetFile(c *gin.Context, filePath string)
- func TryGetLocalFile(c *gin.Context, filePath string)
- 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) DownloadFile(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 ¶
const DefaultDbName = "httplive-1a.db"
DefaultDbName ...
const DefaultMemory = 32 * 1024 * 1024
DefaultMemory Form data ...
Variables ¶
var Clients = make(map[string]*websocket.Conn)
Clients ...
var Environments = EnvironmentVariables{}
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 CreateEndpointKey ¶
CreateEndpointKey ...
func GetMultiPartFormValue ¶
GetMultiPartFormValue ...
Types ¶
type APIDataModel ¶
type APIDataModel struct { ID int `json:"id"` Endpoint string `json:"endpoint"` Method string `json:"method"` MimeType string `json:"mimeType"` Filename string `json:"filename"` FileContent []byte `json:"-"` 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 `form:"originKey"` Endpoint string `form:"endpoint"` Method string `form:"method"` IsFileResult bool `form:"isFileResult"` }
EndpointModel ...
type EnvironmentVariables ¶
type EnvironmentVariables struct { WorkingDirectory string DatabaseFullPath 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) DownloadFile ¶
func (ctrl WebCliController) DownloadFile(c *gin.Context)
DownloadFile ...
func (WebCliController) Endpoint ¶
func (ctrl WebCliController) Endpoint(c *gin.Context)
Endpoint ...
func (WebCliController) SaveEndpoint ¶
func (ctrl WebCliController) SaveEndpoint(c *gin.Context)
SaveEndpoint ...