Documentation ¶
Index ¶
- Constants
- Variables
- func NewSyncStreamPool(client pb.SyncClient, initCap, maxCap int, idleTimeout time.Duration) (pool.Pool, error)
- func SignalNotifyDeamon(c *Client)
- func Sync(p pool.Pool, evtReq *pb.ConfigEvent, opts ...OpSyncCallOption) (evtResp *pb.ConfigEvent, err error)
- type Client
- type EventCall
- type OpSyncCallOption
- type Option
- type SignalHandler
- type SyncStream
Constants ¶
View Source
const ( SchemeTypeRpc = "prpc" SchemeTypeGrpc = "grpc" )
Variables ¶
View Source
var ( ErrEventDataInvalid = errors.New("event data invalid") ErrArgs = errors.New("gokeeper client useage: ./bin/component -d=domain -n=nodeid -k=keeper_address") ConnectTimeout = time.Duration(10) * time.Second ReadTimeout = time.Duration(300) * time.Second WriteTimeout = time.Duration(300) * time.Second EventInterval = time.Duration(5) * time.Second )
View Source
var ( ErrTypeInValid = errors.New("stream from pool is invalid") ErrSendTimeout = errors.New("stream send timeout") )
View Source
var EventCallback = newEventCall()
View Source
var (
ProcInfo *model.ProcInfo
)
View Source
var (
SignalHandlerCallback = newSignalHandler()
)
Functions ¶
func NewSyncStreamPool ¶
func SignalNotifyDeamon ¶
func SignalNotifyDeamon(c *Client)
SignalNotifyDeamon listen signal @todo registerCallFunc registe Client or Client implement callback interface
func Sync ¶
func Sync(p pool.Pool, evtReq *pb.ConfigEvent, opts ...OpSyncCallOption) (evtResp *pb.ConfigEvent, err error)
@todo 如果server端处理能力不足,导致server recv buffer full(stream level),此时Send会阻塞,这时应该如何处理???
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client ...
func New ¶
func New(keeperAddr, domain, nodeID, component string, rawSubscription []string, tags map[string]string, opts ...Option) *Client
New return client struct
func (*Client) LoadData ¶
func (c *Client) LoadData(objContainer model.ObjContainer) *Client
LoadData register data
func (*Client) RegisterCallback ¶
RegisterCallback event
type EventCall ¶
func (*EventCall) RegisterCallFunc ¶
type OpSyncCallOption ¶
type OpSyncCallOption func(o *syncCallOption)
func WithSyncCallRetryTimes ¶
func WithSyncCallRetryTimes(retryTimes int) OpSyncCallOption
func WithSyncCallTimeout ¶
func WithSyncCallTimeout(timeout time.Duration) OpSyncCallOption
type SignalHandler ¶
type SignalHandler struct {
// contains filtered or unexported fields
}
SignalHandler ...
type SyncStream ¶
type SyncStream struct { pb.Sync_SyncClient // contains filtered or unexported fields }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.