Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildResourcePb ¶
func BuildResourcePb(o client.Object, nsnName, specBody, expiryTime string, gvk schema.GroupVersionKind) *resourcepb.ClaimRequest
Types ¶
type Cache ¶
type Cache interface { Get(ObjectKindKey) *resourcepb.ClaimResponse Add(ObjectKindKey, *resourcepb.ClaimResponse) Delete(ObjectKindKey) ValidateExpiryTime(context.Context) map[ObjectKindKey]*resourcepb.ClaimResponse }
type Config ¶
type Config struct { Name string Address string Group string // Group of GVK for event handling Normalizefn Normalizefn ValidateFn RefreshRespValidatorFn }
type Informer ¶
type Informer interface { Add(schema.GroupVersionKind, chan event.GenericEvent) Delete(schema.GroupVersionKind) NotifyClient(schema.GroupVersionKind, types.NamespacedName) GetGVK() []schema.GroupVersionKind }
informer works based on the owner GVK
func NewInformer ¶
func NewInformer(EventChannels map[schema.GroupVersionKind]chan event.GenericEvent) Informer
func NewNopInformer ¶
func NewNopInformer() Informer
type Normalizefn ¶
type Normalizefn func(o client.Object, d any) (*resourcepb.ClaimRequest, error)
type ObjectKindKey ¶
type ObjectKindKey struct {
// contains filtered or unexported fields
}
ObjectKindKey is the key of the Claim, not the ownerKey
type Proxy ¶
type Proxy[T1, T2 client.Object] interface { AddEventChs(map[schema.GroupVersionKind]chan event.GenericEvent) // Create creates the cache instance in the backend CreateIndex(ctx context.Context, cr T1) error // Delete deletes the cache instance in the backend DeleteIndex(ctx context.Context, cr T1) error // Get returns the claimed resource GetClaim(ctx context.Context, cr client.Object, d any) (T2, error) // Claim claims a resource Claim(ctx context.Context, cr client.Object, d any) (T2, error) // DeleteClaim deletes the claim DeleteClaim(ctx context.Context, cr client.Object, d any) error }
type RefreshRespValidatorFn ¶
type RefreshRespValidatorFn func(origResp *resourcepb.ClaimResponse, newResp *resourcepb.ClaimResponse) bool
type ResponseValidator ¶
type ResponseValidator interface { Add(string, RefreshRespValidatorFn) Get(string) RefreshRespValidatorFn }
validates the response from the grpc server with the specific validate fn
func NewResponseValidator ¶
func NewResponseValidator() ResponseValidator
Source Files ¶
Click to show internal directories.
Click to hide internal directories.