From add6c0329f97d02cc58f401276315d7b99c773c9 Mon Sep 17 00:00:00 2001 From: a <a@tuxpa.in> Date: Mon, 14 Nov 2022 17:42:14 -0600 Subject: [PATCH] rename chi related routing sfiles --- endpoints.go | 1 - chain.go => router_chain.go | 0 context.go => router_context.go | 0 stdio.go | 12 ++++++------ 4 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 endpoints.go rename chain.go => router_chain.go (100%) rename context.go => router_context.go (100%) diff --git a/endpoints.go b/endpoints.go deleted file mode 100644 index b743884..0000000 --- a/endpoints.go +++ /dev/null @@ -1 +0,0 @@ -package jrpc diff --git a/chain.go b/router_chain.go similarity index 100% rename from chain.go rename to router_chain.go diff --git a/context.go b/router_context.go similarity index 100% rename from context.go rename to router_context.go diff --git a/stdio.go b/stdio.go index 60193c3..3adae82 100644 --- a/stdio.go +++ b/stdio.go @@ -33,7 +33,7 @@ func DialStdIO(ctx context.Context) (*Client, error) { // DialIO creates a client which uses the given IO channels func DialIO(ctx context.Context, in io.Reader, out io.Writer) (*Client, error) { return newClient(ctx, func(_ context.Context) (ServerCodec, error) { - return NewCodec(stdioConn{ + return NewCodec(&stdioConn{ in: in, out: out, }), nil @@ -45,22 +45,22 @@ type stdioConn struct { out io.Writer } -func (io stdioConn) Read(b []byte) (n int, err error) { +func (io *stdioConn) Read(b []byte) (n int, err error) { return io.in.Read(b) } -func (io stdioConn) Write(b []byte) (n int, err error) { +func (io *stdioConn) Write(b []byte) (n int, err error) { return io.out.Write(b) } -func (io stdioConn) Close() error { +func (io *stdioConn) Close() error { return nil } -func (io stdioConn) RemoteAddr() string { +func (io *stdioConn) RemoteAddr() string { return "/dev/stdin" } -func (io stdioConn) SetWriteDeadline(t time.Time) error { +func (io *stdioConn) SetWriteDeadline(t time.Time) error { return &net.OpError{Op: "set", Net: "stdio", Source: nil, Addr: nil, Err: errors.New("deadline not supported")} } -- GitLab