2024-02-13 11:11:10 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"net/netip"
|
|
|
|
|
|
|
|
|
|
"github.com/qdm12/gluetun/internal/models"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Fetcher interface {
|
2024-10-19 15:21:14 +02:00
|
|
|
String() string
|
|
|
|
|
CanFetchAnyIP() bool
|
|
|
|
|
Token() (token string)
|
|
|
|
|
InfoFetcher
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type InfoFetcher interface {
|
2024-02-13 11:11:10 +00:00
|
|
|
FetchInfo(ctx context.Context, ip netip.Addr) (
|
|
|
|
|
result models.PublicIP, err error)
|
|
|
|
|
}
|
2024-10-19 15:21:14 +02:00
|
|
|
|
|
|
|
|
type Warner interface {
|
|
|
|
|
Warn(message string)
|
|
|
|
|
}
|