informer

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventStreamService_Subscribe_FullMethodName = "/informer.EventStreamService/Subscribe"
)

Variables

View Source
var (
	EventType_name = map[int32]string{
		0: "CREATED",
		1: "UPDATED",
		2: "DELETED",
		3: "SYNC_FINISHED",
	}
	EventType_value = map[string]int32{
		"CREATED":       0,
		"UPDATED":       1,
		"DELETED":       2,
		"SYNC_FINISHED": 3,
	}
)

Enum value maps for EventType.

View Source
var EventStreamService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "informer.EventStreamService",
	HandlerType: (*EventStreamServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _EventStreamService_Subscribe_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "proto/informer.proto",
}

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

View Source
var File_proto_informer_proto protoreflect.FileDescriptor

Functions

func RegisterEventStreamServiceServer

func RegisterEventStreamServiceServer(s grpc.ServiceRegistrar, srv EventStreamServiceServer)

Types

type ContainerInfo

type ContainerInfo struct {
	Id   string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name string            `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Env  map[string]string `` /* 147-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ContainerInfo) Descriptor deprecated

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

Deprecated: Use ContainerInfo.ProtoReflect.Descriptor instead.

func (*ContainerInfo) GetEnv

func (x *ContainerInfo) GetEnv() map[string]string

func (*ContainerInfo) GetId

func (x *ContainerInfo) GetId() string

func (*ContainerInfo) GetName

func (x *ContainerInfo) GetName() string

func (*ContainerInfo) ProtoMessage

func (*ContainerInfo) ProtoMessage()

func (*ContainerInfo) ProtoReflect

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

func (*ContainerInfo) Reset

func (x *ContainerInfo) Reset()

func (*ContainerInfo) String

func (x *ContainerInfo) String() string

type Event

type Event struct {

	// Todo: add timestamp:
	// - avoids out-of-order events coming from different informers (local vs remote)
	// - on failure/reconnection you don't need to receive all the events again
	Type     EventType   `protobuf:"varint,1,opt,name=type,proto3,enum=informer.EventType" json:"type,omitempty"`
	Resource *ObjectMeta `protobuf:"bytes,2,opt,name=resource,proto3,oneof" json:"resource,omitempty"`
	// contains filtered or unexported fields
}

Event represents a single event.

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetResource

func (x *Event) GetResource() *ObjectMeta

func (*Event) GetType

func (x *Event) GetType() EventType

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

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

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type EventStreamServiceClient

type EventStreamServiceClient interface {
	// Subscribe allows clients to subscribe to a stream of events.
	Subscribe(ctx context.Context, in *SubscribeMessage, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error)
}

EventStreamServiceClient is the client API for EventStreamService 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.

EventStreamService defines the gRPC service for event streaming.

type EventStreamServiceServer

type EventStreamServiceServer interface {
	// Subscribe allows clients to subscribe to a stream of events.
	Subscribe(*SubscribeMessage, grpc.ServerStreamingServer[Event]) error
	// contains filtered or unexported methods
}

EventStreamServiceServer is the server API for EventStreamService service. All implementations must embed UnimplementedEventStreamServiceServer for forward compatibility.

EventStreamService defines the gRPC service for event streaming.

type EventStreamService_SubscribeClient

type EventStreamService_SubscribeClient = grpc.ServerStreamingClient[Event]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type EventStreamService_SubscribeServer

type EventStreamService_SubscribeServer = grpc.ServerStreamingServer[Event]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type EventType

type EventType int32

EventType represents the type of event.

const (
	EventType_CREATED       EventType = 0
	EventType_UPDATED       EventType = 1
	EventType_DELETED       EventType = 2
	EventType_SYNC_FINISHED EventType = 3
)

func (EventType) Descriptor

func (EventType) Descriptor() protoreflect.EnumDescriptor

func (EventType) Enum

func (x EventType) Enum() *EventType

func (EventType) EnumDescriptor deprecated

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

Deprecated: Use EventType.Descriptor instead.

func (EventType) Number

func (x EventType) Number() protoreflect.EnumNumber

func (EventType) String

func (x EventType) String() string

func (EventType) Type

type ObjectMeta

type ObjectMeta struct {
	Name      string            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Namespace string            `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Labels    map[string]string `` /* 153-byte string literal not displayed */
	Ips       []string          `protobuf:"bytes,4,rep,name=ips,proto3" json:"ips,omitempty"`
	Kind      string            `protobuf:"bytes,5,opt,name=kind,proto3" json:"kind,omitempty"`
	// If the Kube object is not a Pod, this field will be empty.
	Pod *PodInfo `protobuf:"bytes,6,opt,name=pod,proto3,oneof" json:"pod,omitempty"`
	// contains filtered or unexported fields
}

func (*ObjectMeta) Descriptor deprecated

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

Deprecated: Use ObjectMeta.ProtoReflect.Descriptor instead.

func (*ObjectMeta) GetIps

func (x *ObjectMeta) GetIps() []string

func (*ObjectMeta) GetKind

func (x *ObjectMeta) GetKind() string

func (*ObjectMeta) GetLabels

func (x *ObjectMeta) GetLabels() map[string]string

func (*ObjectMeta) GetName

func (x *ObjectMeta) GetName() string

func (*ObjectMeta) GetNamespace

func (x *ObjectMeta) GetNamespace() string

func (*ObjectMeta) GetPod

func (x *ObjectMeta) GetPod() *PodInfo

func (*ObjectMeta) ProtoMessage

func (*ObjectMeta) ProtoMessage()

func (*ObjectMeta) ProtoReflect

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

func (*ObjectMeta) Reset

func (x *ObjectMeta) Reset()

func (*ObjectMeta) String

func (x *ObjectMeta) String() string

type Owner

type Owner struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"`
	// contains filtered or unexported fields
}

func (*Owner) Descriptor deprecated

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

Deprecated: Use Owner.ProtoReflect.Descriptor instead.

func (*Owner) GetKind

func (x *Owner) GetKind() string

func (*Owner) GetName

func (x *Owner) GetName() string

func (*Owner) ProtoMessage

func (*Owner) ProtoMessage()

func (*Owner) ProtoReflect

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

func (*Owner) Reset

func (x *Owner) Reset()

func (*Owner) String

func (x *Owner) String() string

type PodInfo

type PodInfo struct {
	Uid          string           `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	NodeName     string           `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
	StartTimeStr string           `protobuf:"bytes,3,opt,name=start_time_str,json=startTimeStr,proto3" json:"start_time_str,omitempty"`
	HostIp       string           `protobuf:"bytes,4,opt,name=host_ip,json=hostIp,proto3" json:"host_ip,omitempty"`
	Containers   []*ContainerInfo `protobuf:"bytes,5,rep,name=containers,proto3" json:"containers,omitempty"`
	Owners       []*Owner         `protobuf:"bytes,6,rep,name=owners,proto3" json:"owners,omitempty"`
	// contains filtered or unexported fields
}

func (*PodInfo) Descriptor deprecated

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

Deprecated: Use PodInfo.ProtoReflect.Descriptor instead.

func (*PodInfo) GetContainers

func (x *PodInfo) GetContainers() []*ContainerInfo

func (*PodInfo) GetHostIp

func (x *PodInfo) GetHostIp() string

func (*PodInfo) GetNodeName

func (x *PodInfo) GetNodeName() string

func (*PodInfo) GetOwners

func (x *PodInfo) GetOwners() []*Owner

func (*PodInfo) GetStartTimeStr

func (x *PodInfo) GetStartTimeStr() string

func (*PodInfo) GetUid

func (x *PodInfo) GetUid() string

func (*PodInfo) ProtoMessage

func (*PodInfo) ProtoMessage()

func (*PodInfo) ProtoReflect

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

func (*PodInfo) Reset

func (x *PodInfo) Reset()

func (*PodInfo) String

func (x *PodInfo) String() string

type SubscribeMessage

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

Empty message for Subscribe RPC

func (*SubscribeMessage) Descriptor deprecated

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

Deprecated: Use SubscribeMessage.ProtoReflect.Descriptor instead.

func (*SubscribeMessage) ProtoMessage

func (*SubscribeMessage) ProtoMessage()

func (*SubscribeMessage) ProtoReflect

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

func (*SubscribeMessage) Reset

func (x *SubscribeMessage) Reset()

func (*SubscribeMessage) String

func (x *SubscribeMessage) String() string

type UnimplementedEventStreamServiceServer

type UnimplementedEventStreamServiceServer struct{}

UnimplementedEventStreamServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedEventStreamServiceServer) Subscribe

type UnsafeEventStreamServiceServer

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

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

Jump to

Keyboard shortcuts

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