expvar

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 3 Imported by: 1

README

expvar

Run Tests codecov Go Report Card GoDoc

A expvar handler with pretty output format for gin framework, expvar provides a standardized interface to public variables.

Usage

Start using it

Download and install it:

go get github.com/elliotxx/expvar

Import it in your code:

import "github.com/elliotxx/expvar"
Canonical example
package main

import (
  "log"

  "github.com/elliotxx/expvar"
  "github.com/gin-gonic/gin"
)

func main() {
  r := gin.Default()

  r.GET("/debug/vars", expvar.Handler())

  if err := r.Run(":8080"); err != nil {
    log.Fatal(err)
  }
}
Screenshot

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(opts ...Option) gin.HandlerFunc

Handler for gin framework

Types

type Option added in v1.1.1

type Option func(options *Options)

func WithFilters added in v1.1.1

func WithFilters(filters ...string) Option

type Options added in v1.1.1

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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