locations

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: MPL-2.0 Imports: 9 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 ListLocations

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

Types

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"`
	Market        string  `json:"market" header:"Market"`
	Latitude      float64 `json:"latitude" header:"-"`  // Exclude from table output
	Longitude     float64 `json:"longitude" header:"-"` // Exclude from table output
	Status        string  `json:"status" header:"Status"`
}

LocationOutput represents the complete fields for JSON and CSV output.

func ToLocationOutput

func ToLocationOutput(l *megaport.Location) LocationOutput

ToLocationOutput converts a Location to a 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"`
	Status   string `header:"Status"`
}

LocationTableOutput is a compact version for table display

func ToLocationTableOutput

func ToLocationTableOutput(l *megaport.Location) LocationTableOutput

ToLocationTableOutput converts a Location to a LocationTableOutput.

Jump to

Keyboard shortcuts

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