Sign in

    moonbitstack/moonrpc/service does not have a README file

    HealthService

    pub struct HealthService {
    statuses : Map[String, ServingStatus]
    }

    A grpc.health.v1.Health service backed by a per-service status table. The empty key "" is the overall-server status; a fresh service reports the whole server SERVING.

    HealthService::check

    fn HealthService::check(self : HealthService, service : String) -> ServingStatus

    The serving status of a named service: its set status, or ServiceUnknown when the service was never registered.

    HealthService::handlers

    The (path, handler) pairs implementing the service: Check as a unary method and Watch as a server-streaming method that emits the current status. A live Watch that also pushes on every later change needs a streaming source the pure engine's eager ServerStreaming shape does not model, so this emits the status at subscribe time — the first message a real Watch always sends.

    HealthService::install

    Register Check and Watch on a pure server engine.

    HealthService::new

    A health service reporting the overall server as SERVING.

    HealthService::set_status

    fn HealthService::set_status(self : HealthService, service : String, status : ServingStatus) -> Unit

    Set the serving status of a named service (or the overall server with "").

    ReflectionRequest

    pub(all) enum ReflectionRequest {
    ListServices(String)
    FileByFilename(String)
    FileContainingSymbol(String)
    Unsupported
    } derive(Eq)

    A decoded ServerReflectionRequest, reduced to the one message_request oneof arm that was set. Extension-number queries are surfaced as Unsupported, which the service answers with an UNIMPLEMENTED error response.

    ReflectionRequest::equal

    ReflectionRequest::not_equal

    fn ReflectionRequest::not_equal(x : ReflectionRequest, y : ReflectionRequest) -> Bool

    ReflectionResponse

    pub(all) enum ReflectionResponse {
    ServiceList(Array[String])
    FileDescriptors(Array[Bytes])
    ReflectionError(Int, String)
    } derive(Eq)

    A decoded ServerReflectionResponse, reduced to the one message_response arm.

    ReflectionResponse::equal

    ReflectionResponse::not_equal

    ReflectionService

    pub struct ReflectionService {
    files : Array[
    FileDescriptor
    ]
    by_symbol : Map[String, Int]
    by_filename : Map[String, Int]
    services : Array[String]
    }

    A grpc.reflection.v1.ServerReflection service backed by an in-memory descriptor database. Each added FileDescriptor is indexed by filename and by every symbol (package.Service / package.Message) it defines, so a FileContainingSymbol or FileByFilename query resolves to the right file, and ListServices enumerates every registered service.

    ReflectionService::add_file

    Register a file descriptor: index it by filename and by each symbol it defines, and add its services to the ListServices set.

    ReflectionService::handle

    fn ReflectionService::handle(self : ReflectionService, request : Bytes) -> Bytes

    Answer one ServerReflectionRequest (raw bytes) with the encoded ServerReflectionResponse. A decode failure or an unknown symbol/filename yields an ErrorResponse rather than raising, since it rides a non-raising stream handler.

    ReflectionService::handler

    The bidi handler backing ServerReflectionInfo: one response per request, none at half-close.

    ReflectionService::install

    Register ServerReflectionInfo at both the v1 and v1alpha paths on a pure server engine.

    ReflectionService::new

    An empty reflection service. Add the descriptors of the services you serve with add_file.

    ServingStatus

    pub(all) enum ServingStatus {
    StatusUnknown
    Serving
    NotServing
    ServiceUnknown
    } derive(Eq)

    The grpc.health.v1.HealthCheckResponse.ServingStatus enum.

    ServingStatus::code

    fn ServingStatus::code(self : ServingStatus) -> Int

    The wire value of a serving status (the protobuf enum number).

    ServingStatus::equal

    ServingStatus::from_code

    fn ServingStatus::from_code(n : Int) -> ServingStatus

    The serving status for a protobuf enum number; out-of-range numbers read as StatusUnknown.

    ServingStatus::not_equal

    fn ServingStatus::not_equal(x : ServingStatus, y : ServingStatus) -> Bool

    decode_health_request

    fn decode_health_request(msg : Bytes) -> Bytes

    Decode the service field of a HealthCheckRequest, or empty bytes when the field is absent (the overall-server check). Unknown fields are skipped.

    decode_health_response

    fn decode_health_response(msg : Bytes) -> ServingStatus

    Decode the status field of a HealthCheckResponse; an absent field reads as the 0 default (StatusUnknown).

    decode_reflection_request

    fn decode_reflection_request(body : Bytes) -> ReflectionRequest raise
    PbError

    Decode a ServerReflectionRequest down to its message_request oneof arm. host (field 1) is accepted and ignored; an unset oneof reads as Unsupported.

    decode_reflection_response

    fn decode_reflection_response(body : Bytes) -> ReflectionResponse raise
    PbError

    Decode a ServerReflectionResponse down to its message_response arm — the half an in-process reflection client (and the tests) needs to read an answer.

    encode_health_request

    fn encode_health_request(service : Bytes) -> Bytes

    Encode a HealthCheckRequest: field 1 (service, a length-delimited string). An empty service name encodes to the empty message, the wire form of the overall-server check.

    encode_health_response

    fn encode_health_response(status : ServingStatus) -> Bytes

    Encode a HealthCheckResponse: field 1 (status, a varint enum). The SERVING default 0 still encodes to the empty message per protobuf default-omission.

    encode_reflection_request

    fn encode_reflection_request(req : ReflectionRequest) -> Bytes

    Encode a ServerReflectionRequest carrying a single oneof arm. Used by an in-process reflection client (and by the round-trip tests).

    health_check_path

    let health_check_path : String

    The gRPC HTTP/2 path of the Check method.

    health_watch_path

    let health_watch_path : String

    The gRPC HTTP/2 path of the Watch method.

    reflection_v1_path

    let reflection_v1_path : String

    The gRPC HTTP/2 path of the v1 reflection stream.

    reflection_v1alpha_path

    let reflection_v1alpha_path : String

    The gRPC HTTP/2 path of the legacy v1alpha reflection stream. grpcurl tries v1 first and falls back to this, so a server registers both.