package operations

import "github.com/go-openapi/analysis/internal/flatten/operations"

Index

Functions

func AllOpRefsByRef

func AllOpRefsByRef(specDoc Provider, operationIDs []string) map[string]OpRef

AllOpRefsByRef returns an index of sortable operations

func GatherOperations

func GatherOperations(specDoc Provider, operationIDs []string) map[string]OpRef

GatherOperations builds a map of sorted operations from a spec

func OpRefsByRef

func OpRefsByRef(oprefs map[string]OpRef) map[string]OpRef

OpRefsByRef indexes a map of sortable operations

Types

type OpRef

type OpRef struct {
	Method string
	Path   string
	Key    string
	ID     string
	Op     *spec.Operation
	Ref    spec.Ref
}

OpRef is an indexable, sortable operation

type OpRefs

type OpRefs []OpRef

OpRefs is a sortable collection of operations

func (OpRefs) Len

func (o OpRefs) Len() int

func (OpRefs) Less

func (o OpRefs) Less(i, j int) bool

func (OpRefs) Swap

func (o OpRefs) Swap(i, j int)

type Provider

type Provider interface {
	Operations() map[string]map[string]*spec.Operation
}

Provider knows how to collect operations from a spec

Source Files

operations.go

Version
v0.23.0 (latest)
Published
Mar 9, 2024
Platform
linux/amd64
Imports
6 packages
Last checked
5 days ago

Tools for package owners.