resourceids

package
v0.0.0-...-b9d5f24 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourceIdsMatch

func ResourceIdsMatch(first, second models.ResourceID) bool

func SegmentsAvailableForNaming

func SegmentsAvailableForNaming(pri models.ResourceID) []string

Types

type ParseResult

type ParseResult struct {
	// OperationIdsToParsedResourceIds is a map of the original Operation IDs to the ParsedOperation
	// object containing the parsed Resource ID.
	OperationIdsToParsedResourceIds map[string]ParsedOperation

	// NamesToResourceIDs is a mapping of the ResourceID Names to the parsed Resource ID objects
	NamesToResourceIDs map[string]models.ResourceID

	// Constants is a map of Name - ConstantDetails found within the Resource IDs
	Constants map[string]models.SDKConstant
}

func (*ParseResult) Append

func (r *ParseResult) Append(other ParseResult, logger hclog.Logger) error

type ParsedOperation

type ParsedOperation struct {
	// ResourceId is the ParsedResourceId object for this Resource Id
	ResourceId *models.ResourceID

	// ResourceIdName is the name of the ResourceID
	ResourceIdName *string

	// UriSuffix is any Suffix which should be appended to the URI, if present.
	// This can either be specified with a ResourceIdName, when it's suffixed,
	// or can be standalone (e.g. this Operation is a static URI with no Resource ID).
	UriSuffix *string
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(logger hclog.Logger, swaggerSpecExpanded *analysis.Spec) *Parser

NewParser returns a Parser instance which can be used to parse Resource IDs

func (*Parser) Parse

func (p *Parser) Parse() (*ParseResult, error)

Parse takes a list of Swagger Resources and returns a ParseResult, containing a list of ResourceIDs found within the Swagger Resources.

Source Files

Jump to

Keyboard shortcuts

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