socket

package
v2.12.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConnectorName is the path used when communicating to the connector process.
	ConnectorName = "/tmp/telepresence-connector.socket"

	// DaemonName is the path used when communicating to the daemon process.
	DaemonName = "/var/run/telepresence-daemon.socket"
)

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, socketName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)

Dial dials the given socket and returns the resulting connection.

func Exists

func Exists(name string) (bool, error)

SocketExists returns true if a socket is found with the given name.

func IsRunning

func IsRunning(ctx context.Context, path string) (bool, error)

IsRunning makes an attempt to dial the given socket and returns true if that succeeds. If the attempt doesn't succeed the method returns false. No error is returned when the failed attempt is caused by a non-existing socket.

func Listen

func Listen(ctx context.Context, processName, socketName string) (net.Listener, error)

Listen returns a listener for the given socket and returns the resulting connection.

func Remove

func Remove(listener net.Listener) error

RemoveSocket removes any representation of the socket from the filesystem.

func WaitUntilAppears

func WaitUntilAppears(name, path string, ttw time.Duration) error

WaitUntilAppears waits until the socket at the given path comes into existence and returns when that happens. The wait will be max ttw (time to wait) long.

func WaitUntilRunning

func WaitUntilRunning(ctx context.Context, name, path string, ttw time.Duration) error

WaitUntilRunning waits until the socket at the given path comes into existence and a dial is successful and returns when that happens. The wait will be max ttw (time to wait) long.

func WaitUntilVanishes

func WaitUntilVanishes(name, path string, ttw time.Duration) error

WaitUntilVanishes waits until the socket at the given path is removed and returns when that happens. The wait will be max ttw (time to wait) long. An error is returned if that time is exceeded before the socket is removed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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