Help us shape the future of Go! Take the 2026 Go Developer Survey

rest

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package rest provides the REST rule data ingest engine

Index

Constants

View Source
const (
	// RestRuleDataIngestType is the type of the REST rule data ingest engine
	RestRuleDataIngestType = "rest"

	// MaxBytesLimit is the maximum number of bytes to read from the response body
	// We limit to 1MB to prevent abuse
	MaxBytesLimit int64 = 1 << 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointTemplateParams

type EndpointTemplateParams struct {
	// Entity is the entity to be evaluated
	Entity any
	// Params are the parameters to be used in the template
	Params map[string]any
}

EndpointTemplateParams is the parameters for the REST endpoint template

type Ingestor

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

Ingestor is the engine for a rule type that uses REST data ingest

func NewRestRuleDataIngest

func NewRestRuleDataIngest(
	restCfg *pb.RestType,
	cli interfaces.RESTProvider,
) (*Ingestor, error)

NewRestRuleDataIngest creates a new REST rule data ingest engine

func (*Ingestor) GetConfig

func (rdi *Ingestor) GetConfig() protoreflect.ProtoMessage

GetConfig returns the config for the REST rule data ingest engine

func (*Ingestor) GetType

func (*Ingestor) GetType() string

GetType returns the type of the REST rule data ingest engine

func (*Ingestor) Ingest

func (rdi *Ingestor) Ingest(
	ctx context.Context, ent protoreflect.ProtoMessage, params map[string]any,
) (*interfaces.Ingested, error)

Ingest calls the REST endpoint and returns the data

Jump to

Keyboard shortcuts

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