client

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 18 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIClient added in v1.4.0

func APIClient[T any](ctx context.Context, base *BaseClient, builder Builder[T]) (*T, error)

APIClient returns a new OpenAPI client that can be used to access the API from another API.

func CertificateRequestMutator added in v1.4.0

func CertificateRequestMutator(ctx context.Context, req *http.Request) error

CertificateRequestMutator sets the client certifcate header when bound to an access token.

func ControllerClient added in v1.4.0

func ControllerClient[T any](ctx context.Context, base *BaseClient, builder Builder[T], resource metav1.Object) (*T, error)

ControllerClient returns a new OpenAPI client that can be used to access the API from another controller. It requires a resource that stores the identity principal information.

func DynamicClientFromContext

func DynamicClientFromContext(ctx context.Context) client.Client

func NewContextWithDynamicClient

func NewContextWithDynamicClient(ctx context.Context, client client.Client) context.Context

func NewContextWithStaticClient

func NewContextWithStaticClient(ctx context.Context, client client.Client) context.Context

func StaticClientFromContext

func StaticClientFromContext(ctx context.Context) client.Client

func TraceContextRequestMutator added in v1.4.0

func TraceContextRequestMutator(ctx context.Context, req *http.Request) error

TraceContextRequestMutator sets the w3c trace context header for distributed tracing.

Types

type AccessTokenGetter added in v0.2.44

type AccessTokenGetter interface {
	Get(ctx context.Context) (string, error)
}

AccessTokenGetter provides an interface to retrieve an access token.

type Allocations added in v1.10.0

type Allocations struct {
	// contains filtered or unexported fields
}

Allocations wraps up quota allocation management. This is specific to API handlers only.

func NewAllocations added in v1.10.0

func NewAllocations(client client.Client, api openapi.ClientWithResponsesInterface) *Allocations

func (*Allocations) Create added in v1.10.0

func (r *Allocations) Create(ctx context.Context, resource client.Object, allocations openapi.ResourceAllocationList) error

Create accepts a resource kind, creates an allocation for it with the requested set of resources, and patches the allocation ID into the resource for tracking. TODO: could we not just use the resource reference as eky, rather than messing with IDs?

func (*Allocations) Delete added in v1.10.0

func (r *Allocations) Delete(ctx context.Context, resource client.Object) error

Delete deletes the allocation.

func (*Allocations) Update added in v1.10.0

func (r *Allocations) Update(ctx context.Context, resource client.Object, allocations openapi.ResourceAllocationList) error

Update updates an existing allocation, typically for scaling operations.

type BaseClient added in v1.4.0

type BaseClient struct {
	// contains filtered or unexported fields
}

BaseClient wraps up the raw OpenAPI client with TLS and TLS client options, so that they can be used by any service provider's API or controllers.

func NewBaseClient added in v1.4.0

func NewBaseClient(client client.Client, options *Options, clientOptions *coreclient.HTTPClientOptions) *BaseClient

NewBaseClient creates a new client.

func (*BaseClient) HTTPClient added in v1.4.0

func (c *BaseClient) HTTPClient(ctx context.Context) (*http.Client, error)

HTTPClient returns a new http client that will handle TLS and mTLS only.

type Builder added in v1.4.0

type Builder[T any] interface {
	WithHTTPClient(client *http.Client)
	WithRequestEditorFn(fn func(context.Context, *http.Request) error)
	Client(hostname string) (*T, error)
}

type Client added in v0.2.7

type Client struct {
	// contains filtered or unexported fields
}

Client wraps up the raw OpenAPI client with things to make it useable e.g. authorization and TLS.

func New

func New(client client.Client, options *Options, clientOptions *coreclient.HTTPClientOptions) *Client

New creates a new client.

func (*Client) APIClient added in v1.4.0

func (c *Client) APIClient(ctx context.Context) (*openapi.ClientWithResponses, error)

APIClient returns a new OpenAPI client that can be used to access the Identity API from another service provider's API.

func (*Client) ControllerClient added in v1.9.0

func (c *Client) ControllerClient(ctx context.Context, resource metav1.Object) (*openapi.ClientWithResponses, error)

ControllerClient returns a new OpenAPI client that can be used to access the API from another controller. It requires a resource that stores the identity principal information.

func (*Client) HTTPClient added in v0.2.30

func (c *Client) HTTPClient(ctx context.Context) (*http.Client, error)

HTTPClient returns a new http client that will handle TLS and mTLS only.

type Options added in v0.2.8

type Options = coreclient.HTTPOptions

func NewOptions added in v0.2.30

func NewOptions() *Options

NewOptions must be used to create options for consistency.

type References added in v1.9.0

type References struct {
	// contains filtered or unexported fields
}

References allows references to be added and removed on identity resources from remote services.

func NewReferences added in v1.9.0

func NewReferences(serviceDescriptor util.ServiceDescriptor, serverOptions *coreclient.HTTPOptions, clientOptions *coreclient.HTTPClientOptions) *References

func (*References) AddReferenceToProject added in v1.9.0

func (r *References) AddReferenceToProject(ctx context.Context, resource client.Object) error

func (*References) RemoveReferenceFromProject added in v1.9.0

func (r *References) RemoveReferenceFromProject(ctx context.Context, resource client.Object) error

Jump to

Keyboard shortcuts

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