Versions in this module Expand all Collapse all v0 v0.0.2 Nov 24, 2021 v0.0.1 Nov 24, 2021 Changes in this version + func Header(ctx context.Context) (map[string]string, bool) + func NewContext(ctx context.Context, header map[string]string) context.Context + func RegisterEncoder(enc Encoder) + func SetDefaultEncoder(enc uint8) + type CircuitBreaker interface + Available func() bool + NewCircuitBreaker func(name string) CircuitBreaker + Run func(fun func() error) error + type CliOption interface + func WithCliEncoder(enc Encoder) CliOption + func WithCliEndPoint(ep *EndPoint) CliOption + func WithTimeout(timeout time.Duration) CliOption + type CliOptionFunc func(cli *Client) + type Client struct + func NewClient(name string, opts ...CliOption) *Client + func (cli *Client) GetEncoder() Encoder + func (cli *Client) Invoke(ctx context.Context, data []byte, funcName string, addr string) ([]byte, error) + type ClientConn struct + type Conn struct + func NewConn(srv *Service, conn net.Conn) *Conn + type Encoder interface + Decode func(data []byte, v interface{}) error + Encode func(v interface{}) ([]byte, error) + String func() string + Value func() uint8 + func GetEncoder(ty ...uint8) Encoder + type EndPoint struct + Host string + IsAlive bool + Port string + Proto string + ServiceName string + Weight int32 + func (ep *EndPoint) Network() string + func (ep *EndPoint) String() string + type Handler interface + Handler func(ctx context.Context, _impl interface{}, enc Encoder, msg *Message, ...) + type Message struct + Code int32 + Desc string + Func string + Obj string + ReqData []byte + ReqHeader map[string]string + ReqId uint32 + RespData []byte + RespHeader map[string]string + func NewMessage(enc Encoder, pkg []byte) (*Message, error) + func (m *Message) RequestHeaderGet(k string) string + func (m *Message) RespMessage() *pb.RespMessage + func (m *Message) RespTimeout() *pb.RespMessage + func (m *Message) ResponseHeaderSet(k, v string) + type Register interface + Deregister func() error + Register func() error + type Service struct + func NewServe(name string, impl interface{}, options ...SrvOption) *Service + func (srv *Service) Name() string + func (srv *Service) Serve() error + func (srv *Service) ServeHTTP(rw http.ResponseWriter, r *http.Request) + func (srv *Service) SetWaitGroup(wg *sync.WaitGroup) + type SrvOption interface + func WithHandler(handler Handler) SrvOption + func WithInvokeTimeout(timeout time.Duration) SrvOption + func WithServiceEndpoint(ep *EndPoint) SrvOption + type SrvOptionFun func(srv *Service) + type WKHeader struct + type WkError struct + Code int32 + Desc string + Service string + func NewError(name string, code int32, desc string) *WkError + func ParserError(msg string) *WkError + func (err *WkError) Error() string