devtool

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ConnectorId = "dev-server"
	RefreshId   = "dev-refresh"
	ToolId      = "dev-tool"
	RequestId   = "dev-tool-request"
)
View Source
const (
	PluginDebug    = "debug"
	PluginDatabase = "database"
	PluginSession  = "session"
	PluginParam    = "param"
)
View Source
const (
	DefaultPort = "1993"
)
View Source
const (
	DynamicStyle = "devtool-dynamic-style"
)
View Source
const (
	StateCookieKey = "X-State"
)

Variables

View Source
var (
	ToolConfig = &Config{
		Port:   DefaultPort,
		Plugin: make(map[string]Plugin),
	}
)

Functions

func CreateNode added in v0.1.8

func CreateNode() Node

func FormatSql added in v0.1.8

func FormatSql(value string) string

func HandleConnection added in v0.1.8

func HandleConnection(ws socketer.Ws) http.HandlerFunc

func HandleRefresh added in v0.1.8

func HandleRefresh(ws socketer.Ws) http.HandlerFunc

func HandleRequest added in v0.1.8

func HandleRequest(ws socketer.Ws, cache *sync.Map) http.HandlerFunc

func HandleTool added in v0.1.8

func HandleTool(cache *sync.Map, assetsId string) http.HandlerFunc

func HandleToolScripts added in v0.1.8

func HandleToolScripts(assetsId string) http.HandlerFunc

func HandleToolStyles added in v0.1.8

func HandleToolStyles() http.HandlerFunc

func Push added in v0.1.8

func Push(id string, props Props) error

func Recover added in v0.1.8

func Recover(assets Node, err error) Node

func Refresh added in v0.1.8

func Refresh()

func Serve added in v0.1.8

func Serve()

Types

type Config added in v0.1.8

type Config struct {
	Port   string
	Plugin map[string]Plugin
}

type Plugin added in v0.1.8

type Plugin struct {
	Title     string
	IconPath  Node
	Reference bool
	RowFunc   func(value string) Node
}

type Props added in v0.1.8

type Props struct {
	Path       string
	Name       string
	StatusCode int
	RenderTime int
	Param      map[string]any
	Plugin     map[string][]string
}

Jump to

Keyboard shortcuts

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