gosock

package
v0.0.0-...-f884121 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: BSD-3-Clause Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSockInUse = errors.New("bind: address already in use")

Functions

This section is empty.

Types

type Command

type Command struct {
	Code   string                 `json:"code"`
	Params map[string]interface{} `json:"params"`
	// contains filtered or unexported fields
}

func (*Command) Reply

func (this *Command) Reply(reply *Command) error

func (*Command) ReplyOk

func (this *Command) ReplyOk() error

type Sock

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

func NewSock

func NewSock(path string) *Sock

func NewTmpSock

func NewTmpSock(name string) *Sock

func (*Sock) Close

func (this *Sock) Close() error

func (*Sock) Dial

func (this *Sock) Dial() (net.Conn, error)

func (*Sock) DialTimeout

func (this *Sock) DialTimeout(timeout time.Duration) (net.Conn, error)

func (*Sock) IsListening

func (this *Sock) IsListening() bool

func (*Sock) Listen

func (this *Sock) Listen() error

func (*Sock) On

func (this *Sock) On(cmd string, f func(params map[string]interface{}))

func (*Sock) OnCommand

func (this *Sock) OnCommand(f func(cmd *Command))

func (*Sock) OnError

func (this *Sock) OnError(f func(err error))

func (*Sock) Path

func (this *Sock) Path() string

func (*Sock) Send

func (this *Sock) Send(cmd *Command) (reply *Command, err error)

func (*Sock) SendTimeout

func (this *Sock) SendTimeout(cmd *Command, timeout time.Duration) (reply *Command, err error)

Jump to

Keyboard shortcuts

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