httpeventsrc

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventTypes = []string{"get", "put", "post", "delete", "patch", "head"}

Functions

This section is empty.

Types

type Config

type Config struct {
	EventSourceID apieventsrc.EventSourceID `envconfig:"EVENT_SOURCE_ID" default:"internal.http" json:"event_source_id"`
}

type HTTPError

type HTTPError struct {
	Code    int
	Message string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

func (*HTTPError) Write

func (e *HTTPError) Write(w http.ResponseWriter)

type HTTPEventSource

type HTTPEventSource struct {
	Config       Config
	Events       *events.Events
	EventSources eventsrcsstore.Store
	Prefix       string
	L            L.Nullable
}

func (*HTTPEventSource) Add

func (s *HTTPEventSource) Add(
	ctx context.Context,
	pid apiproject.ProjectID,
	name string,
	routes []*pb.Route,
) error

func (*HTTPEventSource) Handle

func (s *HTTPEventSource) Handle(req *http.Request) (apievent.EventID, error)

returns "", nil for not found.

func (*HTTPEventSource) Remove

func (s *HTTPEventSource) Remove(
	ctx context.Context,
	pid apiproject.ProjectID,
	name string,
) error

type Route

type Route = pb.Route

Jump to

Keyboard shortcuts

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