Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is an implementation of the Source interface that retrieves policies from a Nomad cluster.
func NewNomadSource ¶
NewNomadSource returns a new Nomad policy source.
func TestNomadSource ¶
TestNomadSource returns a default policy.Source that retrieves policies from Nomad.
The Nomad client and the agent can be configured by passing a cb function.
func (*Source) MonitorIDs ¶
func (s *Source) MonitorIDs(ctx context.Context, req policy.MonitorIDsReq)
MonitorIDs retrieves a list of policy IDs from a Nomad cluster and sends it in the resultCh channel when change is detected. Errors are sent through the errCh channel.
This function blocks until the context is closed.
func (*Source) MonitorPolicy ¶
func (s *Source) MonitorPolicy(ctx context.Context, req policy.MonitorPolicyReq)
MonitorPolicy monitors a policy and sends it through the resultCh channel when a change is detect. Errors are sent through the errCh channel.
This function blocks until the context is closed.
func (*Source) Name ¶ added in v0.1.0
func (s *Source) Name() policy.SourceName
Name satisfies the Name function of the policy.Source interface.
func (*Source) ReloadIDsMonitor ¶ added in v0.1.0
func (s *Source) ReloadIDsMonitor()
ReloadIDsMonitor satisfies the ReloadIDsMonitor function of the policy.Source interface.
This currently does nothing but in the future will be useful to allow reloading configuration options such as the Nomad client params or the log level.