status

package
v0.0.0-...-229d76c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Interface definitions

Index

Constants

View Source
const (
	Multiplier   = 10
	MaxDeviation = 10000
)

Variables

View Source
var (
	HealthCheckResponse_ServingStatus_name = map[int32]string{
		0: "UNKNOWN",
		1: "SERVING",
		2: "NOT_SERVING",
		3: "SERVICE_UNKNOWN",
	}
	HealthCheckResponse_ServingStatus_value = map[string]int32{
		"UNKNOWN":         0,
		"SERVING":         1,
		"NOT_SERVING":     2,
		"SERVICE_UNKNOWN": 3,
	}
)

Enum value maps for HealthCheckResponse_ServingStatus.

View Source
var File_status_status_proto protoreflect.FileDescriptor
View Source
var File_status_update_proto protoreflect.FileDescriptor

Functions

func RegisterHealthServer

func RegisterHealthServer(s *grpc.Server, srv HealthServer)

func RegisterKafkaMetricServer

func RegisterKafkaMetricServer(s *grpc.Server, srv KafkaMetricServer)

Types

type HealthCheckRequest

type HealthCheckRequest struct {
	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// contains filtered or unexported fields
}

func (*HealthCheckRequest) Descriptor deprecated

func (*HealthCheckRequest) Descriptor() ([]byte, []int)

Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead.

func (*HealthCheckRequest) GetService

func (x *HealthCheckRequest) GetService() string

func (*HealthCheckRequest) ProtoMessage

func (*HealthCheckRequest) ProtoMessage()

func (*HealthCheckRequest) ProtoReflect

func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message

func (*HealthCheckRequest) Reset

func (x *HealthCheckRequest) Reset()

func (*HealthCheckRequest) String

func (x *HealthCheckRequest) String() string

type HealthCheckResponse

type HealthCheckResponse struct {
	Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=grpc.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*HealthCheckResponse) Descriptor deprecated

func (*HealthCheckResponse) Descriptor() ([]byte, []int)

Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead.

func (*HealthCheckResponse) GetStatus

func (*HealthCheckResponse) ProtoMessage

func (*HealthCheckResponse) ProtoMessage()

func (*HealthCheckResponse) ProtoReflect

func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message

func (*HealthCheckResponse) Reset

func (x *HealthCheckResponse) Reset()

func (*HealthCheckResponse) String

func (x *HealthCheckResponse) String() string

type HealthCheckResponse_ServingStatus

type HealthCheckResponse_ServingStatus int32
const (
	HealthCheckResponse_UNKNOWN         HealthCheckResponse_ServingStatus = 0
	HealthCheckResponse_SERVING         HealthCheckResponse_ServingStatus = 1
	HealthCheckResponse_NOT_SERVING     HealthCheckResponse_ServingStatus = 2
	HealthCheckResponse_SERVICE_UNKNOWN HealthCheckResponse_ServingStatus = 3 // Used only by the Watch method.
)

func (HealthCheckResponse_ServingStatus) Descriptor

func (HealthCheckResponse_ServingStatus) Enum

func (HealthCheckResponse_ServingStatus) EnumDescriptor deprecated

func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use HealthCheckResponse_ServingStatus.Descriptor instead.

func (HealthCheckResponse_ServingStatus) Number

func (HealthCheckResponse_ServingStatus) String

func (HealthCheckResponse_ServingStatus) Type

type HealthClient

type HealthClient interface {
	Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
}

HealthClient is the client API for Health service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewHealthClient

func NewHealthClient(cc grpc.ClientConnInterface) HealthClient

type HealthServer

type HealthServer interface {
	Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
}

HealthServer is the server API for Health service.

type KafkaMetricClient

type KafkaMetricClient interface {
	Update(ctx context.Context, in *KafkaMetricRequest, opts ...grpc.CallOption) (*KafkaMetricResponse, error)
}

KafkaMetricClient is the client API for KafkaMetric service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type KafkaMetricRequest

type KafkaMetricRequest struct {
	Lag int64 `protobuf:"varint,1,opt,name=lag,proto3" json:"lag,omitempty"`
	// contains filtered or unexported fields
}

func (*KafkaMetricRequest) Descriptor deprecated

func (*KafkaMetricRequest) Descriptor() ([]byte, []int)

Deprecated: Use KafkaMetricRequest.ProtoReflect.Descriptor instead.

func (*KafkaMetricRequest) GetLag

func (x *KafkaMetricRequest) GetLag() int64

func (*KafkaMetricRequest) ProtoMessage

func (*KafkaMetricRequest) ProtoMessage()

func (*KafkaMetricRequest) ProtoReflect

func (x *KafkaMetricRequest) ProtoReflect() protoreflect.Message

func (*KafkaMetricRequest) Reset

func (x *KafkaMetricRequest) Reset()

func (*KafkaMetricRequest) String

func (x *KafkaMetricRequest) String() string

type KafkaMetricResponse

type KafkaMetricResponse struct {
	Accepted bool `protobuf:"varint,1,opt,name=accepted,proto3" json:"accepted,omitempty"`
	// contains filtered or unexported fields
}

func (*KafkaMetricResponse) Descriptor deprecated

func (*KafkaMetricResponse) Descriptor() ([]byte, []int)

Deprecated: Use KafkaMetricResponse.ProtoReflect.Descriptor instead.

func (*KafkaMetricResponse) GetAccepted

func (x *KafkaMetricResponse) GetAccepted() bool

func (*KafkaMetricResponse) ProtoMessage

func (*KafkaMetricResponse) ProtoMessage()

func (*KafkaMetricResponse) ProtoReflect

func (x *KafkaMetricResponse) ProtoReflect() protoreflect.Message

func (*KafkaMetricResponse) Reset

func (x *KafkaMetricResponse) Reset()

func (*KafkaMetricResponse) String

func (x *KafkaMetricResponse) String() string

type KafkaMetricServer

type KafkaMetricServer interface {
	Update(context.Context, *KafkaMetricRequest) (*KafkaMetricResponse, error)
}

KafkaMetricServer is the server API for KafkaMetric service.

type RPC

type RPC struct {
	// contains filtered or unexported fields
}

RPC struct for the service

func (*RPC) Check

Check defines if the sidecarred service is healthy

func (*RPC) Register

func (rpc *RPC) Register(server *grpc.Server)

Register wires up the RPC to the server

func (*RPC) Update

Update is the place to dump lag metric data

type RPCInterface

type RPCInterface interface {
	Register(*grpc.Server)
	Check(ctx context.Context, r *HealthCheckRequest) (*HealthCheckResponse, error)
	Update(ctx context.Context, r *KafkaMetricRequest) (*KafkaMetricResponse, error)
}

RPCInterface interface for RPC.

func NewRPC

func NewRPC(svc ServiceInterface) RPCInterface

NewRPC returns a new initialized RPC object.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides exported method GetDecision. All other methods are unexported.

func (*Service) ElaborateHealthStatus

func (s *Service) ElaborateHealthStatus() bool

ElaborateHealthStatus evaluates if there was any change in the last maxLags and if: * the lag keeps going higher without ever decreasing it will return false * if the lag is above maxLag will return false in any other occasion it will return true

func (*Service) StoreLag

func (s *Service) StoreLag(lag int64)

StoreLag stores the lag metric into memory

type ServiceInterface

type ServiceInterface interface {
	StoreLag(lag int64)
	ElaborateHealthStatus() bool
}

ServiceInterface interface for service provider.

func NewService

func NewService(lagCount, maxLag int) ServiceInterface

NewService creates a new service

type UnimplementedHealthServer

type UnimplementedHealthServer struct {
}

UnimplementedHealthServer can be embedded to have forward compatible implementations.

func (*UnimplementedHealthServer) Check

type UnimplementedKafkaMetricServer

type UnimplementedKafkaMetricServer struct {
}

UnimplementedKafkaMetricServer can be embedded to have forward compatible implementations.

func (*UnimplementedKafkaMetricServer) Update

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL