gateways

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// EventSourceDir
	EventSourceDir = "../../../examples/event-sources"
)

Gateway constants

Variables

This section is empty.

Functions

func RegisterEventingServer

func RegisterEventingServer(s *grpc.Server, srv EventingServer)

Types

type Event

type Event struct {
	// The event source name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The event payload.
	Payload              []byte   `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

* Represents an event

func (*Event) Descriptor

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

func (*Event) GetName

func (m *Event) GetName() string

func (*Event) GetPayload

func (m *Event) GetPayload() []byte

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) String

func (m *Event) String() string

func (*Event) XXX_DiscardUnknown

func (m *Event) XXX_DiscardUnknown()

func (*Event) XXX_Marshal

func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Event) XXX_Merge

func (m *Event) XXX_Merge(src proto.Message)

func (*Event) XXX_Size

func (m *Event) XXX_Size() int

func (*Event) XXX_Unmarshal

func (m *Event) XXX_Unmarshal(b []byte) error

type EventSource

type EventSource struct {
	// ID of the event source. internally generated.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The event source name.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// The event source configuration value.
	Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// Type of the event source
	Type                 string   `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

* Represents an event source

func (*EventSource) Descriptor

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

func (*EventSource) GetId

func (m *EventSource) GetId() string

func (*EventSource) GetName

func (m *EventSource) GetName() string

func (*EventSource) GetType added in v0.13.0

func (m *EventSource) GetType() string

func (*EventSource) GetValue added in v0.13.0

func (m *EventSource) GetValue() []byte

func (*EventSource) ProtoMessage

func (*EventSource) ProtoMessage()

func (*EventSource) Reset

func (m *EventSource) Reset()

func (*EventSource) String

func (m *EventSource) String() string

func (*EventSource) XXX_DiscardUnknown

func (m *EventSource) XXX_DiscardUnknown()

func (*EventSource) XXX_Marshal

func (m *EventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EventSource) XXX_Merge

func (m *EventSource) XXX_Merge(src proto.Message)

func (*EventSource) XXX_Size

func (m *EventSource) XXX_Size() int

func (*EventSource) XXX_Unmarshal

func (m *EventSource) XXX_Unmarshal(b []byte) error

type EventingClient

type EventingClient interface {
	// StartEventSource starts an event source and returns stream of events.
	StartEventSource(ctx context.Context, in *EventSource, opts ...grpc.CallOption) (Eventing_StartEventSourceClient, error)
	// ValidateEventSource validates an event source.
	ValidateEventSource(ctx context.Context, in *EventSource, opts ...grpc.CallOption) (*ValidEventSource, error)
}

EventingClient is the client API for Eventing service.

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

func NewEventingClient

func NewEventingClient(cc *grpc.ClientConn) EventingClient

type EventingServer

type EventingServer interface {
	// StartEventSource starts an event source and returns stream of events.
	StartEventSource(*EventSource, Eventing_StartEventSourceServer) error
	// ValidateEventSource validates an event source.
	ValidateEventSource(context.Context, *EventSource) (*ValidEventSource, error)
}

EventingServer is the server API for Eventing service.

type Eventing_StartEventSourceClient

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

type Eventing_StartEventSourceServer

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

type ValidEventSource

type ValidEventSource struct {
	// whether event source is valid
	IsValid bool `protobuf:"varint,1,opt,name=isValid,proto3" json:"isValid,omitempty"`
	// reason if an event source is invalid
	Reason               string   `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

* Represents if an event source is valid or not

func (*ValidEventSource) Descriptor

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

func (*ValidEventSource) GetIsValid

func (m *ValidEventSource) GetIsValid() bool

func (*ValidEventSource) GetReason

func (m *ValidEventSource) GetReason() string

func (*ValidEventSource) ProtoMessage

func (*ValidEventSource) ProtoMessage()

func (*ValidEventSource) Reset

func (m *ValidEventSource) Reset()

func (*ValidEventSource) String

func (m *ValidEventSource) String() string

func (*ValidEventSource) XXX_DiscardUnknown

func (m *ValidEventSource) XXX_DiscardUnknown()

func (*ValidEventSource) XXX_Marshal

func (m *ValidEventSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidEventSource) XXX_Merge

func (m *ValidEventSource) XXX_Merge(src proto.Message)

func (*ValidEventSource) XXX_Size

func (m *ValidEventSource) XXX_Size() int

func (*ValidEventSource) XXX_Unmarshal

func (m *ValidEventSource) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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