specs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMatchMap

func BuildMatchMap(FSSpecMap map[string]interface{}, s SpecFS)

BuildMatchMap build fs match map

func CreateFSCacheFromSpecFiles

func CreateFSCacheFromSpecFiles(specFiles []string) (map[string]*FS, error)

CreateFSCacheFromSpecFiles build spec fs cache for data processing

func CreateFSMapFromSpecFiles

func CreateFSMapFromSpecFiles(specFiles []string) (map[string]interface{}, error)

CreateFSMapFromSpecFiles build spec api cache for presenting trace data

func CreateMapFromSpecFiles

func CreateMapFromSpecFiles(specFiles []string) (map[string]*API, error)

CreateMapFromSpecFiles build spec api cache for presenting trace data

Types

type API

type API struct {
	Name        string `mapstructure:"name" yaml:"name"`
	Description string `mapstructure:"description" yaml:"description"`
	URI         string `mapstructure:"uri" yaml:"uri"`
	Method      string `mapstructure:"method" yaml:"method"`
	Severity    string `mapstructure:"severity" yaml:"severity"`
	SeverityInt int    `mapstructure:"severity_int" yaml:"severity_int"`
}

API data model

func (*API) UnmarshalYAML

func (at *API) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML over unmarshall

type Category

type Category struct {
	Name        string       `yaml:"name"`
	SubCategory *SubCategory `yaml:"sub_category"`
}

Category data model

type CategoryFS

type CategoryFS struct {
	Name        string         `yaml:"name"`
	SubCategory *SubCategoryFS `yaml:"sub_category"`
}

CategoryFS data model

type FS

type FS struct {
	Name        string   `mapstructure:"name" yaml:"name"`
	Description string   `mapstructure:"description" yaml:"description"`
	Commands    []string `mapstructure:"commands" yaml:"commands"`
	Severity    string   `mapstructure:"severity" yaml:"severity"`
	SeverityInt int      `mapstructure:"severity_int" yaml:"severity_int"`
}

FS data model

func (*FS) UnmarshalYAML

func (at *FS) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML over unmarshall

type Route

type Route struct {
	Method  string
	Pattern string
}

A Route defines the parameters for an api endpoint

type Routes

type Routes []Route

Routes api routes

func BuildSpecRoutes

func BuildSpecRoutes(files []string) ([]Routes, error)

BuildSpecRoutes build api routes from spec file

type SpecAPI

type SpecAPI struct {
	SpecFile   string     `yaml:"spec"`
	Categories []Category `yaml:"categories"`
}

SpecAPI data model

func (*SpecAPI) Routes

func (s *SpecAPI) Routes() Routes

Routes build routes

type SpecFS

type SpecFS struct {
	SpecFile   string       `yaml:"spec"`
	Categories []CategoryFS `yaml:"categories"`
}

SpecFS data model

type SubCategory

type SubCategory struct {
	Name string `yaml:"name"`
	API  []*API `yaml:"api"`
}

SubCategory data model

type SubCategoryFS

type SubCategoryFS struct {
	Name string `yaml:"name"`
	FS   []*FS  `yaml:"fs"`
}

SubCategoryFS data model

Jump to

Keyboard shortcuts

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