Documentation ¶
Overview ¶
Heartbeat is a generic timing heartbeat plugin.
Copyright 2018 HenryLee. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
View Source
const (
// HeartbeatServiceMethod heartbeat service method
HeartbeatServiceMethod = "/heartbeat"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ping ¶
type Ping interface { // SetRate sets heartbeat rate. SetRate(rateSecond int) // UseCall uses CALL method to ping. UseCall() // UsePush uses PUSH method to ping. UsePush() // Name returns name. Name() string // PostNewPeer runs ping woker. PostNewPeer(peer erpc.EarlyPeer) error // PostDial initializes heartbeat information. PostDial(sess erpc.PreSession, isRedial bool) *erpc.Status // PostAccept initializes heartbeat information. PostAccept(sess erpc.PreSession) *erpc.Status // PostWriteCall updates heartbeat information. PostWriteCall(ctx erpc.WriteCtx) *erpc.Status // PostWritePush updates heartbeat information. PostWritePush(ctx erpc.WriteCtx) *erpc.Status // PostReadCallHeader updates heartbeat information. PostReadCallHeader(ctx erpc.ReadCtx) *erpc.Status // PostReadPushHeader updates heartbeat information. PostReadPushHeader(ctx erpc.ReadCtx) *erpc.Status }
Ping send heartbeat.
type Pong ¶
type Pong interface { // Name returns name. Name() string // PostNewPeer runs ping woker. PostNewPeer(peer erpc.EarlyPeer) error // PostWriteCall updates heartbeat information. PostWriteCall(ctx erpc.WriteCtx) *erpc.Status // PostWritePush updates heartbeat information. PostWritePush(ctx erpc.WriteCtx) *erpc.Status // PostReadCallHeader updates heartbeat information. PostReadCallHeader(ctx erpc.ReadCtx) *erpc.Status // PostReadPushHeader updates heartbeat information. PostReadPushHeader(ctx erpc.ReadCtx) *erpc.Status }
Pong receive heartbeat.
Click to show internal directories.
Click to hide internal directories.