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 tp.EarlyPeer) error // PostDial initializes heartbeat information. PostDial(sess tp.PreSession) *tp.Rerror // PostAccept initializes heartbeat information. PostAccept(sess tp.PreSession) *tp.Rerror // PostWriteCall updates heartbeat information. PostWriteCall(ctx tp.WriteCtx) *tp.Rerror // PostWritePush updates heartbeat information. PostWritePush(ctx tp.WriteCtx) *tp.Rerror // PostReadCallHeader updates heartbeat information. PostReadCallHeader(ctx tp.ReadCtx) *tp.Rerror // PostReadPushHeader updates heartbeat information. PostReadPushHeader(ctx tp.ReadCtx) *tp.Rerror }
Ping send heartbeat.
type Pong ¶
type Pong interface { // Name returns name. Name() string // PostNewPeer runs ping woker. PostNewPeer(peer tp.EarlyPeer) error // PostWriteCall updates heartbeat information. PostWriteCall(ctx tp.WriteCtx) *tp.Rerror // PostWritePush updates heartbeat information. PostWritePush(ctx tp.WriteCtx) *tp.Rerror // PostReadCallHeader updates heartbeat information. PostReadCallHeader(ctx tp.ReadCtx) *tp.Rerror // PostReadPushHeader updates heartbeat information. PostReadPushHeader(ctx tp.ReadCtx) *tp.Rerror }
Pong receive heartbeat.
Click to show internal directories.
Click to hide internal directories.