data

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

README

Data Plugins

The Data plugin API provides a service mechanism for reading and writing JSON data. This data can be imported and used to make policy decisions.

Running a data plugin

eopa --config-file http.yaml run -s -l debug
# http.yaml: http plugin configuration file
plugins:
  data:
    foo.bar: # this is the path to the data once loaded
      type: http # required

      polling_interval: 10s

      url: http://example.com/data.json
      method: GET
      body: "" # invalid for GET requests
      headers:
        Authorization: Bearer <token>
      timeout: 1s

      tls_skip_verification: true
      tls_client_cert: "cert.pem"
      tls_ca_cert: "ca.pem"
      tls_client_private_key: "key.pem"

      follow_redirects: false

Documentation

Index

Constants

View Source
const Name = "data"

Variables

This section is empty.

Functions

func Factory

func Factory() plugins.Factory

Types

type Config

type Config struct {
	DataPlugins map[string]DataPlugin
}

Config represents the configuration for the data feature.

type Data

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

Data plugin

func Lookup

func Lookup(manager *plugins.Manager) *Data

Lookup returns the data plugin registered with the manager.

func (*Data) Error

func (c *Data) Error(fmt string, fs ...any)

func (*Data) Reconfigure

func (c *Data) Reconfigure(ctx context.Context, cfg interface{})

Reconfigure sets up the c.plugins field according to c.config

func (*Data) Start

func (c *Data) Start(ctx context.Context) error

Start starts the data plugins that have been configured.

func (*Data) Stop

func (c *Data) Stop(ctx context.Context)

Stop stops the dynamic discovery process if configured.

type DataPlugin

type DataPlugin struct {
	Factory plugins.Factory
	Config  any
}

type PathOverlapError

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

func NewPathOverlapError

func NewPathOverlapError(a, b ast.Ref) *PathOverlapError

func (*PathOverlapError) Error

func (p *PathOverlapError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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