interceptor

package
v1.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(interceptedClient client.Client, funcs Funcs) client.Client

NewClient returns a new interceptor client that calls the functions in funcs instead of the underlying client's methods, if they are not nil.

Types

type Funcs

type Funcs struct {
	Get              func(ctx context.Context, key object.ObjectKey, obj object.Object, opts ...client.GetOption) error
	List             func(ctx context.Context, list object.ObjectList, opts ...client.ListOption) error
	Create           func(ctx context.Context, obj object.Object, req any, opts ...client.CreateOption) error
	Delete           func(ctx context.Context, obj object.Object, opts ...client.DeleteOption) error
	Update           func(ctx context.Context, obj object.Object, req any, opts ...client.UpdateOption) error
	GetInformer      func(obj object.ObjectType) client.InformerCache
	GetServer        func() string
	SetServer        func(server string)
	GetToken         func() string
	SetTokenProvider func(tokenProvider token.Provider)
	Start            func(ctx context.Context)
	Stop             func()
	Versioned        func() client.VersionedClients
}

Funcs contains functions that are called instead of the underlying client's methods.

Jump to

Keyboard shortcuts

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