userd

package
v2.21.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 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 ConnectRequest added in v2.19.1

type ConnectRequest interface {
	Request() *rpc.ConnectRequest
}

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
}

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)

	LogCall(context.Context, string, func(context.Context))

	// 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

	PostConnectRequest(context.Context, ConnectRequest) error
	ReadConnectResponse(context.Context) (*rpc.ConnectInfo, error)
	InitFTPServer(context.Context) error
	ManageSessions(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(context.Context, string, *rpc.Interceptor) error
	RemoveInterceptor(string) error
	ClearIngestsAndIntercepts(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, 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)

	WithJoinedClientSetInterface(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)

	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{}
	Ingest(context.Context, *rpc.IngestRequest) (*rpc.IngestInfo, error)
	GetIngest(*rpc.IngestIdentifier) (*rpc.IngestInfo, error)
	LeaveIngest(context.Context, *rpc.IngestIdentifier) (*rpc.IngestInfo, error)
}

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