Documentation
¶
Overview ¶
Package events provides interfaces and types for working with events
Index ¶
- Constants
- func NewEvent(evType eventv1.Event, obj Object, eventLabels ...map[string]string) *eventv1.Envelope
- func NewHandler[T any, PT interface{ ... }](h func(context.Context, PT) error) func(context.Context, proto.Message) error
- func NewRequest(evType eventv1.Event, obj Object, labels ...map[string]string) *eventv1.PublishRequest
- type BackendHandlerFunc
- type CertificateAuthorityHandlerFunc
- type CertificateHandlerFunc
- type CredentialHandlerFunc
- type Exchange
- func (e *Exchange) AddForwarder(forwarder Forwarder)
- func (e *Exchange) Forward(ctx context.Context, ev *eventv1.Envelope) error
- func (e *Exchange) On(ev eventv1.Event, f HandlerFunc)
- func (e *Exchange) Once(ev eventv1.Event, f HandlerFunc)
- func (e *Exchange) Publish(ctx context.Context, ev *eventv1.Envelope) error
- func (e *Exchange) Subscribe(ctx context.Context, t ...eventv1.Event) chan *eventv1.Envelope
- func (e *Exchange) Unsubscribe(context.Context, eventv1.Event) error
- type Forwarder
- type Handler
- type HandlerFunc
- func Handle(h HandlerFunc) HandlerFunc
- func HandleBackends(h ...BackendHandlerFunc) HandlerFunc
- func HandleCertificateAuthorities(h ...CertificateAuthorityHandlerFunc) HandlerFunc
- func HandleCertificates(h ...CertificateHandlerFunc) HandlerFunc
- func HandleCredentials(h ...CredentialHandlerFunc) HandlerFunc
- func HandleErrors(log logger.Logger, h HandlerFunc) HandlerFunc
- func HandleNew[T any, PT interface{ ... }](h func(context.Context, PT) error) HandlerFunc
- func HandlePolicies(h ...PolicyHandlerFunc) HandlerFunc
- func HandleRoutes(h ...RouteHandlerFunc) HandlerFunc
- type NewExchangeOption
- type Object
- type PolicyHandlerFunc
- type Publisher
- type RouteHandlerFunc
- type Subscriber
Constants ¶
View Source
const ( CientConnect = eventv1.Event_EVENT_CLIENT_CONNECT BackendCreate = eventv1.Event_EVENT_BACKEND_CREATE BackendDelete = eventv1.Event_EVENT_BACKEND_DELETE BackendUpdate = eventv1.Event_EVENT_BACKEND_UPDATE BackendPatch = eventv1.Event_EVENT_BACKEND_PATCH CertificateAuthorityCreate = eventv1.Event_EVENT_CERTIFICATEAUTHORITY_CREATE CertificateAuthorityDelete = eventv1.Event_EVENT_CERTIFICATEAUTHORITY_DELETE CertificateAuthorityUpdate = eventv1.Event_EVENT_CERTIFICATEAUTHORITY_UPDATE CertificateAuthorityPatch = eventv1.Event_EVENT_CERTIFICATEAUTHORITY_PATCH CertificateCreate = eventv1.Event_EVENT_CERTIFICATE_CREATE CertificateDelete = eventv1.Event_EVENT_CERTIFICATE_DELETE CertificateUpdate = eventv1.Event_EVENT_CERTIFICATE_UPDATE CertificatePatch = eventv1.Event_EVENT_CERTIFICATE_PATCH RouteCreate = eventv1.Event_EVENT_ROUTE_CREATE RouteDelete = eventv1.Event_EVENT_ROUTE_DELETE RouteUpdate = eventv1.Event_EVENT_ROUTE_UPDATE RoutePatch = eventv1.Event_EVENT_ROUTE_PATCH PolicyCreate = eventv1.Event_EVENT_POLICY_CREATE PolicyDelete = eventv1.Event_EVENT_POLICY_DELETE PolicyUpdate = eventv1.Event_EVENT_POLICY_UPDATE PolicyPatch = eventv1.Event_EVENT_POLICY_PATCH CredentialCreate = eventv1.Event_EVENT_CREDENTIAL_CREATE CredentialDelete = eventv1.Event_EVENT_CREDENTIAL_DELETE CredentialUpdate = eventv1.Event_EVENT_CREDENTIAL_UPDATE CredentialPatch = eventv1.Event_EVENT_CREDENTIAL_PATCH TokenIssue = eventv1.Event_EVENT_TOKEN_ISSUE TokenRevoke = eventv1.Event_EVENT_TOKEN_REVOKE )
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewRequest ¶
Types ¶
type CertificateAuthorityHandlerFunc ¶
type CertificateAuthorityHandlerFunc func(context.Context, *cav1.CertificateAuthority) error
type CertificateHandlerFunc ¶
type CertificateHandlerFunc func(context.Context, *certificatev1.Certificate) error
type CredentialHandlerFunc ¶
type CredentialHandlerFunc func(context.Context, *credentialv1.Credential) error
type Exchange ¶
type Exchange struct {
// contains filtered or unexported fields
}
func NewExchange ¶
func NewExchange(opts ...NewExchangeOption) *Exchange
func (*Exchange) AddForwarder ¶
AddForwarder adds a forwarder to this Exchange, forwarding any message on Publish()
func (*Exchange) Forward ¶
Forward publishes the event using the publishers added to this exchange. Implements Forwarder.
func (*Exchange) On ¶
func (e *Exchange) On(ev eventv1.Event, f HandlerFunc)
On registers a handler func for a certain event type
func (*Exchange) Once ¶
func (e *Exchange) Once(ev eventv1.Event, f HandlerFunc)
Once attaches a handler to the specified event type. The handler func is only executed once
type HandlerFunc ¶
func Handle ¶
func Handle(h HandlerFunc) HandlerFunc
func HandleBackends ¶
func HandleBackends(h ...BackendHandlerFunc) HandlerFunc
func HandleCertificateAuthorities ¶
func HandleCertificateAuthorities(h ...CertificateAuthorityHandlerFunc) HandlerFunc
func HandleCertificates ¶
func HandleCertificates(h ...CertificateHandlerFunc) HandlerFunc
func HandleCredentials ¶
func HandleCredentials(h ...CredentialHandlerFunc) HandlerFunc
func HandleErrors ¶
func HandleErrors(log logger.Logger, h HandlerFunc) HandlerFunc
func HandlePolicies ¶
func HandlePolicies(h ...PolicyHandlerFunc) HandlerFunc
func HandleRoutes ¶
func HandleRoutes(h ...RouteHandlerFunc) HandlerFunc
type NewExchangeOption ¶
type NewExchangeOption func(*Exchange)
func WithExchangeLogger ¶
func WithExchangeLogger(l logger.Logger) NewExchangeOption
type Object ¶
type Object protoreflect.ProtoMessage
Click to show internal directories.
Click to hide internal directories.