Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultNewHttpCallerOptions() option.Option
- func NewHttpCaller(opts ...rpc_core.NewCallerOption) (rpc_core.Caller, error)
- func NewHttpServer(opts ...rpc_core.NewServerOption) (rpc_core.Server, error)
- type DoRequest
- type DoResponse
- type HttpCaller
- func (x *HttpCaller) Call(ctx context.Context, method string, req rpc_interface.CallRequest, ...) error
- func (x *HttpCaller) CallStream(ctx context.Context, method string, opts ...rpc_interface.CallStreamOption) (rpc_interface.Stream, error)
- func (c *HttpCaller) GetLogger() logging.Logger
- func (x *HttpCaller) JoinPath(p string) string
- func (s *HttpCaller) MarshalDoRequest(req *DoRequest) (*crypto_core.Packet, error)
- func (x *HttpCaller) UnmarshalDoResponse(out *crypto_interface.Packet) (*DoResponse, error)
- type HttpServer
- func (s *HttpServer) GetLogger() logging.Logger
- func (x *HttpServer) HttpDo(c *gin.Context)
- func (x *HttpServer) MarshalDoResponse(res *DoResponse, req *DoRequest) (*crypto_interface.Packet, error)
- func (s *HttpServer) Routers() http.Handler
- func (s *HttpServer) Serve(ctx context.Context) <-chan error
- func (s *HttpServer) Terminate(ctx context.Context) error
- func (s *HttpServer) UnmarshalDoRequest(in *crypto_core.Packet) (*DoRequest, error)
- func (s *HttpServer) Wait(context.Context) <-chan error
- func (x *HttpServer) WriteResponse(c *gin.Context, sc int, res *DoResponse, req *DoRequest)
- func (x *HttpServer) WriteResponseWithError(c *gin.Context, sc int, err error, req *DoRequest)
Constants ¶
View Source
const (
OPTION_BASE_URL = "baseURL"
)
Variables ¶
View Source
var (
WithBaseURL, GetBaseURL = option.New[string](OPTION_BASE_URL)
)
Functions ¶
func NewHttpCaller ¶
func NewHttpCaller(opts ...rpc_core.NewCallerOption) (rpc_core.Caller, error)
func NewHttpServer ¶
func NewHttpServer(opts ...rpc_core.NewServerOption) (rpc_core.Server, error)
Types ¶
type DoResponse ¶
type HttpCaller ¶
type HttpCaller struct {
// contains filtered or unexported fields
}
func (*HttpCaller) Call ¶
func (x *HttpCaller) Call(ctx context.Context, method string, req rpc_interface.CallRequest, res rpc_interface.CallResponse, opts ...rpc_interface.CallOption) error
func (*HttpCaller) CallStream ¶
func (x *HttpCaller) CallStream(ctx context.Context, method string, opts ...rpc_interface.CallStreamOption) (rpc_interface.Stream, error)
func (*HttpCaller) GetLogger ¶
func (c *HttpCaller) GetLogger() logging.Logger
func (*HttpCaller) JoinPath ¶
func (x *HttpCaller) JoinPath(p string) string
func (*HttpCaller) MarshalDoRequest ¶
func (s *HttpCaller) MarshalDoRequest(req *DoRequest) (*crypto_core.Packet, error)
func (*HttpCaller) UnmarshalDoResponse ¶
func (x *HttpCaller) UnmarshalDoResponse(out *crypto_interface.Packet) (*DoResponse, error)
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func (*HttpServer) GetLogger ¶
func (s *HttpServer) GetLogger() logging.Logger
func (*HttpServer) HttpDo ¶
func (x *HttpServer) HttpDo(c *gin.Context)
func (*HttpServer) MarshalDoResponse ¶
func (x *HttpServer) MarshalDoResponse(res *DoResponse, req *DoRequest) (*crypto_interface.Packet, error)
func (*HttpServer) Routers ¶
func (s *HttpServer) Routers() http.Handler
func (*HttpServer) UnmarshalDoRequest ¶
func (s *HttpServer) UnmarshalDoRequest(in *crypto_core.Packet) (*DoRequest, error)
func (*HttpServer) WriteResponse ¶
func (x *HttpServer) WriteResponse(c *gin.Context, sc int, res *DoResponse, req *DoRequest)
func (*HttpServer) WriteResponseWithError ¶
Click to show internal directories.
Click to hide internal directories.