Documentation ¶
Index ¶
- func ManifestWorkStatusHash(work *workv1.ManifestWork) (string, error)
- type ClientHolder
- type ClientHolderBuilder
- func (b *ClientHolderBuilder) NewAgentClientHolder(ctx context.Context) (*ClientHolder, error)
- func (b *ClientHolderBuilder) NewSourceClientHolder(ctx context.Context) (*ClientHolder, error)
- func (b *ClientHolderBuilder) WithClientID(clientID string) *ClientHolderBuilder
- func (b *ClientHolderBuilder) WithClusterName(clusterName string) *ClientHolderBuilder
- func (b *ClientHolderBuilder) WithCodecs(codecs ...generic.Codec[*workv1.ManifestWork]) *ClientHolderBuilder
- func (b *ClientHolderBuilder) WithResyncEnabled(resync bool) *ClientHolderBuilder
- func (b *ClientHolderBuilder) WithSourceID(sourceID string) *ClientHolderBuilder
- func (b *ClientHolderBuilder) WithWorkClientWatcherStore(store store.WorkClientWatcherStore) *ClientHolderBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ManifestWorkStatusHash ¶
func ManifestWorkStatusHash(work *workv1.ManifestWork) (string, error)
ManifestWorkStatusHash returns the SHA256 checksum of a ManifestWork status.
Types ¶
type ClientHolder ¶
type ClientHolder struct {
// contains filtered or unexported fields
}
ClientHolder holds a manifestwork client that implements the ManifestWorkInterface based on different configuration
ClientHolder also implements the ManifestWorksGetter interface.
func (*ClientHolder) ManifestWorks ¶
func (h *ClientHolder) ManifestWorks(namespace string) workv1client.ManifestWorkInterface
ManifestWorks returns a ManifestWorkInterface
func (*ClientHolder) WorkInterface ¶ added in v0.14.0
func (h *ClientHolder) WorkInterface() workclientset.Interface
WorkInterface returns a workclientset Interface
type ClientHolderBuilder ¶
type ClientHolderBuilder struct {
// contains filtered or unexported fields
}
ClientHolderBuilder builds the ClientHolder with different configuration.
func NewClientHolderBuilder ¶
func NewClientHolderBuilder(config any) *ClientHolderBuilder
NewClientHolderBuilder returns a ClientHolderBuilder with a given configuration.
Available configurations:
- MQTTOptions (*mqtt.MQTTOptions): builds a manifestwork client based on cloudevents with MQTT
- GRPCOptions (*grpc.GRPCOptions): builds a manifestwork client based on cloudevents with GRPC
- KafkaOptions (*kafka.KafkaOptions): builds a manifestwork client based on cloudevents with Kafka
TODO using a specified config instead of any
func (*ClientHolderBuilder) NewAgentClientHolder ¶ added in v0.14.0
func (b *ClientHolderBuilder) NewAgentClientHolder(ctx context.Context) (*ClientHolder, error)
NewAgentClientHolder returns a ClientHolder for an agent
func (*ClientHolderBuilder) NewSourceClientHolder ¶ added in v0.14.0
func (b *ClientHolderBuilder) NewSourceClientHolder(ctx context.Context) (*ClientHolder, error)
NewSourceClientHolder returns a ClientHolder for a source
func (*ClientHolderBuilder) WithClientID ¶ added in v0.14.0
func (b *ClientHolderBuilder) WithClientID(clientID string) *ClientHolderBuilder
WithClientID set the client ID for source/agent cloudevents client.
func (*ClientHolderBuilder) WithClusterName ¶
func (b *ClientHolderBuilder) WithClusterName(clusterName string) *ClientHolderBuilder
WithClusterName set the managed cluster name when building a manifestwork client for an agent.
func (*ClientHolderBuilder) WithCodecs ¶
func (b *ClientHolderBuilder) WithCodecs(codecs ...generic.Codec[*workv1.ManifestWork]) *ClientHolderBuilder
WithCodecs add codecs when building a manifestwork client based on cloudevents.
func (*ClientHolderBuilder) WithResyncEnabled ¶ added in v0.14.0
func (b *ClientHolderBuilder) WithResyncEnabled(resync bool) *ClientHolderBuilder
WithResyncEnabled control the client resync (Default is true), if it's true, the resync happens when
- after the client's store is initiated
- the client reconnected
func (*ClientHolderBuilder) WithSourceID ¶ added in v0.14.0
func (b *ClientHolderBuilder) WithSourceID(sourceID string) *ClientHolderBuilder
WithSourceID set the source ID when building a manifestwork client for a source.
func (*ClientHolderBuilder) WithWorkClientWatcherStore ¶ added in v0.14.0
func (b *ClientHolderBuilder) WithWorkClientWatcherStore(store store.WorkClientWatcherStore) *ClientHolderBuilder
WithWorkClientWatcherStore set the WorkClientWatcherStore. The client will use this store to caches the works and watch the work events.