Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callbacks ¶
type Callbacks struct { // Raw is called with the raw body from the discovery service response and the parsed topology. Raw func(context.Context, common.RawBytes, *topology.Topo) // Update is called with the parsed topology from the discovery service response. Update func(context.Context, *topology.Topo) // Error is called with any error that occurs. Error func(context.Context, error) }
Callbacks are used to inform the client. The functions are called when an associated event occurs. If the function is nil, it is ignored.
type Fetcher ¶
type Fetcher struct { // Pool is a Pool of discovery services Pool discovery.InstancePool // Params contains the parameters for fetching the topology. Params discovery.FetchParams // Callbacks contains the callbacks. Callbacks Callbacks // Client is the http Client. If nil, the default Client is used. Client *http.Client // contains filtered or unexported fields }
Fetcher is used to fetch a new topology file from the discovery service.
func New ¶
func New(svcInfo topology.IDAddrMap, params discovery.FetchParams, clbks Callbacks, client *http.Client, component string) (*Fetcher, error)
New initializes a fetcher with the given values. Topo is provided to initialize the pool with discovery services.
Click to show internal directories.
Click to hide internal directories.