May 2019
Intermediate to advanced
442 pages
11h 36m
English
Now that we have an idea of how the adapter works, let's take a look at what we need to implement to have our custom service discovery working. As we saw previously, the adapter uses a discovery.Manager, so we need to provide it with an implementation of the Discoverer interface so that it can run our discovery. The interface looks like this:
type Discoverer interface { Run(ctx context.Context, up chan<- []*targetgroup.Group)}
This means that we only need to implement the Run function, where we will run the logic of our discovery on a loop, generating the appropriate target groups ...
Read now
Unlock full access