filesystem

package
v1.53.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalDataSource

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

LocalDataSource is an implementation of DataSource It sources additional data for the policy engine from the local filesystem

func DataSourceFromPath

func DataSourceFromPath(path string) *LocalDataSource

DataSourceFromPath builds an instance of *LocalDataSource which reads the provided path and parses it as JSON on calls to Get

func (*LocalDataSource) Get

func (d *LocalDataSource) Get(_ context.Context, seen source.Hash) (map[string]any, source.Hash, error)

Get fetches and parses the *LocalDataSource path as JSON and returns it modelled as a go map of string to any type If the mod time of the filepath has not changed based on the provided previously seen mod time then it returns authz.ErrNotModified

type LocalPolicySource

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

LocalPolicySource is an implementation of PolicySource It sources policy definitions from the location filesystem

func PolicySourceFromPath

func PolicySourceFromPath(path string) *LocalPolicySource

LocalPolicySourceFromPath builds an instance of *PolicySourceFromPath which reads the provided path and returns the located policy

func (*LocalPolicySource) Get

Get reads the *LocalPolicySource path as and returns it as a byte slice If the mod time of the filepath has not changed based on the provided previously seen mod time then it returns authz.ErrNotModified

Jump to

Keyboard shortcuts

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