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(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.
type Cell struct {
// contains filtered or unexported fields
}
func (c Cell) BucketFormat() string
func (c Cell) Description() string
func (c Cell) Field(f Field) string
func (c Cell) Labels() string
func (c Cell) Name() string
func (c Cell) Type() string
type Cells []Cell
func NewCells(options []interface{}) (Cells, error)
NewCells transforms metrics options to cells that can be used for doc generation.
func (c Cells) Len() int
func (c Cells) Less(i, j int) bool
func (c Cells) MaxLen(f Field) int
func (c Cells) Swap(i, j int)
A Column represents a column of data in the reference table.
type Column struct { Field Field Name string Width int }
A Field represents data that is included in the reference table for metrics.
type Field uint8
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 )
A Table maintains the cells and columns used to generate the restructured text formatted reference documentation.
type Table struct { Columns []Column Cells Cells }
func NewPrometheusTable(cells Cells) Table
NewPrometheusTable creates a table that can be used to document Prometheus metrics maintained by Fabric.
func NewStatsdTable(cells Cells) Table
NewStatsdTable creates a table that can be used to document StatsD metrics maintained by Fabric.
func (t Table) Generate(w io.Writer)
Generate generates a restructured text formatted table from the cells and columns contained in the table.