endpoints

package
v1.1.186 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointInfo

type EndpointInfo struct {
	TemplateURL string
	APIVersion  string
	URLSegments []EndpointSegment
}

EndpointInfo represents an ARM endpoint

func GetEndpointInfoFromURL

func GetEndpointInfoFromURL(templateURL string, apiVersion string) (EndpointInfo, error)

GetEndpointInfoFromURL builds an EndpointInfo instance

func (*EndpointInfo) BuildURL

func (ei *EndpointInfo) BuildURL(values map[string]string) (string, error)

BuildURL generates a URL based on the templateURL filling in placeholders with the values map

func (*EndpointInfo) Match

func (ei *EndpointInfo) Match(url string) MatchResult

Match tests whether a URL matches the EndpointInfo (ignoring query string values)

type EndpointSegment

type EndpointSegment struct {
	// holds a literal to match for fixed segments (e.g. /subscriptions/)
	Match string
	// holds the name of a templated segment (e.g. 'name' for /{name}/)
	Name string
}

EndpointSegment reprsesents a segment of a template URL

type MatchResult

type MatchResult struct {
	// indicates whether this was a match
	IsMatch bool
	// holds the values pulled from named segments of the URL
	Values map[string]string
}

MatchResult holds information about an EndPointInfo match

Jump to

Keyboard shortcuts

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