Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DomainResolver ¶
type DomainResolver struct { Addresses []string // contains filtered or unexported fields }
DomainResolver is a custom resolver library that helps to resolve a domain returning a list of IPs associated with it, also with posibilty to watch for DNS changes, the library can be used either by the resolver builder for gRPC or as a independent library also implement resolver.Resolver
func NewResolver ¶
func NewResolver(address, port string, needWatcher bool, refreshRate *time.Duration, listener chan bool) *DomainResolver
NewResolver creates a new resolver instance, if needWatcher is true a time in seconds is expected in the refreshRate parameter the ticker field is exported in case want to be updated or stoped
func (*DomainResolver) Close ¶
func (r *DomainResolver) Close()
Close stops watching for changes in the domain
func (*DomainResolver) ResolveNow ¶
func (r *DomainResolver) ResolveNow(o resolver.ResolveNowOptions)
ResolveNow is empty since we are going to rely on our own ticker to standardise the refresh rate
func (*DomainResolver) StartResolver ¶
func (r *DomainResolver) StartResolver()
StartResolver resolves by first time the given domain
type DomainResolverBuilder ¶
type DomainResolverBuilder struct {
// contains filtered or unexported fields
}
DomainResolverBuilder implements the Resolver.Builder interface the target field in the Dial gRPC function is in the way fmt.Sprintf("%s:///%s", scheme, address+":"+port) where the scheme is the name set in this constructor
func NewDomainResolverBuilder ¶
func NewDomainResolverBuilder(scheme, address, port string, needWatcher bool, refreshRate *time.Duration) *DomainResolverBuilder
NewDomainResolverBuilder creates a new instance for the DomainResolverBuilder
func (*DomainResolverBuilder) Build ¶
func (b *DomainResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
Build ...