interceptor

package
v1.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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
	SetToken    func(token string)
	Start       func(ctx context.Context)
	Stop        func()
}

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