Help us shape the future of Go! Take the 2026 Go Developer Survey

gosr

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 6 Imported by: 0

README

gosr

a simple frame of send and receive on conn for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Call(req interface{}) (resp interface{}, err error)
	AsyncCall(req interface{}) (resp <-chan interface{}, err error)
	io.Closer
	IsClosed() bool
	Err() error
	SetErr(err error)
	GetCodec() Codec
}

Client ...

func NewClient

func NewClient(codec Codec, timeout time.Duration) Client

NewClient ...

type Codec

type Codec interface {
	BuildMessage(data interface{}) (Message, error)
	SendMessage(Message) error
	RecvMessage() (Message, error)
	Close() error
}

Codec ...

type Error

type Error error

Error ...

var (
	// ErrorTimeOut ...
	ErrorTimeOut Error = fmt.Errorf("[gosr] timeout")
	// ErrorClosed ...
	ErrorClosed Error = fmt.Errorf("[gosr] closed")
)

func Errof

func Errof(format string, args ...interface{}) Error

Errof ...

type Message

type Message interface {
	Seq() interface{}
	Data() interface{}
}

Message ...

Jump to

Keyboard shortcuts

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