Documentation ¶
Index ¶
- func CreateDowngradingHandler(grpcServer *grpc.Server, httpHandler http.Handler) http.Handler
- func GetClient(isSudo bool) rpc.DaemonClient
- func GetHttpClient(isSudo bool) *http.Client
- func GetPidPath(isSudo bool) string
- func GetSockPath(isSudo bool) string
- 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) rpc.DaemonClient
func GetHttpClient ¶
func GetPidPath ¶
func GetSockPath ¶
func GetTCPClient ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.