sink

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 28 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	// ElName is the EventListener name.
	ElName string
	// ElNamespace is the EventListener namespace.
	ElNamespace string
	// Port is the port the Sink should listen on.
	Port string
}

Args define the arguments for Sink.

func GetArgs

func GetArgs() (Args, error)

GetArgs returns the flagged Args

type AuthOverride added in v0.4.0

type AuthOverride interface {
	OverrideAuthentication(token string,
		log *zap.SugaredLogger,
		defaultDiscoveryClient discoveryclient.ServerResourcesInterface,
		defaultDynamicClient dynamic.Interface) (discoveryClient discoveryclient.ServerResourcesInterface,
		dynamicClient dynamic.Interface,
		err error)
}

AuthOverride is an interface that constructs a discovery client for the ServerResourceInterface and a dynamic client for the Tekton Resources, using the token provide as the bearer token in the REST config used to build those client. The other non-credential related parameters for the REST client used are copied from the in cluster config of the event sink.

type Clients

type Clients struct {
	DiscoveryClient discoveryclient.DiscoveryInterface
	RESTClient      restclient.Interface
	TriggersClient  triggersclientset.Interface
}

Clients define the set of client dependencies Sink requires.

func ConfigureClients

func ConfigureClients() (Clients, error)

ConfigureClients returns the kubernetes and triggers clientsets

type DefaultAuthOverride added in v0.4.0

type DefaultAuthOverride struct {
}

func (DefaultAuthOverride) OverrideAuthentication added in v0.4.0

func (r DefaultAuthOverride) OverrideAuthentication(token string,
	log *zap.SugaredLogger,
	defaultDiscoverClient discoveryclient.ServerResourcesInterface,
	defaultDynamicClient dynamic.Interface) (discoveryClient discoveryclient.ServerResourcesInterface,
	dynamicClient dynamic.Interface,
	err error)

type Response added in v0.2.0

type Response struct {
	// EventListener is the name of the eventListener
	EventListener string `json:"eventListener"`
	// Namespace is the namespace that the eventListener is running in
	Namespace string `json:"namespace,omitempty"`
	// EventID is a uniqueID that gets assigned to each incoming request
	EventID string `json:"eventID,omitempty"`
}

Response defines the HTTP body that the Sink responds to events with.

type Sink added in v0.2.0

type Sink struct {
	KubeClientSet          kubernetes.Interface
	TriggersClient         triggersclientset.Interface
	DiscoveryClient        discoveryclient.ServerResourcesInterface
	DynamicClient          dynamic.Interface
	HTTPClient             *http.Client
	EventListenerName      string
	EventListenerNamespace string
	Logger                 *zap.SugaredLogger
	Auth                   AuthOverride
}

Sink defines the sink resource for processing incoming events for the EventListener.

func (Sink) HandleEvent added in v0.2.0

func (r Sink) HandleEvent(response http.ResponseWriter, request *http.Request)

HandleEvent processes an incoming HTTP event for the event listener.

Jump to

Keyboard shortcuts

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