Documentation ¶
Index ¶
- func ResourceStatusHashGetter(res *api.Resource) (string, error)
- type BundleCodec
- type Codec
- type SourceClient
- type SourceClientImpl
- func (s *SourceClientImpl) OnCreate(ctx context.Context, id string) error
- func (s *SourceClientImpl) OnDelete(ctx context.Context, id string) error
- func (s *SourceClientImpl) OnUpdate(ctx context.Context, id string) error
- func (s *SourceClientImpl) ReconnectedChan() <-chan struct{}
- func (s *SourceClientImpl) Resync(ctx context.Context, consumers []string) error
- func (s *SourceClientImpl) Subscribe(ctx context.Context, handlers ...cegeneric.ResourceHandler[*api.Resource])
- type SourceClientMock
- func (s *SourceClientMock) OnCreate(ctx context.Context, id string) error
- func (s *SourceClientMock) OnDelete(ctx context.Context, id string) error
- func (s *SourceClientMock) OnUpdate(ctx context.Context, id string) error
- func (s *SourceClientMock) ReconnectedChan() <-chan struct{}
- func (s *SourceClientMock) Resync(ctx context.Context, consumers []string) error
- func (s *SourceClientMock) Subscribe(ctx context.Context, handlers ...cegeneric.ResourceHandler[*api.Resource])
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BundleCodec ¶
type BundleCodec struct {
// contains filtered or unexported fields
}
func (*BundleCodec) Decode ¶
func (codec *BundleCodec) Decode(evt *cloudevents.Event) (*api.Resource, error)
func (*BundleCodec) Encode ¶
func (codec *BundleCodec) Encode(source string, eventType cetypes.CloudEventsType, res *api.Resource) (*cloudevents.Event, error)
func (*BundleCodec) EventDataType ¶
func (codec *BundleCodec) EventDataType() cetypes.CloudEventsDataType
type Codec ¶
type Codec struct {
// contains filtered or unexported fields
}
func (*Codec) Encode ¶
func (codec *Codec) Encode(source string, eventType cetypes.CloudEventsType, res *api.Resource) (*cloudevents.Event, error)
func (*Codec) EventDataType ¶
func (codec *Codec) EventDataType() cetypes.CloudEventsDataType
type SourceClient ¶
type SourceClient interface { OnCreate(ctx context.Context, id string) error OnUpdate(ctx context.Context, id string) error OnDelete(ctx context.Context, id string) error Subscribe(ctx context.Context, handlers ...cegeneric.ResourceHandler[*api.Resource]) Resync(ctx context.Context, consumers []string) error ReconnectedChan() <-chan struct{} }
SourceClient is an interface for publishing resource events to consumers subscribing to and resyncing resource status from consumers.
func NewSourceClient ¶
func NewSourceClient(sourceOptions *ceoptions.CloudEventsSourceOptions, resourceService services.ResourceService) (SourceClient, error)
func NewSourceClientMock ¶
func NewSourceClientMock(resourceService services.ResourceService) SourceClient
type SourceClientImpl ¶
type SourceClientImpl struct { Codec cegeneric.Codec[*api.Resource] BundleCodec cegeneric.Codec[*api.Resource] CloudEventSourceClient *cegeneric.CloudEventSourceClient[*api.Resource] ResourceService services.ResourceService }
func (*SourceClientImpl) OnCreate ¶
func (s *SourceClientImpl) OnCreate(ctx context.Context, id string) error
func (*SourceClientImpl) OnDelete ¶
func (s *SourceClientImpl) OnDelete(ctx context.Context, id string) error
func (*SourceClientImpl) OnUpdate ¶
func (s *SourceClientImpl) OnUpdate(ctx context.Context, id string) error
func (*SourceClientImpl) ReconnectedChan ¶
func (s *SourceClientImpl) ReconnectedChan() <-chan struct{}
func (*SourceClientImpl) Resync ¶
func (s *SourceClientImpl) Resync(ctx context.Context, consumers []string) error
func (*SourceClientImpl) Subscribe ¶
func (s *SourceClientImpl) Subscribe(ctx context.Context, handlers ...cegeneric.ResourceHandler[*api.Resource])
type SourceClientMock ¶
type SourceClientMock struct { ResourceService services.ResourceService // contains filtered or unexported fields }
SourceClientMock is a mock implementation of the SourceClient interface
func (*SourceClientMock) OnCreate ¶
func (s *SourceClientMock) OnCreate(ctx context.Context, id string) error
func (*SourceClientMock) OnDelete ¶
func (s *SourceClientMock) OnDelete(ctx context.Context, id string) error
func (*SourceClientMock) OnUpdate ¶
func (s *SourceClientMock) OnUpdate(ctx context.Context, id string) error
func (*SourceClientMock) ReconnectedChan ¶
func (s *SourceClientMock) ReconnectedChan() <-chan struct{}
func (*SourceClientMock) Resync ¶
func (s *SourceClientMock) Resync(ctx context.Context, consumers []string) error
func (*SourceClientMock) Subscribe ¶
func (s *SourceClientMock) Subscribe(ctx context.Context, handlers ...cegeneric.ResourceHandler[*api.Resource])
Source Files ¶
Click to show internal directories.
Click to hide internal directories.