uds

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: MIT Imports: 4 Imported by: 4

README

go-ipc-uds

Go Reference Go Report Card Actions Status codecov

IPC using UDS (unix domain socket) in go

Install

go get -u github.com/asabya/go-ipc-uds

Examples

Check out the example

Project52

It is one of my project 52.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dialer

func Dialer(opts Options) (Read func() (string, error), Write func(st string) error, Close func() error, err error)

Dialer creates a uds dialer

func IsIPCListening

func IsIPCListening(socketPath string) bool

func Listener

func Listener(ctx context.Context, opts Options) (chan *Client, error)

Listener creates a uds listener

Types

type Client

type Client struct {
	Conn net.Conn
	Size uint64
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close() error

func (*Client) Read

func (c *Client) Read() ([]byte, error)

func (*Client) Write

func (c *Client) Write(d []byte) error

type Logger added in v0.1.2

type Logger interface {
	Error(args ...interface{})
	Debug(args ...interface{})
}

type Options

type Options struct {
	Size       uint64
	SocketPath string
	Logger     Logger
}

Options is used to create Listener/Dialer. SocketPath is the location of the `sock` file. Size is the size for byte array

Directories

Path Synopsis
example
dialer command
listener command

Jump to

Keyboard shortcuts

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