data

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithContainer

func ContextWithContainer(ctx context.Context, c *types.DataContainer) context.Context

func FromApiRequest added in v1.7.0

func FromApiRequest(req *api.Request) *types.DataContainer

func FromCtx

func FromCtx(ctx context.Context) *types.DataContainer

Types

type Loader

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

Loader fetches data from the specified URL and stores it in the container.

func NewLoader

func NewLoader(cli *http.Client, cfg LoaderConfig, sp types.StateProvider, secrets types.Secrets, logger zerolog.Logger) *Loader

func (*Loader) Load

func (l *Loader) Load(ctx context.Context, c *types.DataContainer, upd *telegram.Update) error

type LoaderConfig

type LoaderConfig struct {
	Method  string
	URL     string
	Headers map[string]string
}

LoaderConfig specifies data loader configuration options.

Jump to

Keyboard shortcuts

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