schema

package
v0.0.0-...-a492bfc Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2018 License: Apache-2.0 Imports: 4 Imported by: 39

Documentation

Overview

Package schema represents linux-inspect schema.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(raw RawData) string

Generate generates go struct text from given RawData.

func GoType

func GoType(tp reflect.Kind) string

GoType converts to Go type.

func ToField

func ToField(s string) string

ToField converts raw YAML key to Go field name.

func ToFieldTag

func ToFieldTag(s string) string

ToFieldTag converts raw key to field name.

Types

type Column

type Column struct {
	Name  string
	Godoc string
	Kind  reflect.Kind
}

Column represents the schema column.

type RawData

type RawData struct {
	// IsYAML is true if raw data is parsable in YAML.
	IsYAML bool

	Columns        []Column
	ColumnsToParse map[string]RawDataType
}

RawData defines 'proc' raw data.

type RawDataType

type RawDataType int

RawDataType defines how the raw data bytes are defined.

const (
	TypeBytes RawDataType = iota
	TypeInt64
	TypeFloat64
	TypeTimeMicroseconds
	TypeTimeSeconds
	TypeIPAddress
	TypeStatus
)

Jump to

Keyboard shortcuts

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