client

package module
v0.0.0-...-edb81cd Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 18 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayBackend

func ArrayBackend(handlers ...HandleFunc) fullstate.Callback

ArrayBackend creates a Callback from the given array handlers

func Run

func Run(handler HandleFunc, extraBindFlags ...func(*pflag.FlagSet))

func RunCh

func RunCh(backend fullstate.Callback, extraBindFlags ...func(*pflag.FlagSet))

Types

type FlagSet

type FlagSet = tlsflags.FlagSet

type HandleChFunc

type HandleChFunc = fullstate.Callback

type HandleFunc

type HandleFunc func(items []*ServiceEndpoints)

type LocalClient

type LocalClient struct {
	// Target is the gRPC dial target
	Target string

	TLS *tlsflags.Flags

	// ErrorDelay is the delay before retrying after an error.
	ErrorDelay time.Duration

	// GRPCBuffer is the max size of a gRPC message
	MaxMsgSize int

	Sink localsink.Sink
	// contains filtered or unexported fields
}

LocalClient is a simple client to kube-proxy's Endpoints API.

func New

func New(flags FlagSet) (lc *LocalClient)

New returns a new LocalClient with values bound to the given flag-set for command-line tools. Other needs can use `&LocalClient{...}` directly.

func (*LocalClient) Cancel

func (lc *LocalClient) Cancel()

Cancel will cancel this client, quickly closing any call to Next.

func (*LocalClient) CancelOn

func (lc *LocalClient) CancelOn(signals ...os.Signal)

CancelOn make the given signals to cancel this client.

func (*LocalClient) CancelOnSignals

func (lc *LocalClient) CancelOnSignals()

CancelOnSignals make the default termination signals to cancel this client.

func (*LocalClient) Context

func (lc *LocalClient) Context() context.Context

func (*LocalClient) DefaultFlags

func (lc *LocalClient) DefaultFlags(flags FlagSet)

DefaultFlags registers this client's values to the standard flags.

func (*LocalClient) Dial

func (lc *LocalClient) Dial() (conn *grpc.ClientConn, err error)

func (*LocalClient) DialContext

func (lc *LocalClient) DialContext(ctx context.Context) (conn *grpc.ClientConn, err error)

func (*LocalClient) Next

func (lc *LocalClient) Next() (canceled bool)

Next sends the next diff to the sink, waiting for a new revision as needed. It's designed to never fail, unless canceled.

type Runner

type Runner struct {
	NodeName string
	// contains filtered or unexported fields
}

func (*Runner) BindFlags

func (r *Runner) BindFlags(flags FlagSet)

func (*Runner) RunBackend

func (r *Runner) RunBackend(handler fullstate.Callback)

RunBackend runs the client with the standard options, using the channeled backend. It should consume less memory as the dataset is processed as it's read instead of buffered.

func (*Runner) RunSink

func (r *Runner) RunSink(sink localsink.Sink)

type ServiceEndpoints

type ServiceEndpoints = fullstate.ServiceEndpoints

Jump to

Keyboard shortcuts

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