github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/net/rpc/jsonrpc/client.go (about)

     1  // Copyright 2010 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Package jsonrpc はRPCパッケージのためのJSON-RPC 1.0のClientCodecとServerCodecを実装します。
     6  // JSON-RPC 2.0のサポートについては、 https://godoc.org/?q=json-rpc+2.0 を参照してください。
     7  package jsonrpc
     8  
     9  import (
    10  	"github.com/shogo82148/std/io"
    11  	"github.com/shogo82148/std/net/rpc"
    12  )
    13  
    14  // NewClientCodecは、conn上でJSON-RPCを使用して新しい [rpc.ClientCodec] を返します。
    15  func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec
    16  
    17  // NewClientは、接続先の一連のサービスへのリクエストを処理する新しい [rpc.Client] を返します。
    18  func NewClient(conn io.ReadWriteCloser) *rpc.Client
    19  
    20  // Dialは指定されたネットワークアドレスのJSON-RPCサーバに接続します。
    21  func Dial(network, address string) (*rpc.Client, error)