socket

package
v2.19.3-pro.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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)

Exists 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

Remove removes any representation of the socket from the filesystem.

func RootDaemonPath added in v2.13.0

func RootDaemonPath(ctx context.Context) string

RootDaemonPath is the path used when communicating to the root daemon process.

func UserDaemonPath added in v2.13.0

func UserDaemonPath(ctx context.Context) string

UserDaemonPath is the path used when communicating to the user daemon process.

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