api

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeAPI               = "api"
	TypeMethod            = "method"
	TypeEvent             = "event"
	TypeEventAliasWebhook = "webhook"
)

Variables

This section is empty.

Functions

func ParseOperationType added in v0.28.0

func ParseOperationType(input, def string) string

Types

type Operation added in v0.28.0

type Operation struct {
	Tags        []string
	Class       string // Object class for SDKs
	Type        string // Method or Event
	Path        string
	Summary     string
	Description string
	Link        string
}

func (*Operation) TrimSpace added in v0.28.0

func (op *Operation) TrimSpace()

type Operations added in v0.28.0

type Operations []Operation

func (Operations) Table added in v0.28.0

func (ops Operations) Table() ([]string, [][]string)

type URLTransformer

type URLTransformer struct {
	ExactPaths  []string
	RegexpPaths map[string]*regexp.Regexp
	// contains filtered or unexported fields
}

URLTransformer is useful for reading log files and converting actual request URls into pattners, such as those used in the OpenAPI Spec for reporting and categorization purposes.

func NewURLTransformer

func NewURLTransformer() URLTransformer

NewURLTransformer creates a new URLTransformer instance.

func (*URLTransformer) BuildReverseEndpointPattern

func (ut *URLTransformer) BuildReverseEndpointPattern(method, actualURL string) string

func (*URLTransformer) LoadPath

func (ut *URLTransformer) LoadPath(path string) error

LoadPath loads a single spec URL pattern.

func (*URLTransformer) LoadPaths

func (ut *URLTransformer) LoadPaths(paths []string) error

LoadPaths loads multiple spec URL patterns. See the test file for an example.

func (*URLTransformer) URLActualToPattern

func (ut *URLTransformer) URLActualToPattern(s string) string

URLActualToPattern is the "runtime" API that is called over and over for URL classification purposes.

Jump to

Keyboard shortcuts

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