Documentation ¶
Index ¶
- Constants
- type Builder
- func (b *Builder) GetConn(ctx context.Context, addr string) (*grpc.ClientConn, error)
- func (b *Builder) GetTLSConn(ctx context.Context, addr string) (*grpc.ClientConn, error)
- func (b *Builder) WithBlock() *Builder
- func (b *Builder) WithClientTransportCredentials(insecureSkipVerify bool, certPool *x509.CertPool) *Builder
- func (b *Builder) WithInsecure() *Builder
- func (b *Builder) WithKeepAliveParams(params keepalive.ClientParameters) *Builder
- func (b *Builder) WithOptions(opts ...grpc.DialOption) *Builder
- type ConnectionBuilder
- type ReadSideManager
Constants ¶
const ( // KeepAliveTime is the period after which a keepalive ping is sent on the // transport KeepAliveTime = 1200 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is grpc client client builder
func (*Builder) GetTLSConn ¶
GetTLSConn returns client connection to the server
func (*Builder) WithBlock ¶
WithBlock the dialing blocks until the underlying connection is up. Without this, Dial returns immediately and connecting the server happens in background.
func (*Builder) WithClientTransportCredentials ¶
func (b *Builder) WithClientTransportCredentials(insecureSkipVerify bool, certPool *x509.CertPool) *Builder
WithClientTransportCredentials builds transport credentials for a gRPC client using the given properties.
func (*Builder) WithInsecure ¶
WithInsecure set the connection as insecure
func (*Builder) WithKeepAliveParams ¶
func (b *Builder) WithKeepAliveParams(params keepalive.ClientParameters) *Builder
WithKeepAliveParams set the keep alive params ClientParameters is used to set keepalive parameters on the client-side. These configure how the client will actively probe to notice when a connection is broken and send pings so intermediaries will be aware of the liveness of the connection. Make sure these parameters are set in coordination with the keepalive policy on the server, as incompatible settings can result in closing of connection.
func (*Builder) WithOptions ¶
func (b *Builder) WithOptions(opts ...grpc.DialOption) *Builder
WithOptions set dial options
type ConnectionBuilder ¶
type ConnectionBuilder interface { WithOptions(opts ...grpc.DialOption) WithInsecure() WithKeepAliveParams(params keepalive.ClientParameters) GetConn(ctx context.Context, addr string) (*grpc.ClientConn, error) GetTLSConn(ctx context.Context, addr string) (*grpc.ClientConn, error) }
ConnectionBuilder is a builder to create GRPC connection to the GRPC Server
type ReadSideManager ¶
type ReadSideManager interface { // GetLatestOffset retrieves the latest offset across all shards GetLatestOffset(ctx context.Context, in *cospb.GetLatestOffsetRequest) (*cospb.GetLatestOffsetResponse, error) // GetLatestOffsetByShard retrieves the latest offset given a shard GetLatestOffsetByShard(ctx context.Context, in *cospb.GetLatestOffsetByShardRequest) (*cospb.GetLatestOffsetByShardResponse, error) // RestartReadSide will clear the read side offset and start it over again // from the first offset and this across all shards RestartReadSide(ctx context.Context, in *cospb.RestartReadSideRequest) (*cospb.RestartReadSideResponse, error) // RestartReadSideByShard will clear the read side offset for the given shard and start it over again from the first offset RestartReadSideByShard(ctx context.Context, in *cospb.RestartReadSideByShardRequest) (*cospb.RestartReadSideByShardResponse, error) // PauseReadSide pauses a read side. This can be useful when running some data // migration and this across all shards PauseReadSide(ctx context.Context, in *cospb.PauseReadSideRequest) (*cospb.PauseReadSideResponse, error) // PauseReadSideByShard pauses a read side. This can be useful when running some data // migration and this for a given shard PauseReadSideByShard(ctx context.Context, in *cospb.PauseReadSideByShardRequest) (*cospb.PauseReadSideByShardResponse, error) // ResumeReadSide resumes a paused read side and this across all shards ResumeReadSide(ctx context.Context, in *cospb.ResumeReadSideRequest) (*cospb.ResumeReadSideResponse, error) // ResumeReadSideByShard resumes a paused read side for a given shard ResumeReadSideByShard(ctx context.Context, in *cospb.ResumeReadSideByShardRequest) (*cospb.ResumeReadSideByShardResponse, error) // SkipOffset skips the current offset to read across all shards and continue with next. The operation will automatically restart the read side. SkipOffset(ctx context.Context, in *cospb.SkipOffsetRequest) (*cospb.SkipOffsetResponse, error) // SkipOffsetByShard skips the current offset to read for a given shard and continue with next. The operation will automatically restart the read side. SkipOffsetByShard(ctx context.Context, in *cospb.SkipOffsetByShardRequest) (*cospb.SkipOffsetByShardResponse, error) }
ReadSideManager will be implemented by the CoS client to send requests to CoS read side manager service