gendoc

package
v0.0.0-...-46723fb Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileOptions

func FileOptions(f *ast.File) ([]interface{}, error)

FileOptions walks the specified ast.File for options structs used when creating metrics and returns instances that are recreated from the source.

func Options

func Options(pkgs []*packages.Package) ([]interface{}, error)

Options scans the provided list of packages for options structs used when creating metrics and returns instances that are recreated from the source tree.

Types

type Cell

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

func (Cell) BucketFormat

func (c Cell) BucketFormat() string

func (Cell) Description

func (c Cell) Description() string

func (Cell) Field

func (c Cell) Field(f Field) string

func (Cell) Labels

func (c Cell) Labels() string

func (Cell) Name

func (c Cell) Name() string

func (Cell) Type

func (c Cell) Type() string

type Cells

type Cells []Cell

func NewCells

func NewCells(options []interface{}) (Cells, error)

NewCells transforms metrics options to cells that can be used for doc generation.

func (Cells) Len

func (c Cells) Len() int

func (Cells) Less

func (c Cells) Less(i, j int) bool

func (Cells) MaxLen

func (c Cells) MaxLen(f Field) int

func (Cells) Swap

func (c Cells) Swap(i, j int)

type Column

type Column struct {
	Field Field
	Name  string
	Width int
}

A Column represents a column of data in the reference table.

type Field

type Field uint8

A Field represents data that is included in the reference table for metrics.

const (
	Name        Field = iota // Name is the meter name.
	Type                     // Type is the type of meter option.
	Description              // Description is the help text from the meter option.
	Labels                   // Labels is the meter's label information.
	Bucket                   // Bucket is the statsd bucket format
)

type Table

type Table struct {
	Columns []Column
	Cells   Cells
}

A Table maintains the cells and columns used to generate the restructured text formatted reference documentation.

func NewPrometheusTable

func NewPrometheusTable(cells Cells) Table

NewPrometheusTable creates a table that can be used to document Prometheus metrics maintained by Fabric.

func NewStatsdTable

func NewStatsdTable(cells Cells) Table

NewStatsdTable creates a table that can be used to document StatsD metrics maintained by Fabric.

func (Table) Generate

func (t Table) Generate(w io.Writer)

Generate generates a restructured text formatted table from the cells and columns contained in the table.

Jump to

Keyboard shortcuts

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