Documentation ¶
Index ¶
- func DetectPublicNetworkParams(publicIPs *[]net.IP, internalIPs []net.IP, netDev *string) error
- func IPFlag(name, help string) *net.IP
- func IPListFlag(name, help string) *[]net.IP
- func RunCron(ctx context.Context, d time.Duration, fn func(context.Context))
- func WriteFileIfChanged(path string, data []byte) (bool, error)
- type ConnCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectPublicNetworkParams ¶
DetectPublicNetworkParams tries to be smart and find a public IP address and network interface for the local host.
If *publicIPs is nil, attempts to resolve the local hostname and look for non-local addresses. If none are found, figures out the IP from the network interface, if given, or finds the first non-loopback interface.
If *netDev is an empty string, tries to figure out the network device to use from either internalIPs or *publicIPs, whichever is not nil. The netDev pointer itself can be nil, in which case no network device detection is attempted.
func IPListFlag ¶
Types ¶
type ConnCache ¶
type ConnCache struct {
// contains filtered or unexported fields
}
ConnCache caches GRPC connections for a set of (identical) backends, all sharing a common set of options.
func NewConnCache ¶
func NewConnCache(opts ...grpc.DialOption) *ConnCache
NewConnCache returns a new GRPC connection cache with the specified options.