http

package
v1.4.0-rc.3 Latest Latest
Warning

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

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

Documentation

Overview

Package http implements the remote.http component.

Index

Constants

This section is empty.

Variables

View Source
var DefaultArguments = Arguments{
	PollFrequency: 1 * time.Minute,
	PollTimeout:   10 * time.Second,
	Client:        common_config.DefaultHTTPClientConfig,
	Method:        http.MethodGet,
}

DefaultArguments holds default settings for Arguments.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	URL           string        `alloy:"url,attr"`
	PollFrequency time.Duration `alloy:"poll_frequency,attr,optional"`
	PollTimeout   time.Duration `alloy:"poll_timeout,attr,optional"`
	IsSecret      bool          `alloy:"is_secret,attr,optional"`

	Method  string            `alloy:"method,attr,optional"`
	Headers map[string]string `alloy:"headers,attr,optional"`
	Body    string            `alloy:"body,attr,optional"`

	Client common_config.HTTPClientConfig `alloy:"client,block,optional"`
}

Arguments control the remote.http component.

func (*Arguments) SetToDefault

func (args *Arguments) SetToDefault()

SetToDefault implements syntax.Defaulter.

func (*Arguments) Validate

func (args *Arguments) Validate() error

Validate implements syntax.Validator.

type Component

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

Component implements the remote.http component.

func New

func New(opts component.Options, args Arguments) (*Component, error)

New returns a new, unstarted, remote.http component.

func (*Component) CurrentHealth

func (c *Component) CurrentHealth() component.Health

CurrentHealth returns the current health of the component.

func (*Component) Run

func (c *Component) Run(ctx context.Context) error

Run starts the remote.http component.

func (*Component) Update

func (c *Component) Update(args component.Arguments) (err error)

Update updates the remote.http component. After the update completes, a poll is forced.

type Exports

type Exports struct {
	Content alloytypes.OptionalSecret `alloy:"content,attr"`
}

Exports holds settings exported by remote.http.

Jump to

Keyboard shortcuts

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