Documentation ¶
Index ¶
- func CreateDowngradingHandler(grpcServer *grpc.Server, httpHandler http.Handler) http.Handler
- func GetClient(isSudo bool) (cli rpc.DaemonClient)
- func GetClientWithoutCache(ctx context.Context, isSudo bool) (cli rpc.DaemonClient, conn *grpc.ClientConn, err error)
- func GetHttpClient(isSudo bool) *http.Client
- func GetTCPClient(isSudo bool) net.Conn
- func StartupDaemon(ctx context.Context, path ...string) error
- type SvrOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDowngradingHandler ¶
CreateDowngradingHandler takes a gRPC server and a plain HTTP handler, and returns an HTTP handler that has the capability of handling HTTP requests and gRPC requests that may require downgrading the response to gRPC-Web or gRPC-WebSocket.
if r.ProtoMajor == 2 && strings.HasPrefix( r.Header.Get("Content-Type"), "application/grpc") { grpcServer.ServeHTTP(w, r) } else { yourMux.ServeHTTP(w, r) }
func GetClient ¶
func GetClient(isSudo bool) (cli rpc.DaemonClient)
func GetClientWithoutCache ¶ added in v2.2.9
func GetClientWithoutCache(ctx context.Context, isSudo bool) (cli rpc.DaemonClient, conn *grpc.ClientConn, err error)
func GetHttpClient ¶
func GetTCPClient ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.