Documentation ¶
Index ¶
Constants ¶
View Source
const (
DatasourceTypeEC2 = "ec2"
)
View Source
const (
ErrDatasourceRetrievalTimeout = errors.Error("datasource: timeout during data-source retrieval")
)
Variables ¶
This section is empty.
Functions ¶
func GetProviders ¶
func GetProviders() map[DatasourceType]Provider
func RegisterProvider ¶
func RegisterProvider(p Provider)
Types ¶
type DatasourceType ¶
type DatasourceType string
type Provider ¶
type Provider interface { GetType() DatasourceType FetchHostname(ctx context.Context) (string, error) FetchLocalIPv4(ctx context.Context) (net.IP, error) FetchPublicIPv4(ctx context.Context) (net.IP, error) FetchMetadata(ctx context.Context) (*metadata.Digest, error) }
func FindProvider ¶
FindProvider checks the given datasource providers, if it finds an available data source before the specified duration, it returns the provider, else it returns an ErrDatasourceRetrievalTimeout error
Click to show internal directories.
Click to hide internal directories.