context

package
v1.4.16 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package context implements Context's methods.

Index

Constants

This section is empty.

Variables

View Source
var ControllerCtxKey int

ControllerCtxKey the pointer is the key that a ControllerContext returns itself for.

Functions

This section is empty.

Types

type ControllerContext

type ControllerContext struct {
	context.Context

	ProxyServerPort  uint32
	ProxyServiceCert *certificate.Certificate
	FsmNamespace     string
	KubeConfig       *rest.Config
	Configurator     configurator.Configurator
	MeshCatalog      catalog.MeshCataloger
	CertManager      *certificate.Manager
	MsgBroker        *messaging.Broker
	DebugHandlers    map[string]http.Handler
	CancelFunc       func()
	Stop             chan struct{}

	// Merge with FSM ControllerContext to simplify the code
	client.Client
	Manager             manager.Manager
	Scheme              *runtime.Scheme
	KubeClient          kubernetes.Interface
	RepoClient          *repo.PipyRepoClient
	InformerCollection  *fsminformers.InformerCollection
	GatewayEventHandler gwtypes.Controller
	StatusUpdater       status.Updater
	MeshName            string
	TrustDomain         string
	FSMVersion          string
}

ControllerContext carries the arguments for invoking ControllerDriver.Start

func ToControllerContext added in v1.3.0

func ToControllerContext(ctx context.Context) (*ControllerContext, error)

func (*ControllerContext) Deadline added in v1.3.0

func (c *ControllerContext) Deadline() (deadline time.Time, ok bool)

Deadline returns the time when work done on behalf of this context should be canceled. Deadline returns ok==false when no deadline is set. Successive calls to Deadline return the same results.

func (*ControllerContext) Done added in v1.3.0

func (c *ControllerContext) Done() <-chan struct{}

Done returns a channel that's closed when work done on behalf of this context should be canceled. Done may return nil if this context can never be canceled. Successive calls to Done return the same value. The close of the Done channel may happen asynchronously, after the cancel function returns.

func (*ControllerContext) Err added in v1.3.0

func (c *ControllerContext) Err() error

Err returns nil, if Done is not yet closed, If Done is closed, Err returns a non-nil error explaining why: Canceled if the context was canceled or DeadlineExceeded if the context's deadline passed. After Err returns a non-nil error, successive calls to Err return the same error.

func (*ControllerContext) Value added in v1.3.0

func (c *ControllerContext) Value(key interface{}) interface{}

Value returns the value associated with this context for key, or nil if no value is associated with key. Successive calls to Value with the same key returns the same result.

Jump to

Keyboard shortcuts

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