source

package
v0.0.0-...-6a882ce Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatusHashGetter

func StatusHashGetter(resource *api.Resource) (string, error)

Types

type APIServer

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

func NewAPIServer

func NewAPIServer(addr, sourceID string, store store.Store, eventController *EventController) *APIServer

func (*APIServer) Start

func (s *APIServer) Start(ctx context.Context) error

type Event

type Event struct {
	EventType EventType
	ID        string
}

type EventController

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

func NewEventController

func NewEventController() *EventController

func (*EventController) AddEventHandler

func (ec *EventController) AddEventHandler(eventType EventType, handler EventHandler)

func (*EventController) EnqueueEvent

func (ec *EventController) EnqueueEvent(event Event)

func (*EventController) Run

func (ec *EventController) Run(ctx context.Context)

type EventHandler

type EventHandler func(ctx context.Context, id string) error

type EventType

type EventType string
const (
	CreateEvent EventType = "create_event"
	UpdateEvent EventType = "update_event"
	DeleteEvent EventType = "delete_event"
)

type ResourceCodec

type ResourceCodec struct{}

func (*ResourceCodec) Decode

func (c *ResourceCodec) Decode(evt *cloudevents.Event) (*api.Resource, error)

func (*ResourceCodec) Encode

func (c *ResourceCodec) Encode(source string, eventType types.CloudEventsType, resource *api.Resource) (*cloudevents.Event, error)

func (*ResourceCodec) EventDataType

func (c *ResourceCodec) EventDataType() types.CloudEventsDataType

type ResourceLister

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

func (*ResourceLister) List

func (l *ResourceLister) List(listOpts types.ListOptions) ([]*api.Resource, error)

type ResourceSourceClient

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

func StartResourceSourceClient

func StartResourceSourceClient(
	ctx context.Context,
	options *options.CloudEventsSourceOptions,
	store store.Store,
) (*ResourceSourceClient, error)

func (*ResourceSourceClient) OnCreate

func (c *ResourceSourceClient) OnCreate(ctx context.Context, id string) error

func (*ResourceSourceClient) OnDelete

func (c *ResourceSourceClient) OnDelete(ctx context.Context, id string) error

func (*ResourceSourceClient) OnUpdate

func (c *ResourceSourceClient) OnUpdate(ctx context.Context, id string) error

Jump to

Keyboard shortcuts

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