peer

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 9

README

Protocol Documentation

Table of Contents

Top

peer/peer.proto

ChangeNotification

ChangeNotification indicates a change regarding a hubble peer.

Field Type Label Description
name string Name is the name of the peer, typically the hostname. The name includes the cluster name if a value other than default has been specified. This value can be used to uniquely identify the host. When the cluster name is not the default, the cluster name is prepended to the peer name and a forward slash is added.

Examples: - runtime1 - testcluster/runtime1 | | address | string | | Address is the address of the peer's gRPC service. | | type | ChangeNotificationType | | ChangeNotificationType indicates the type of change, ie whether the peer was added, deleted or updated. | | tls | TLS | | TLS provides information to connect to the Address with TLS enabled. If not set, TLS shall be assumed to be disabled. |

NotifyRequest

TLS

TLS provides information to establish a TLS connection to the peer.

Field Type Label Description
server_name string ServerName is used to verify the hostname on the returned certificate.

ChangeNotificationType

ChangeNotificationType defines the peer change notification type.

Name Number Description
UNKNOWN 0
PEER_ADDED 1
PEER_DELETED 2
PEER_UPDATED 3

Peer

Peer lists hubble peers and notifies of changes.

Method Name Request Type Response Type Description
Notify NotifyRequest ChangeNotification stream Notify sends information about hubble peers in the cluster. When Notify is called, it sends information about all the peers that are already part of the cluster (with the type as PEER_ADDED). It subsequently notifies of any change.

Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)

Documentation

Index

Constants

View Source
const (
	Peer_Notify_FullMethodName = "/peer.Peer/Notify"
)

Variables

View Source
var (
	ChangeNotificationType_name = map[int32]string{
		0: "UNKNOWN",
		1: "PEER_ADDED",
		2: "PEER_DELETED",
		3: "PEER_UPDATED",
	}
	ChangeNotificationType_value = map[string]int32{
		"UNKNOWN":      0,
		"PEER_ADDED":   1,
		"PEER_DELETED": 2,
		"PEER_UPDATED": 3,
	}
)

Enum value maps for ChangeNotificationType.

View Source
var File_peer_peer_proto protoreflect.FileDescriptor
View Source
var Peer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "peer.Peer",
	HandlerType: (*PeerServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Notify",
			Handler:       _Peer_Notify_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "peer/peer.proto",
}

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

Functions

func RegisterPeerServer

func RegisterPeerServer(s grpc.ServiceRegistrar, srv PeerServer)

Types

type ChangeNotification

type ChangeNotification struct {

	// Name is the name of the peer, typically the hostname. The name includes
	// the cluster name if a value other than default has been specified.
	// This value can be used to uniquely identify the host.
	// When the cluster name is not the default, the cluster name is prepended
	// to the peer name and a forward slash is added.
	//
	// Examples:
	//   - runtime1
	//   - testcluster/runtime1
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Address is the address of the peer's gRPC service.
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// ChangeNotificationType indicates the type of change, ie whether the peer
	// was added, deleted or updated.
	Type ChangeNotificationType `protobuf:"varint,3,opt,name=type,proto3,enum=peer.ChangeNotificationType" json:"type,omitempty"`
	// TLS provides information to connect to the Address with TLS enabled.
	// If not set, TLS shall be assumed to be disabled.
	Tls *TLS `protobuf:"bytes,4,opt,name=tls,proto3" json:"tls,omitempty"`
	// contains filtered or unexported fields
}

ChangeNotification indicates a change regarding a hubble peer.

func (*ChangeNotification) Descriptor deprecated

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

Deprecated: Use ChangeNotification.ProtoReflect.Descriptor instead.

func (*ChangeNotification) GetAddress

func (x *ChangeNotification) GetAddress() string

func (*ChangeNotification) GetName

func (x *ChangeNotification) GetName() string

func (*ChangeNotification) GetTls

func (x *ChangeNotification) GetTls() *TLS

func (*ChangeNotification) GetType

func (*ChangeNotification) MarshalJSON

func (msg *ChangeNotification) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*ChangeNotification) ProtoMessage

func (*ChangeNotification) ProtoMessage()

func (*ChangeNotification) ProtoReflect

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

func (*ChangeNotification) Reset

func (x *ChangeNotification) Reset()

func (*ChangeNotification) String

func (x *ChangeNotification) String() string

func (*ChangeNotification) UnmarshalJSON

func (msg *ChangeNotification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type ChangeNotificationType

type ChangeNotificationType int32

ChangeNotificationType defines the peer change notification type.

const (
	ChangeNotificationType_UNKNOWN      ChangeNotificationType = 0
	ChangeNotificationType_PEER_ADDED   ChangeNotificationType = 1
	ChangeNotificationType_PEER_DELETED ChangeNotificationType = 2
	ChangeNotificationType_PEER_UPDATED ChangeNotificationType = 3
)

func (ChangeNotificationType) Descriptor

func (ChangeNotificationType) Enum

func (ChangeNotificationType) EnumDescriptor deprecated

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

Deprecated: Use ChangeNotificationType.Descriptor instead.

func (ChangeNotificationType) Number

func (ChangeNotificationType) String

func (x ChangeNotificationType) String() string

func (ChangeNotificationType) Type

type NotifyRequest

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

func (*NotifyRequest) Descriptor deprecated

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

Deprecated: Use NotifyRequest.ProtoReflect.Descriptor instead.

func (*NotifyRequest) MarshalJSON

func (msg *NotifyRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*NotifyRequest) ProtoMessage

func (*NotifyRequest) ProtoMessage()

func (*NotifyRequest) ProtoReflect

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

func (*NotifyRequest) Reset

func (x *NotifyRequest) Reset()

func (*NotifyRequest) String

func (x *NotifyRequest) String() string

func (*NotifyRequest) UnmarshalJSON

func (msg *NotifyRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type PeerClient

type PeerClient interface {
	// Notify sends information about hubble peers in the cluster.
	// When Notify is called, it sends information about all the peers that are
	// already part of the cluster (with the type as PEER_ADDED). It
	// subsequently notifies of any change.
	Notify(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (Peer_NotifyClient, error)
}

PeerClient is the client API for Peer 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 NewPeerClient

func NewPeerClient(cc grpc.ClientConnInterface) PeerClient

type PeerServer

type PeerServer interface {
	// Notify sends information about hubble peers in the cluster.
	// When Notify is called, it sends information about all the peers that are
	// already part of the cluster (with the type as PEER_ADDED). It
	// subsequently notifies of any change.
	Notify(*NotifyRequest, Peer_NotifyServer) error
}

PeerServer is the server API for Peer service. All implementations should embed UnimplementedPeerServer for forward compatibility

type Peer_NotifyClient

type Peer_NotifyClient interface {
	Recv() (*ChangeNotification, error)
	grpc.ClientStream
}

type Peer_NotifyServer

type Peer_NotifyServer interface {
	Send(*ChangeNotification) error
	grpc.ServerStream
}

type TLS

type TLS struct {

	// ServerName is used to verify the hostname on the returned certificate.
	ServerName string `protobuf:"bytes,1,opt,name=server_name,json=serverName,proto3" json:"server_name,omitempty"`
	// contains filtered or unexported fields
}

TLS provides information to establish a TLS connection to the peer.

func (*TLS) Descriptor deprecated

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

Deprecated: Use TLS.ProtoReflect.Descriptor instead.

func (*TLS) GetServerName

func (x *TLS) GetServerName() string

func (*TLS) MarshalJSON

func (msg *TLS) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*TLS) ProtoMessage

func (*TLS) ProtoMessage()

func (*TLS) ProtoReflect

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

func (*TLS) Reset

func (x *TLS) Reset()

func (*TLS) String

func (x *TLS) String() string

func (*TLS) UnmarshalJSON

func (msg *TLS) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type UnimplementedPeerServer

type UnimplementedPeerServer struct {
}

UnimplementedPeerServer should be embedded to have forward compatible implementations.

func (UnimplementedPeerServer) Notify

type UnsafePeerServer

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

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

Jump to

Keyboard shortcuts

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