apixt

package module
v0.0.0-...-86a1d0e Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 20 Imported by: 0

README

go-apixt

Extends your golang API with a secret route that simplifies development and debugging

Documentation

Index

Constants

View Source
const CrownKey ctxKey = 1
View Source
const DUMP_PARAM = "dump"
View Source
const STOP_NEXT_PREFIX = "-"

Variables

View Source
var DumpBlockNodeType string = "DumpBlockNode"
View Source
var SectionInfoNodeType string = "SectionInfoNode"
View Source
var SectionNodeType string = "SectionNode"

Functions

func Get

func Get(r *http.Request) *dmpTree

func GetResolvedTemplate

func GetResolvedTemplate() (string, error)

func NewDumpTree

func NewDumpTree(r *http.Request) *dmpTree

func NewRootNode

func NewRootNode() *rootNode

func SplitString

func SplitString(input string) string

Types

type ApixtConfig

type ApixtConfig struct {
	ApiId       string        `json:"apiId"`
	Permanent   bool          `json:"permanent"`
	BaseUrl     string        `json:"-"`
	DumpPath    string        `json:"dumpPath"`
	Routes      []string      `json:"routes"`
	DumpHeader  string        `json:"dumpHeader"`
	StorePrefix string        `json:"storePrefix"`
	JwtSecret   string        `json:"-"`
	Users       []Credentials `json:"-"`
}

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.RegisteredClaims
}

type Credentials

type Credentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Dmux

type Dmux struct {
	// contains filtered or unexported fields
}

func Init

func Init(oldHandler *http.ServeMux, config ApixtConfig) *Dmux

func (*Dmux) HandleFunc

func (dm *Dmux) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

func (*Dmux) ServeHTTP

func (s *Dmux) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DumpBlockNode

type DumpBlockNode struct {
	// contains filtered or unexported fields
}

func NewDumpBlockNode

func NewDumpBlockNode(title, inner string, options blockOptions) *DumpBlockNode

type PageData

type PageData struct {
	Title  string
	CSS    template.CSS
	JS     template.JS
	Config template.JS
}

type SectionInfoNode

type SectionInfoNode struct {
	// contains filtered or unexported fields
}

func NewSectionInfoNode

func NewSectionInfoNode(parent int) *SectionInfoNode

type SectionNode

type SectionNode struct {
	// contains filtered or unexported fields
}

func NewSectionNode

func NewSectionNode(title string, parent int) *SectionNode

type Timer

type Timer struct {
	// contains filtered or unexported fields
}

func (*Timer) End

func (t *Timer) End() int64

func (*Timer) Start

func (t *Timer) Start() int

func (*Timer) Stop

func (t *Timer) Stop()

type Timers

type Timers struct {
	// contains filtered or unexported fields
}

func NewTimers

func NewTimers() *Timers

Jump to

Keyboard shortcuts

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