api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Otter_Status_FullMethodName = "/otter.v1.Otter/Status"
)

Variables

View Source
var (
	ServiceState_Status_name = map[int32]string{
		0: "UNKNOWN",
		1: "HEALTHY",
		2: "UNHEALTHY",
		3: "DANGER",
		4: "OFFLINE",
		5: "MAINTENANCE",
	}
	ServiceState_Status_value = map[string]int32{
		"UNKNOWN":     0,
		"HEALTHY":     1,
		"UNHEALTHY":   2,
		"DANGER":      3,
		"OFFLINE":     4,
		"MAINTENANCE": 5,
	}
)

Enum value maps for ServiceState_Status.

View Source
var File_otter_v1_otter_proto protoreflect.FileDescriptor
View Source
var Otter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "otter.v1.Otter",
	HandlerType: (*OtterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Status",
			Handler:    _Otter_Status_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "otter/v1/otter.proto",
}

Otter_ServiceDesc is the grpc.ServiceDesc for Otter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterOtterServer

func RegisterOtterServer(s grpc.ServiceRegistrar, srv OtterServer)

Types

type HealthCheck

type HealthCheck struct {

	// The number of failed health checks that proceeded the current check.
	Attempts uint32 `protobuf:"varint,1,opt,name=attempts,proto3" json:"attempts,omitempty"`
	// The timestamp of the last health check, successful or otherwise.
	LastCheckedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_checked_at,json=lastCheckedAt,proto3" json:"last_checked_at,omitempty"`
	// contains filtered or unexported fields
}

HealthCheck is used to query the service state of a replica.

func (*HealthCheck) Descriptor deprecated

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

Deprecated: Use HealthCheck.ProtoReflect.Descriptor instead.

func (*HealthCheck) GetAttempts

func (x *HealthCheck) GetAttempts() uint32

func (*HealthCheck) GetLastCheckedAt

func (x *HealthCheck) GetLastCheckedAt() *timestamppb.Timestamp

func (*HealthCheck) ProtoMessage

func (*HealthCheck) ProtoMessage()

func (*HealthCheck) ProtoReflect

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

func (*HealthCheck) Reset

func (x *HealthCheck) Reset()

func (*HealthCheck) String

func (x *HealthCheck) String() string

type OtterClient

type OtterClient interface {
	// Implements a client-side heartbeat that can also be used by monitoring tools.
	Status(ctx context.Context, in *HealthCheck, opts ...grpc.CallOption) (*ServiceState, error)
}

OtterClient is the client API for Otter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewOtterClient

func NewOtterClient(cc grpc.ClientConnInterface) OtterClient

type OtterServer

type OtterServer interface {
	// Implements a client-side heartbeat that can also be used by monitoring tools.
	Status(context.Context, *HealthCheck) (*ServiceState, error)
	// contains filtered or unexported methods
}

OtterServer is the server API for Otter service. All implementations must embed UnimplementedOtterServer for forward compatibility

type ServiceState

type ServiceState struct {

	// Current service status as defined by the recieving system. The system is obliged
	// to respond with the closest matching status in a best-effort fashion. Alerts will
	// be triggered on service status changes if the system does not respond and the
	// previous system state was not unknown.
	Status ServiceState_Status `protobuf:"varint,1,opt,name=status,proto3,enum=otter.v1.ServiceState_Status" json:"status,omitempty"`
	// The current version of the replica
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// How long the replica has been up and running since it was last rebooted
	Uptime *durationpb.Duration `protobuf:"bytes,3,opt,name=uptime,proto3" json:"uptime,omitempty"`
	// Hint to the client when to check the health status again.
	NotBefore *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=not_before,json=notBefore,proto3" json:"not_before,omitempty"`
	NotAfter  *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=not_after,json=notAfter,proto3" json:"not_after,omitempty"`
	// contains filtered or unexported fields
}

ServiceState describes the health status of the replica for heartbeats and pings.

func (*ServiceState) Descriptor deprecated

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

Deprecated: Use ServiceState.ProtoReflect.Descriptor instead.

func (*ServiceState) GetNotAfter

func (x *ServiceState) GetNotAfter() *timestamppb.Timestamp

func (*ServiceState) GetNotBefore

func (x *ServiceState) GetNotBefore() *timestamppb.Timestamp

func (*ServiceState) GetStatus

func (x *ServiceState) GetStatus() ServiceState_Status

func (*ServiceState) GetUptime

func (x *ServiceState) GetUptime() *durationpb.Duration

func (*ServiceState) GetVersion

func (x *ServiceState) GetVersion() string

func (*ServiceState) ProtoMessage

func (*ServiceState) ProtoMessage()

func (*ServiceState) ProtoReflect

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

func (*ServiceState) Reset

func (x *ServiceState) Reset()

func (*ServiceState) String

func (x *ServiceState) String() string

type ServiceState_Status

type ServiceState_Status int32
const (
	ServiceState_UNKNOWN     ServiceState_Status = 0
	ServiceState_HEALTHY     ServiceState_Status = 1
	ServiceState_UNHEALTHY   ServiceState_Status = 2
	ServiceState_DANGER      ServiceState_Status = 3
	ServiceState_OFFLINE     ServiceState_Status = 4
	ServiceState_MAINTENANCE ServiceState_Status = 5
)

func (ServiceState_Status) Descriptor

func (ServiceState_Status) Enum

func (ServiceState_Status) EnumDescriptor deprecated

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

Deprecated: Use ServiceState_Status.Descriptor instead.

func (ServiceState_Status) Number

func (ServiceState_Status) String

func (x ServiceState_Status) String() string

func (ServiceState_Status) Type

type UnimplementedOtterServer

type UnimplementedOtterServer struct {
}

UnimplementedOtterServer must be embedded to have forward compatible implementations.

func (UnimplementedOtterServer) Status

type UnsafeOtterServer

type UnsafeOtterServer interface {
	// contains filtered or unexported methods
}

UnsafeOtterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OtterServer will result in compilation errors.

Jump to

Keyboard shortcuts

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