http

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_TIMEOUT = 10

Variables

View Source
var (
	Name     = "http"
	Version  = "v0.0.0"
	CommitID = ""
)

Functions

func NewPlugin

func NewPlugin() (*pkgplugin.Plugin, error)

func NewPluginVersion

func NewPluginVersion(name string, version string, commitID string) (*pkgplugin.Plugin, error)

func NewReceiver

func NewReceiver(tid tenant.Id, plugin string, name string, config interface{}) (receiver.Receiver, error)

func NewSender

func NewSender(tid tenant.Id, plugin string, name string, config interface{}) (sender.Sender, error)

Types

type BadHttpStatusError

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

func (*BadHttpStatusError) Error

func (e *BadHttpStatusError) Error() string

type Receiver

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

func (*Receiver) Config

func (r *Receiver) Config() interface{}

func (*Receiver) GetTraceId

func (h *Receiver) GetTraceId(r *http.Request) string

func (*Receiver) Name

func (r *Receiver) Name() string

func (*Receiver) Plugin

func (r *Receiver) Plugin() string

func (*Receiver) Receive

func (h *Receiver) Receive(next receiver.NextFn) error

func (*Receiver) StopReceiving

func (h *Receiver) StopReceiving(ctx context.Context) error

func (*Receiver) Tenant

func (r *Receiver) Tenant() tenant.Id

type ReceiverConfig

type ReceiverConfig struct {
	Path   string `json:"path"`
	Method string `json:"method"`
	Port   *int   `json:"port"`
	Trace  *bool  `json:"trace,omitempty"`
}

func (*ReceiverConfig) Validate

func (rc *ReceiverConfig) Validate() error

Validate returns an error upon validation failure

type Sender

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

func (*Sender) Config

func (r *Sender) Config() interface{}

func (*Sender) Name

func (s *Sender) Name() string

func (*Sender) Plugin

func (s *Sender) Plugin() string

func (*Sender) Send

func (s *Sender) Send(event event.Event)

func (*Sender) SetTraceId

func (s *Sender) SetTraceId(r *http.Request, traceId string)

func (*Sender) StopSending

func (s *Sender) StopSending(ctx context.Context)

func (*Sender) Tenant

func (s *Sender) Tenant() tenant.Id

func (*Sender) Unwrap

func (s *Sender) Unwrap() sender.Sender

type SenderConfig

type SenderConfig struct {
	Url    string `json:"url"`
	Method string `json:"method"`
}

func (*SenderConfig) Validate

func (sc *SenderConfig) Validate() error

Validate

Jump to

Keyboard shortcuts

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