rpc_simple_http

package
v0.0.0-20240423 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

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 DefaultNewSimpleHttpCallerOptions

func DefaultNewSimpleHttpCallerOptions() option.Option

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 SimpleDoRequest struct {
	Method      string `json:"method"`
	CallRequest []byte `json:"callRequest,omitempty"`
}

type SimpleDoResponse

type SimpleDoResponse struct {
	CallResponse []byte `json:"callResponse,omitempty"`
	Error        string `json:"error,omitempty"`
}

type SimpleHttpCaller

type SimpleHttpCaller struct {
	// contains filtered or unexported fields
}

func (*SimpleHttpCaller) Call

func (*SimpleHttpCaller) CallStream

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) Serve

func (s *SimpleHttpServer) Serve(context.Context) <-chan error

func (*SimpleHttpServer) Terminate

func (s *SimpleHttpServer) Terminate(ctx context.Context) error

func (*SimpleHttpServer) Wait

func (s *SimpleHttpServer) Wait(context.Context) <-chan 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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL