localclient

package
v1.92.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package localclient provides an interface for all the local.Client methods kube needs to use, so that we can easily mock it in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertIssuer

type CertIssuer interface {
	CertPair(context.Context, string) ([]byte, []byte, error)
}

type FakeIPNBusWatcher

type FakeIPNBusWatcher struct {
	NotifyChan chan ipn.Notify
}

func (*FakeIPNBusWatcher) Close

func (f *FakeIPNBusWatcher) Close() error

func (*FakeIPNBusWatcher) Next

func (f *FakeIPNBusWatcher) Next() (ipn.Notify, error)

type FakeLocalClient

type FakeLocalClient struct {
	FakeIPNBusWatcher
}

func (*FakeLocalClient) CertPair

func (f *FakeLocalClient) CertPair(ctx context.Context, domain string) ([]byte, []byte, error)

func (*FakeLocalClient) WatchIPNBus

func (f *FakeLocalClient) WatchIPNBus(ctx context.Context, mask ipn.NotifyWatchOpt) (IPNBusWatcher, error)

type IPNBusWatcher

type IPNBusWatcher interface {
	io.Closer
	Next() (ipn.Notify, error)
}

IPNBusWatcher is local.IPNBusWatcher's methods restated in an interface to allow for easier mocking in tests.

type LocalClient

type LocalClient interface {
	WatchIPNBus(ctx context.Context, mask ipn.NotifyWatchOpt) (IPNBusWatcher, error)
	CertIssuer
}

LocalClient is roughly a subset of the local.Client struct's methods, used for easier testing.

func New

func New(lc *local.Client) LocalClient

New returns a LocalClient that wraps the provided local.Client.

Jump to

Keyboard shortcuts

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