locations

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommandsTo

func AddCommandsTo(rootCmd *cobra.Command)

func GetLocation

func GetLocation(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

func ListCountries added in v0.5.2

func ListCountries(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

func ListLocations

func ListLocations(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

func ListMarketCodes added in v0.5.2

func ListMarketCodes(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

func SearchLocations added in v0.5.2

func SearchLocations(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

Types

type CountryOutput added in v0.5.2

type CountryOutput struct {
	output.Output `json:"-" header:"-"`
	Code          string `json:"code" header:"Code"`
	Name          string `json:"name" header:"Name"`
	Prefix        string `json:"prefix" header:"Prefix"`
	SiteCount     int    `json:"site_count" header:"Site Count"`
}

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 MarketCodeOutput struct {
	output.Output `json:"-" header:"-"`
	MarketCode    string `json:"market_code" header:"Market Code"`
}

type MockLocationsService added in v0.4.0

type MockLocationsService struct {
	mock.Mock
}

func (*MockLocationsService) FilterLocationsByMarketCode added in v0.4.0

func (m *MockLocationsService) FilterLocationsByMarketCode(ctx context.Context, marketCode string, locations []*megaport.Location) ([]*megaport.Location, error)

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 (m *MockLocationsService) FilterLocationsByMcrAvailability(ctx context.Context, mcrAvailable bool, locations []*megaport.Location) []*megaport.Location

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 (m *MockLocationsService) GetLocationByID(ctx context.Context, locationID int) (*megaport.Location, error)

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 (m *MockLocationsService) GetLocationByName(ctx context.Context, locationName string) (*megaport.Location, error)

func (*MockLocationsService) GetLocationByNameFuzzy added in v0.4.0

func (m *MockLocationsService) GetLocationByNameFuzzy(ctx context.Context, search string) ([]*megaport.Location, error)

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 (m *MockLocationsService) IsValidMarketCode(ctx context.Context, marketCode string) (bool, error)

func (*MockLocationsService) ListCountries added in v0.4.0

func (m *MockLocationsService) ListCountries(ctx context.Context) ([]*megaport.Country, error)

func (*MockLocationsService) ListLocations added in v0.4.0

func (m *MockLocationsService) ListLocations(ctx context.Context) ([]*megaport.Location, error)

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)

type Module added in v0.3.4

type Module struct{}

func NewModule added in v0.3.4

func NewModule() *Module

func (*Module) Name added in v0.3.4

func (m *Module) Name() string

func (*Module) RegisterCommands added in v0.3.4

func (m *Module) RegisterCommands(rootCmd *cobra.Command)

Jump to

Keyboard shortcuts

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