context

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package context defines the context that are used in the mcs package

Index

Constants

This section is empty.

Variables

View Source
var ConnectorCtxKey int

ConnectorCtxKey the pointer is the key that a ConnectorContext returns itself for.

Functions

This section is empty.

Types

type ConnectorContext

type ConnectorContext struct {
	context.Context
	ClusterKey        string
	Hash              string
	KubeConfig        *rest.Config
	ConnectorConfig   *config.ConnectorConfig
	Cancel            func()
	StopCh            chan struct{}
	FsmMeshConfigName string
	FsmNamespace      string
}

ConnectorContext is the context that is used in the mcs package

func (*ConnectorContext) Deadline

func (c *ConnectorContext) 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 (*ConnectorContext) Done

func (c *ConnectorContext) 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 (*ConnectorContext) Err

func (c *ConnectorContext) 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 (*ConnectorContext) Value

func (c *ConnectorContext) 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