unix

package
v0.0.0-...-ac3141b Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

A unix socket client

func NewClient

func NewClient() *Client

Constructs a new Client

func NewServerClient

func NewServerClient(server *Server, conn net.Conn) *Client

Constructs a new server client

func (*Client) Close

func (c *Client) Close() error

Close the Client, closing the connection

func (*Client) Connect

func (c *Client) Connect(address string) error

Connect to a Unix socket

func (*Client) ID

func (c *Client) ID() string

Returns the clients ID

func (*Client) Read

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

Read data from the socket

func (*Client) Write

func (c *Client) Write(b []byte) (int, error)

Writes data to the client unix socket connection

type Clients

type Clients map[string]*Client

Map for storing client connections

func (Clients) Add

func (c Clients) Add(client *Client)

Convenience add client connection to map

func (Clients) Del

func (c Clients) Del(id string)

Convenience delete client connection from map

type Config

type Config struct{}

func NewConfig

func NewConfig() Config

func (Config) Address

func (c Config) Address() string

type Configurer

type Configurer interface {
	Address() string
}

type Server

type Server struct {
	// Exported Fields
	Config Configurer
	// contains filtered or unexported fields
}

Socket server type

func NewServer

func NewServer(c Configurer) *Server

Constructs a new Socket Server

func (*Server) Close

func (s *Server) Close() error

Gracefully closes the socket connection, waits for the all connected client connections to close and listener loops

func (*Server) Listen

func (s *Server) Listen() error

Listens for new Unix socket client connections Saves accepted connections

func (*Server) Name

func (s *Server) Name() string

Name of the event producer

Jump to

Keyboard shortcuts

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