Documentation
¶
Index ¶
- func AddCommandsTo(rootCmd *cobra.Command)
- func GetLocation(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error
- func ListCountries(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error
- func ListLocations(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error
- func ListMarketCodes(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error
- func SearchLocations(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error
- type CountryOutput
- type LocationOutput
- type LocationTableOutput
- type MarketCodeOutput
- type MockLocationsService
- func (m *MockLocationsService) FilterLocationsByMarketCode(ctx context.Context, marketCode string, locations []*megaport.Location) ([]*megaport.Location, error)
- func (m *MockLocationsService) FilterLocationsByMarketCodeV3(ctx context.Context, marketCode string, locations []*megaport.LocationV3) ([]*megaport.LocationV3, error)
- func (m *MockLocationsService) FilterLocationsByMcrAvailability(ctx context.Context, mcrAvailable bool, locations []*megaport.Location) []*megaport.Location
- func (m *MockLocationsService) FilterLocationsByMcrAvailabilityV3(ctx context.Context, mcrAvailable bool, locations []*megaport.LocationV3) []*megaport.LocationV3
- func (m *MockLocationsService) FilterLocationsByMetroV3(ctx context.Context, metro string, locations []*megaport.LocationV3) []*megaport.LocationV3
- func (m *MockLocationsService) GetLocationByID(ctx context.Context, locationID int) (*megaport.Location, error)
- func (m *MockLocationsService) GetLocationByIDV3(ctx context.Context, locationID int) (*megaport.LocationV3, error)
- func (m *MockLocationsService) GetLocationByName(ctx context.Context, locationName string) (*megaport.Location, error)
- func (m *MockLocationsService) GetLocationByNameFuzzy(ctx context.Context, search string) ([]*megaport.Location, error)
- func (m *MockLocationsService) GetLocationByNameFuzzyV3(ctx context.Context, search string) ([]*megaport.LocationV3, error)
- func (m *MockLocationsService) GetLocationByNameV3(ctx context.Context, locationName string) (*megaport.LocationV3, error)
- func (m *MockLocationsService) IsValidMarketCode(ctx context.Context, marketCode string) (bool, error)
- func (m *MockLocationsService) ListCountries(ctx context.Context) ([]*megaport.Country, error)
- func (m *MockLocationsService) ListLocations(ctx context.Context) ([]*megaport.Location, error)
- func (m *MockLocationsService) ListLocationsV3(ctx context.Context) ([]*megaport.LocationV3, error)
- func (m *MockLocationsService) ListMarketCodes(ctx context.Context) ([]string, error)
- type Module
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommandsTo ¶
func GetLocation ¶
func ListCountries ¶ added in v0.5.2
func ListLocations ¶
func ListMarketCodes ¶ added in v0.5.2
Types ¶
type CountryOutput ¶ added in v0.5.2
type LocationOutput ¶
type LocationOutput struct {
output.Output `json:"-" header:"-"`
ID int `json:"id" header:"ID"`
Name string `json:"name" header:"Name"`
Country string `json:"country" header:"Country"`
Metro string `json:"metro" header:"Metro"`
SiteCode string `json:"site_code" header:"Site Code"` // Note: Site code deprecated in v3 API
Market string `json:"market" header:"Market"`
Latitude float64 `json:"latitude" header:"-"`
Longitude float64 `json:"longitude" header:"-"`
Status string `json:"status" header:"Status"`
}
func ToLocationOutput ¶
func ToLocationOutput(l *megaport.Location) LocationOutput
type LocationTableOutput ¶
type LocationTableOutput struct {
ID int `header:"ID"`
Name string `header:"Name"`
Country string `header:"Country"`
Metro string `header:"Metro"`
SiteCode string `header:"Site Code"` // Note: Site code deprecated in v3 API
Status string `header:"Status"`
}
func ToLocationTableOutput ¶
func ToLocationTableOutput(l *megaport.Location) LocationTableOutput
type MarketCodeOutput ¶ added in v0.5.2
type MockLocationsService ¶ added in v0.4.0
func (*MockLocationsService) FilterLocationsByMarketCode ¶ added in v0.4.0
func (*MockLocationsService) FilterLocationsByMarketCodeV3 ¶ added in v0.4.8
func (m *MockLocationsService) FilterLocationsByMarketCodeV3(ctx context.Context, marketCode string, locations []*megaport.LocationV3) ([]*megaport.LocationV3, error)
func (*MockLocationsService) FilterLocationsByMcrAvailability ¶ added in v0.4.0
func (*MockLocationsService) FilterLocationsByMcrAvailabilityV3 ¶ added in v0.4.8
func (m *MockLocationsService) FilterLocationsByMcrAvailabilityV3(ctx context.Context, mcrAvailable bool, locations []*megaport.LocationV3) []*megaport.LocationV3
func (*MockLocationsService) FilterLocationsByMetroV3 ¶ added in v0.4.9
func (m *MockLocationsService) FilterLocationsByMetroV3(ctx context.Context, metro string, locations []*megaport.LocationV3) []*megaport.LocationV3
func (*MockLocationsService) GetLocationByID ¶ added in v0.4.0
func (*MockLocationsService) GetLocationByIDV3 ¶ added in v0.4.8
func (m *MockLocationsService) GetLocationByIDV3(ctx context.Context, locationID int) (*megaport.LocationV3, error)
func (*MockLocationsService) GetLocationByName ¶ added in v0.4.0
func (*MockLocationsService) GetLocationByNameFuzzy ¶ added in v0.4.0
func (*MockLocationsService) GetLocationByNameFuzzyV3 ¶ added in v0.4.8
func (m *MockLocationsService) GetLocationByNameFuzzyV3(ctx context.Context, search string) ([]*megaport.LocationV3, error)
func (*MockLocationsService) GetLocationByNameV3 ¶ added in v0.4.8
func (m *MockLocationsService) GetLocationByNameV3(ctx context.Context, locationName string) (*megaport.LocationV3, error)
func (*MockLocationsService) IsValidMarketCode ¶ added in v0.4.0
func (*MockLocationsService) ListCountries ¶ added in v0.4.0
func (*MockLocationsService) ListLocations ¶ added in v0.4.0
func (*MockLocationsService) ListLocationsV3 ¶ added in v0.4.8
func (m *MockLocationsService) ListLocationsV3(ctx context.Context) ([]*megaport.LocationV3, error)
V3 API methods
func (*MockLocationsService) ListMarketCodes ¶ added in v0.4.0
func (m *MockLocationsService) ListMarketCodes(ctx context.Context) ([]string, error)
Click to show internal directories.
Click to hide internal directories.