message

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package message defines websocket message protobuf type.

Index

Constants

This section is empty.

Variables

View Source
var (
	Kind_name = map[int32]string{
		0: "Error",
		1: "OK",
		2: "Watch",
		3: "Unsubscribe",
		4: "Subscribed",
		5: "EventItemAdd",
		6: "EventItemUpdate",
		7: "EventItemDelete",
		8: "EventError",
	}
	Kind_value = map[string]int32{
		"Error":           0,
		"OK":              1,
		"Watch":           2,
		"Unsubscribe":     3,
		"Subscribed":      4,
		"EventItemAdd":    5,
		"EventItemUpdate": 6,
		"EventItemDelete": 7,
		"EventError":      8,
	}
)

Enum value maps for Kind.

View Source
var File_socket_message_message_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ErrorSpec

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

func (*ErrorSpec) Descriptor deprecated

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

Deprecated: Use ErrorSpec.ProtoReflect.Descriptor instead.

func (*ErrorSpec) GetError

func (x *ErrorSpec) GetError() string

func (*ErrorSpec) ProtoMessage

func (*ErrorSpec) ProtoMessage()

func (*ErrorSpec) ProtoReflect

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

func (*ErrorSpec) Reset

func (x *ErrorSpec) Reset()

func (*ErrorSpec) String

func (x *ErrorSpec) String() string

type ItemUpdateSpec

type ItemUpdateSpec struct {
	Old []byte `protobuf:"bytes,1,opt,name=old,proto3" json:"old,omitempty"`
	New []byte `protobuf:"bytes,2,opt,name=new,proto3" json:"new,omitempty"`
	// contains filtered or unexported fields
}

func (*ItemUpdateSpec) Descriptor deprecated

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

Deprecated: Use ItemUpdateSpec.ProtoReflect.Descriptor instead.

func (*ItemUpdateSpec) GetNew

func (x *ItemUpdateSpec) GetNew() []byte

func (*ItemUpdateSpec) GetOld

func (x *ItemUpdateSpec) GetOld() []byte

func (*ItemUpdateSpec) ProtoMessage

func (*ItemUpdateSpec) ProtoMessage()

func (*ItemUpdateSpec) ProtoReflect

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

func (*ItemUpdateSpec) Reset

func (x *ItemUpdateSpec) Reset()

func (*ItemUpdateSpec) String

func (x *ItemUpdateSpec) String() string

type Kind

type Kind int32

Message kinds.

const (
	Kind_Error           Kind = 0 // A generic error response.
	Kind_OK              Kind = 1 // A generic ok response.
	Kind_Watch           Kind = 2 // Watch request.
	Kind_Unsubscribe     Kind = 3 // Unsubscribe request.
	Kind_Subscribed      Kind = 4 // Subscribed response.
	Kind_EventItemAdd    Kind = 5 // Watch add item event.
	Kind_EventItemUpdate Kind = 6 // Watch update item event.
	Kind_EventItemDelete Kind = 7 // Watch delete item event.
	Kind_EventError      Kind = 8 // Watch error which means that watch is invalid.
)

func (Kind) Descriptor

func (Kind) Descriptor() protoreflect.EnumDescriptor

func (Kind) Enum

func (x Kind) Enum() *Kind

func (Kind) EnumDescriptor deprecated

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

Deprecated: Use Kind.Descriptor instead.

func (Kind) Number

func (x Kind) Number() protoreflect.EnumNumber

func (Kind) String

func (x Kind) String() string

func (Kind) Type

func (Kind) Type() protoreflect.EnumType

type Message

type Message struct {
	Kind     Kind      `protobuf:"varint,1,opt,name=kind,proto3,enum=socket.Kind" json:"kind,omitempty"`
	Metadata *Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// Spec can vary on the message kind.
	// Can either have some specific data for the kind or be empty.
	Spec string `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"`
	// contains filtered or unexported fields
}

Web socket message.

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetKind

func (x *Message) GetKind() Kind

func (*Message) GetMetadata

func (x *Message) GetMetadata() *Metadata

func (*Message) GetSpec

func (x *Message) GetSpec() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

func (*Message) UnmarshalSpec

func (x *Message) UnmarshalSpec(dest interface{}) error

UnmarshalSpec decode spec into a go struct.

type Metadata

type Metadata struct {

	// Uid match/route identifier.
	Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	// contains filtered or unexported fields
}

Message metadata which helps matching request vs response and routing to any specific subscription.

func (*Metadata) Descriptor deprecated

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

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) GetUid

func (x *Metadata) GetUid() string

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect

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

func (*Metadata) Reset

func (x *Metadata) Reset()

func (*Metadata) String

func (x *Metadata) String() string

type SubscribedSpec

type SubscribedSpec struct {

	// Subscription uid generated for the subscription.
	Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	// contains filtered or unexported fields
}

Watch response.

func (*SubscribedSpec) Descriptor deprecated

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

Deprecated: Use SubscribedSpec.ProtoReflect.Descriptor instead.

func (*SubscribedSpec) GetUid

func (x *SubscribedSpec) GetUid() string

func (*SubscribedSpec) ProtoMessage

func (*SubscribedSpec) ProtoMessage()

func (*SubscribedSpec) ProtoReflect

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

func (*SubscribedSpec) Reset

func (x *SubscribedSpec) Reset()

func (*SubscribedSpec) String

func (x *SubscribedSpec) String() string

type UnsubscribeSpec

type UnsubscribeSpec struct {

	// Subscription to destroy.
	Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
	// contains filtered or unexported fields
}

Unsubscribe request.

func (*UnsubscribeSpec) Descriptor deprecated

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

Deprecated: Use UnsubscribeSpec.ProtoReflect.Descriptor instead.

func (*UnsubscribeSpec) GetUid

func (x *UnsubscribeSpec) GetUid() string

func (*UnsubscribeSpec) ProtoMessage

func (*UnsubscribeSpec) ProtoMessage()

func (*UnsubscribeSpec) ProtoReflect

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

func (*UnsubscribeSpec) Reset

func (x *UnsubscribeSpec) Reset()

func (*UnsubscribeSpec) String

func (x *UnsubscribeSpec) String() string

type WatchSpec

type WatchSpec struct {

	// Resource name to watch.
	Resource *resource.WatchRequest `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	// Source to get the watch data from.
	Source common.Runtime `protobuf:"varint,2,opt,name=source,proto3,enum=common.Runtime" json:"source,omitempty"`
	// Context settings to fetch the data from.
	Context *common.Context `protobuf:"bytes,3,opt,name=context,proto3" json:"context,omitempty"`
	// Selector represents watch label selector.
	Selector string `protobuf:"bytes,4,opt,name=selector,proto3" json:"selector,omitempty"`
	// contains filtered or unexported fields
}

func (*WatchSpec) Descriptor deprecated

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

Deprecated: Use WatchSpec.ProtoReflect.Descriptor instead.

func (*WatchSpec) GetContext

func (x *WatchSpec) GetContext() *common.Context

func (*WatchSpec) GetResource

func (x *WatchSpec) GetResource() *resource.WatchRequest

func (*WatchSpec) GetSelector

func (x *WatchSpec) GetSelector() string

func (*WatchSpec) GetSource

func (x *WatchSpec) GetSource() common.Runtime

func (*WatchSpec) ProtoMessage

func (*WatchSpec) ProtoMessage()

func (*WatchSpec) ProtoReflect

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

func (*WatchSpec) Reset

func (x *WatchSpec) Reset()

func (*WatchSpec) String

func (x *WatchSpec) String() string

Jump to

Keyboard shortcuts

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