peer

package
v1.11.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 9 Imported by: 9

Documentation

Index

Constants

This section is empty.

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