http

package
v0.36.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 14 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        `river:"url,attr"`
	PollFrequency time.Duration `river:"poll_frequency,attr,optional"`
	PollTimeout   time.Duration `river:"poll_timeout,attr,optional"`
	IsSecret      bool          `river:"is_secret,attr,optional"`

	Method  string            `river:"method,attr,optional"`
	Headers map[string]string `river:"headers,attr,optional"`

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

Arguments control the remote.http component.

func (*Arguments) SetToDefault added in v0.35.0

func (args *Arguments) SetToDefault()

SetToDefault implements river.Defaulter.

func (*Arguments) Validate added in v0.35.0

func (args *Arguments) Validate() error

Validate implements river.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 rivertypes.OptionalSecret `river:"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