events

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResourceType_name = map[int32]string{
		0: "RESOURCE_TYPE_UNKNOWN",
		1: "RESOURCE_TYPE_TEMPLATE",
		2: "RESOURCE_TYPE_HARDWARE",
		3: "RESOURCE_TYPE_WORKFLOW",
	}
	ResourceType_value = map[string]int32{
		"RESOURCE_TYPE_UNKNOWN":  0,
		"RESOURCE_TYPE_TEMPLATE": 1,
		"RESOURCE_TYPE_HARDWARE": 2,
		"RESOURCE_TYPE_WORKFLOW": 3,
	}
)

Enum value maps for ResourceType.

View Source
var (
	EventType_name = map[int32]string{
		0: "EVENT_TYPE_UNKNOWN",
		1: "EVENT_TYPE_CREATED",
		2: "EVENT_TYPE_UPDATED",
		3: "EVENT_TYPE_DELETED",
	}
	EventType_value = map[string]int32{
		"EVENT_TYPE_UNKNOWN": 0,
		"EVENT_TYPE_CREATED": 1,
		"EVENT_TYPE_UPDATED": 2,
		"EVENT_TYPE_DELETED": 3,
	}
)

Enum value maps for EventType.

View Source
var File_events_events_proto protoreflect.FileDescriptor

Functions

func RegisterEventsServiceServer

func RegisterEventsServiceServer(s *grpc.Server, srv EventsServiceServer)

Types

type Event

type Event struct {
	Id           string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	ResourceId   string                 `protobuf:"bytes,2,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
	ResourceType ResourceType           `` /* 157-byte string literal not displayed */
	EventType    EventType              `` /* 145-byte string literal not displayed */
	Data         []byte                 `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
	CreatedAt    *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

An event represents a change in the state of a give resource type.

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetCreatedAt

func (x *Event) GetCreatedAt() *timestamppb.Timestamp

func (*Event) GetData

func (x *Event) GetData() []byte

func (*Event) GetEventType

func (x *Event) GetEventType() EventType

func (*Event) GetId

func (x *Event) GetId() string

func (*Event) GetResourceId

func (x *Event) GetResourceId() string

func (*Event) GetResourceType

func (x *Event) GetResourceType() ResourceType

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 EventType

type EventType int32

EventType represents different events that lead to change in state for a given resource.

const (
	EventType_EVENT_TYPE_UNKNOWN EventType = 0
	EventType_EVENT_TYPE_CREATED EventType = 1
	EventType_EVENT_TYPE_UPDATED EventType = 2
	EventType_EVENT_TYPE_DELETED 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 EventsServiceClient

type EventsServiceClient interface {
	Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (EventsService_WatchClient, error)
}

EventsServiceClient is the client API for EventsService service.

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

type EventsServiceServer

type EventsServiceServer interface {
	Watch(*WatchRequest, EventsService_WatchServer) error
}

EventsServiceServer is the server API for EventsService service.

type EventsService_WatchClient

type EventsService_WatchClient interface {
	Recv() (*Event, error)
	grpc.ClientStream
}

type EventsService_WatchServer

type EventsService_WatchServer interface {
	Send(*Event) error
	grpc.ServerStream
}

type ResourceType

type ResourceType int32

ResourceType is a resource in Tinkerbell space that has a state, which can change over time.

const (
	ResourceType_RESOURCE_TYPE_UNKNOWN  ResourceType = 0
	ResourceType_RESOURCE_TYPE_TEMPLATE ResourceType = 1
	ResourceType_RESOURCE_TYPE_HARDWARE ResourceType = 2
	ResourceType_RESOURCE_TYPE_WORKFLOW ResourceType = 3
)

func (ResourceType) Descriptor

func (ResourceType) Enum

func (x ResourceType) Enum() *ResourceType

func (ResourceType) EnumDescriptor deprecated

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

Deprecated: Use ResourceType.Descriptor instead.

func (ResourceType) Number

func (ResourceType) String

func (x ResourceType) String() string

func (ResourceType) Type

type UnimplementedEventsServiceServer

type UnimplementedEventsServiceServer struct {
}

UnimplementedEventsServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedEventsServiceServer) Watch

type WatchRequest

type WatchRequest struct {

	// Resource ID to watch a specific resource.
	ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
	// List of EventType(s) consumer wants to watch for.
	// An empty list would mean ALL EventType(s).
	EventTypes []EventType `` /* 155-byte string literal not displayed */
	// List of ResourceType(s) consumer wants to watch for.
	// An empty list would mean ALL ResourceType(s).
	ResourceTypes []ResourceType `` /* 167-byte string literal not displayed */
	// Every consumer when it connects to a stream of events will specify
	// how old the events returned should be (by default 5m).
	WatchEventsFrom *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=watch_events_from,json=watchEventsFrom,proto3" json:"watch_events_from,omitempty"`
	// contains filtered or unexported fields
}

WatchRequest allows cunsumers to customize watch, and only look for certain events on certain resources.

func (*WatchRequest) Descriptor deprecated

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

Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead.

func (*WatchRequest) GetEventTypes

func (x *WatchRequest) GetEventTypes() []EventType

func (*WatchRequest) GetResourceId

func (x *WatchRequest) GetResourceId() string

func (*WatchRequest) GetResourceTypes

func (x *WatchRequest) GetResourceTypes() []ResourceType

func (*WatchRequest) GetWatchEventsFrom

func (x *WatchRequest) GetWatchEventsFrom() *timestamppb.Timestamp

func (*WatchRequest) ProtoMessage

func (*WatchRequest) ProtoMessage()

func (*WatchRequest) ProtoReflect

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

func (*WatchRequest) Reset

func (x *WatchRequest) Reset()

func (*WatchRequest) String

func (x *WatchRequest) String() string

Jump to

Keyboard shortcuts

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