api

package
v0.40.11 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeAPI               = "api"
	TypeMethod            = "method"
	TypeCallbackMethod    = "callback"
	TypeEvent             = "event"
	TypeEventAliasWebhook = "webhook"
	TypeCategory          = "category" // mobile
	TypeClass             = "class"    // mobile
	TypeConstant          = "constant" // mobile
	TypeProtocol          = "protocol" // mobile

	MethodClass    = "class"
	MethodInstance = "instance"
)

Variables

This section is empty.

Functions

func ParseOperationType

func ParseOperationType(input, def string) string

Types

type Operation

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

func (*Operation) TrimSpace

func (op *Operation) TrimSpace(sortTags bool)

type Operations

type Operations []Operation

func (Operations) CountsByClass added in v0.37.7

func (ops Operations) CountsByClass() map[string]int

func (Operations) CountsByTag added in v0.34.3

func (ops Operations) CountsByTag(concatenate bool, sep string) map[string]int

func (Operations) CountsByTagCount added in v0.34.3

func (ops Operations) CountsByTagCount() map[int]int

func (Operations) CountsByType added in v0.34.3

func (ops Operations) CountsByType() (operationCounts map[string]int, methodCounts map[string]int)

func (Operations) DuplicatePaths added in v0.34.1

func (ops Operations) DuplicatePaths() map[string]int

func (Operations) PathsByClass added in v0.37.13

func (ops Operations) PathsByClass() maputil.MapStringSlice

func (Operations) RemovePaths added in v0.34.0

func (ops Operations) RemovePaths(paths []string) Operations

func (Operations) Table

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

func (Operations) TrimSpace added in v0.34.0

func (ops Operations) TrimSpace(sortTags bool)

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