Documentation ¶
Overview ¶
Package flyutil provides utilities for Fly.io runtime environment.
Index ¶
- func AllocID() string
- func AppName() string
- func EnvironmentSlug() string
- func GetAppAddress(appName string) string
- func GetAppAddressInRegion(appName, region string) string
- func Region() string
- func ResolveAppAddressInRegion(appName, region string) (net.IP, error)
- func ResolveAppAddresses(appName string) ([]net.IP, error)
- func ResolveAppAddressesInRegion(appName, region string) ([]net.IP, error)
- func ResolveAppNames() ([]string, error)
- func ResolveAppNearestAddresses(appName string, n int) ([]net.IP, error)
- func ResolveAppRegions(appName string) ([]string, error)
- func ResolveAppVMs(appName string) ([]string, error)
- func ResolveInstanceAddress(appName, allocID string) (net.IP, error)
- func ResolveNearestAppAddress(appName string) (net.IP, error)
- func ResolveWireguardPeerAddress(peer string) (net.IP, error)
- func ResolveWireguardPeers() ([]string, error)
- func RunningInCloud() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocID ¶
func AllocID() string
AllocID returns Fly.io allocation ID or empty string if the app is not running in the cloud.
func AppName ¶
func AppName() string
AppName returns Fly.io app name or empty string if the app is not running in the cloud.
func EnvironmentSlug ¶ added in v1.1.8
func EnvironmentSlug() string
EnvironmentSlug returns a slug name of the environment ("${FLY_REGION}-${ENVIRONMENT}").
func GetAppAddress ¶ added in v1.1.6
GetAppAddress returns an address pointing to one of the app instances.
func GetAppAddressInRegion ¶ added in v1.1.6
GetAppAddressInRegion returns an address pointing to one of the app instances in given region.
func Region ¶
func Region() string
Region returns Fly.io region name or empty string if the app is not running in the cloud.
func ResolveAppAddressInRegion ¶
ResolveAppAddressInRegion resolves an address of the closest instance of the given app in given region.
func ResolveAppAddresses ¶
ResolveAppAddresses returns a list of IPv6 addresses belonging to the given app.
func ResolveAppAddressesInRegion ¶
ResolveAppAddressesInRegion returns a list of IPv6 addresses belonging to the given app in given region.
func ResolveAppNames ¶
ResolveAppNames returns a list of names of all apps running in the current organisation.
func ResolveAppNearestAddresses ¶
ResolveAppNearestAddresses returns a list of N nearest IPv6 addresses belonging to the given app.
func ResolveAppRegions ¶
ResolveAppRegions returns a list of regions where given app is deployed.
func ResolveAppVMs ¶
ResolveAppVMs returns a list of alloc IDs of all instances that belong to the given app.
func ResolveInstanceAddress ¶
ResolveInstanceAddress returns an IPv6 of given app instance.
func ResolveNearestAppAddress ¶
ResolveNearestAppAddress resolves an address of the closest instance of the given app.
func ResolveWireguardPeerAddress ¶
ResolveWireguardPeerAddress returns an IPv6 of the given Wireguard peer.
func ResolveWireguardPeers ¶
ResolveWireguardPeers returns a list of all Wireguard peers deployed in the private network.
func RunningInCloud ¶
func RunningInCloud() bool
RunningInCloud checks whether the process is currently running inside Fly.io run environment.
Types ¶
This section is empty.