userd

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ProcessName = "connector"

Variables

This section is empty.

Functions

func WithNewServiceFunc added in v2.9.0

func WithNewServiceFunc(ctx context.Context, f NewServiceFunc) context.Context

func WithNewSessionFunc added in v2.9.0

func WithNewSessionFunc(ctx context.Context, f NewSessionFunc) context.Context

func WithService added in v2.9.4

func WithService(ctx context.Context, s Service) context.Context

func WithSession

func WithSession(ctx context.Context, session Session) context.Context

Types

type InterceptInfo added in v2.9.0

type InterceptInfo interface {
	InterceptResult() *rpc.InterceptResult
	PreparedIntercept() *manager.PreparedIntercept
	PortIdentifier() (agentconfig.PortIdentifier, error)
}

type KubeConfig added in v2.9.0

type KubeConfig interface {
	GetContext() string
	GetRestConfig() *rest.Config
	GetManagerNamespace() string
}

type NamespaceListener added in v2.9.0

type NamespaceListener func(context.Context)

type NewServiceFunc added in v2.9.0

type NewServiceFunc func(context.Context, *dgroup.Group, client.Config, *grpc.Server) (Service, error)

func GetNewServiceFunc added in v2.9.0

func GetNewServiceFunc(ctx context.Context) NewServiceFunc

type NewSessionFunc added in v2.9.0

func GetNewSessionFunc added in v2.9.0

func GetNewSessionFunc(ctx context.Context) NewSessionFunc

type Service added in v2.7.0

type Service interface {
	// As will cast this instance to what the given ptr points to, and assign
	// that to the pointer. It will panic if type is not implemented.
	As(ptr any)

	// ListenerAddress returns the address that this service is listening to.
	ListenerAddress(ctx context.Context) string

	Server() *grpc.Server

	// SetManagerClient will assign the manager client that this Service will use when acting as
	// a ManagerServer proxy
	SetManagerClient(manager.ManagerClient, ...grpc.CallOption)

	// FuseFTPMgr returns the manager responsible for creating a client that can connect to the FuseFTP service.
	FuseFTPMgr() remotefs.FuseFTPManager

	RootSessionInProcess() bool
	WithSession(context.Context, string, func(context.Context, Session) error) error

	ManageSessions(c context.Context) error
}

A Service is one that runs during the entire lifecycle of the daemon. This should be used to augment the daemon with GRPC services.

func GetService added in v2.9.4

func GetService(ctx context.Context) Service

type Session added in v2.9.0

type Session interface {
	restapi.AgentState
	KubeConfig

	AddIntercept(context.Context, *rpc.CreateInterceptRequest) *rpc.InterceptResult
	CanIntercept(context.Context, *rpc.CreateInterceptRequest) (InterceptInfo, *rpc.InterceptResult)
	InterceptProlog(context.Context, *manager.CreateInterceptRequest) *rpc.InterceptResult
	InterceptEpilog(context.Context, *rpc.CreateInterceptRequest, *rpc.InterceptResult) *rpc.InterceptResult
	RemoveIntercept(context.Context, string) error
	NewCreateInterceptRequest(*manager.InterceptSpec) *manager.CreateInterceptRequest

	AddInterceptor(string, *rpc.Interceptor) error
	RemoveInterceptor(string) error
	ClearIntercepts(context.Context) error

	GetInterceptInfo(string) *manager.InterceptInfo
	GetInterceptSpec(string) *manager.InterceptSpec
	InterceptsForWorkload(string, string) []*manager.InterceptSpec

	ManagerClient() manager.ManagerClient
	ManagerConn() *grpc.ClientConn
	ManagerName() string
	ManagerVersion() semver.Version
	NewRemainRequest() *manager.RemainRequest

	Status(context.Context) *rpc.ConnectInfo
	UpdateStatus(context.Context, *rpc.ConnectRequest) *rpc.ConnectInfo

	Uninstall(context.Context, *rpc.UninstallRequest) (*common.Result, error)

	WatchWorkloads(context.Context, *rpc.WatchWorkloadsRequest, WatchWorkloadsStream) error
	WorkloadInfoSnapshot(context.Context, []string, rpc.ListRequest_Filter) (*rpc.WorkloadInfoSnapshot, error)

	GetCurrentNamespaces(forClientAccess bool) []string
	ActualNamespace(string) string
	AddNamespaceListener(context.Context, NamespaceListener)

	WithK8sInterface(context.Context) context.Context
	ForeachAgentPod(ctx context.Context, fn func(context.Context, typed.PodInterface, *core.Pod), filter func(*core.Pod) bool) error

	GatherLogs(context.Context, *connector.LogsRequest) (*connector.LogsResponse, error)
	GatherTraces(ctx context.Context, tr *connector.TracesRequest) *common.Result

	SessionInfo() *manager.SessionInfo
	RootDaemon() rootdRpc.DaemonClient

	ApplyConfig(context.Context) error
	GetConfig(context.Context) (*client.SessionConfig, error)
	RunSession(c context.Context) error
	StartServices(g *dgroup.Group)
	Remain(ctx context.Context) error
	Epilog(ctx context.Context)
	Done() <-chan struct{}
}

func GetSession added in v2.11.0

func GetSession(ctx context.Context) Session

type WatchWorkloadsStream added in v2.9.0

type WatchWorkloadsStream interface {
	Send(*rpc.WorkloadInfoSnapshot) error
	Context() context.Context
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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