Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultNewSimpleHttpCallerOptions() option.Option
- func NewSimpleHttpCaller(opts ...rpc_core.NewCallerOption) (rpc_core.Caller, error)
- func NewSimpleHttpServer(opts ...rpc_core.NewServerOption) (rpc_core.Server, error)
- type SimpleDoRequest
- type SimpleDoResponse
- type SimpleHttpCaller
- func (c *SimpleHttpCaller) Call(ctx context.Context, method string, req rpc_interface.CallRequest, ...) error
- func (c *SimpleHttpCaller) CallStream(ctx context.Context, method string, opts ...rpc_interface.CallStreamOption) (rpc_interface.Stream, error)
- func (c *SimpleHttpCaller) GetLogger() logging.Logger
- func (c *SimpleHttpCaller) JoinPath(p string) string
- func (c *SimpleHttpCaller) JoinWsPath(p string) string
- type SimpleHttpServer
- func (s *SimpleHttpServer) GetLogger() logging.Logger
- func (s *SimpleHttpServer) HttpSimpleDo(c *gin.Context)
- func (s *SimpleHttpServer) HttpSimpleDoStream(c *gin.Context)
- func (s *SimpleHttpServer) Routers() http.Handler
- func (s *SimpleHttpServer) Serve(context.Context) <-chan error
- func (s *SimpleHttpServer) Terminate(ctx context.Context) error
- func (s *SimpleHttpServer) Wait(context.Context) <-chan error
- func (s *SimpleHttpServer) WriteResponse(c *gin.Context, sc int, res *SimpleDoResponse)
- func (s *SimpleHttpServer) WriteResponseWithError(c *gin.Context, sc int, err error)
Constants ¶
View Source
const (
OPTION_BASE_URL = "baseURL"
)
Variables ¶
View Source
var ( WebsocketUpgraderReadBufferSize = 4 * 1024 WebsocketUpgraderWriteBufferSize = 4 * 1024 WebsocketUpgraderEnableWritePool = false )
View Source
var (
WithBaseURL, GetBaseURL = option.New[string](OPTION_BASE_URL)
)
Functions ¶
func NewSimpleHttpCaller ¶
func NewSimpleHttpCaller(opts ...rpc_core.NewCallerOption) (rpc_core.Caller, error)
func NewSimpleHttpServer ¶
func NewSimpleHttpServer(opts ...rpc_core.NewServerOption) (rpc_core.Server, error)
Types ¶
type SimpleDoRequest ¶
type SimpleDoResponse ¶
type SimpleHttpCaller ¶
type SimpleHttpCaller struct {
// contains filtered or unexported fields
}
func (*SimpleHttpCaller) Call ¶
func (c *SimpleHttpCaller) Call(ctx context.Context, method string, req rpc_interface.CallRequest, res rpc_interface.CallResponse, opts ...rpc_interface.CallOption) error
func (*SimpleHttpCaller) CallStream ¶
func (c *SimpleHttpCaller) CallStream(ctx context.Context, method string, opts ...rpc_interface.CallStreamOption) (rpc_interface.Stream, error)
func (*SimpleHttpCaller) GetLogger ¶
func (c *SimpleHttpCaller) GetLogger() logging.Logger
func (*SimpleHttpCaller) JoinPath ¶
func (c *SimpleHttpCaller) JoinPath(p string) string
func (*SimpleHttpCaller) JoinWsPath ¶
func (c *SimpleHttpCaller) JoinWsPath(p string) string
type SimpleHttpServer ¶
type SimpleHttpServer struct {
// contains filtered or unexported fields
}
func (*SimpleHttpServer) GetLogger ¶
func (s *SimpleHttpServer) GetLogger() logging.Logger
func (*SimpleHttpServer) HttpSimpleDo ¶
func (s *SimpleHttpServer) HttpSimpleDo(c *gin.Context)
func (*SimpleHttpServer) HttpSimpleDoStream ¶
func (s *SimpleHttpServer) HttpSimpleDoStream(c *gin.Context)
func (*SimpleHttpServer) Routers ¶
func (s *SimpleHttpServer) Routers() http.Handler
func (*SimpleHttpServer) Terminate ¶
func (s *SimpleHttpServer) Terminate(ctx context.Context) error
func (*SimpleHttpServer) WriteResponse ¶
func (s *SimpleHttpServer) WriteResponse(c *gin.Context, sc int, res *SimpleDoResponse)
func (*SimpleHttpServer) WriteResponseWithError ¶
func (s *SimpleHttpServer) WriteResponseWithError(c *gin.Context, sc int, err error)
Click to show internal directories.
Click to hide internal directories.