Documentation ¶
Overview ¶
Heartbeat is a generic timing heartbeat plugin.
Copyright 2018-2023 HenryLee. All Rights Reserved. Copyright 2024 sqos. 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 ¶
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 yrpc.EarlyPeer) error // PostDial initializes heartbeat information. PostDial(sess yrpc.PreSession, isRedial bool) *yrpc.Status // PostAccept initializes heartbeat information. PostAccept(sess yrpc.PreSession) *yrpc.Status // PostWriteCall updates heartbeat information. PostWriteCall(ctx yrpc.WriteCtx) *yrpc.Status // PostWritePush updates heartbeat information. PostWritePush(ctx yrpc.WriteCtx) *yrpc.Status // PostReadCallHeader updates heartbeat information. PostReadCallHeader(ctx yrpc.ReadCtx) *yrpc.Status // PostReadPushHeader updates heartbeat information. PostReadPushHeader(ctx yrpc.ReadCtx) *yrpc.Status }
Ping send heartbeat.
type Pong ¶
type Pong interface { // Name returns name. Name() string // PostNewPeer runs ping woker. PostNewPeer(peer yrpc.EarlyPeer) error // PostWriteCall updates heartbeat information. PostWriteCall(ctx yrpc.WriteCtx) *yrpc.Status // PostWritePush updates heartbeat information. PostWritePush(ctx yrpc.WriteCtx) *yrpc.Status // PostReadCallHeader updates heartbeat information. PostReadCallHeader(ctx yrpc.ReadCtx) *yrpc.Status // PostReadPushHeader updates heartbeat information. PostReadPushHeader(ctx yrpc.ReadCtx) *yrpc.Status }
Pong receive heartbeat.