file

package
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileSource

func NewFileSource(log hclog.Logger, dir string, policyProcessor *policy.Processor) policy.Source

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source is the File implementation of the policy.Source interface.

func (*Source) MonitorIDs

func (s *Source) MonitorIDs(ctx context.Context, req policy.MonitorIDsReq)

MonitorIDs satisfies the MonitorIDs function of the policy.Source interface.

func (*Source) MonitorPolicy

func (s *Source) MonitorPolicy(ctx context.Context, req policy.MonitorPolicyReq)

MonitorPolicy reads policy from a file on disk and writes it to req.ResultCh. Any error doing so will be sent to req.ErrCh. If MonitorPolicy receives on s.ReloadCh, it will re-check the file on disk, and write again to req.ResultCh if the policy has changed. Note: MonitorPolicy should only return when ctx is done.

func (*Source) Name

func (s *Source) Name() policy.SourceName

Name satisfies the Name function of the policy.Source interface.

func (*Source) ReloadIDsMonitor

func (s *Source) ReloadIDsMonitor()

ReloadIDsMonitor satisfies the ReloadIDsMonitor function of the policy.Source interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL