multiplexer

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PoolScopeMetadataKey = "pool-scoped-metadata"
	LeaderEndpointsKey   = "leaders"
	EnableLeaderElection = "enable-leader-election"

	PoolSourceForPoolScopeMetadata      = "pool"
	APIServerSourceForPoolScopeMetadata = "api"
)

Variables

View Source
var AttrsFuncMap = map[string]kstorage.AttrFunc{
	schema.GroupVersionResource{Group: "", Version: "v1", Resource: "services"}.String(): ServiceGetAttrs,
}
View Source
var (
	DefaultAttrsFunc = func(obj runtime.Object) (labels.Set, fields.Set, error) {
		metadata, err := meta.Accessor(obj)
		if err != nil {
			return nil, nil, err
		}

		var fieldSet fields.Set
		if len(metadata.GetNamespace()) > 0 {
			fieldSet = fields.Set{
				"metadata.name":      metadata.GetName(),
				"metadata.namespace": metadata.GetNamespace(),
			}
		} else {
			fieldSet = fields.Set{
				"metadata.name": metadata.GetName(),
			}
		}

		return labels.Set(metadata.GetLabels()), fieldSet, nil
	}
)

Functions

func ServiceGetAttrs

func ServiceGetAttrs(obj runtime.Object) (labels.Set, fields.Set, error)

func ServiceSelectableFields

func ServiceSelectableFields(service *v1.Service) fields.Set

Types

type Interface

type Interface interface {
	Watch(ctx context.Context, key string, opts kstorage.ListOptions) (watch.Interface, error)
	GetList(ctx context.Context, key string, opts kstorage.ListOptions, listObj runtime.Object) error
	ReadinessCheck() error
}

type MultiplexerManager

type MultiplexerManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRequestMultiplexerManager

func NewRequestMultiplexerManager(
	cfg *config.YurtHubConfiguration,
	storageProvider ystorage.StorageProvider,
	healthCheckerForLeaders healthchecker.Interface) *MultiplexerManager

func (*MultiplexerManager) HasSynced

func (m *MultiplexerManager) HasSynced() bool

func (*MultiplexerManager) Ready

func (*MultiplexerManager) ResolveRequestForPoolScopeMetadata

func (m *MultiplexerManager) ResolveRequestForPoolScopeMetadata(req *http.Request) (isRequestForPoolScopeMetadata bool, forwardRequestForPoolScopeMetadata bool)

ResolveRequestForPoolScopeMetadata is used for resolving requests for list/watching pool scope metadata. there are two return values: isRequestForPoolScopeMetadata: specify whether the request list/watch pool scope metadata or not. if true, it is a request for pool scope metadata, otherwise, it's not. forwardRequestForPoolScopeMetadata: specify whether the request for pool scope metadata should be forwarded or can be served by multiplexer. if true, it means request should be forwarded, otherwise, request should be served by multiplexer. by the way, return value: forwardRequestForPoolScopeMetadata can be used when return value: isRequestForPoolScopeMetadata is true.

func (*MultiplexerManager) ResourceStore

func (m *MultiplexerManager) ResourceStore(gvr *schema.GroupVersionResource) (rest.Storage, error)

func (*MultiplexerManager) SourceForPoolScopeMetadata

func (m *MultiplexerManager) SourceForPoolScopeMetadata() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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