connection

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: Apache-2.0 Imports: 11 Imported by: 14

Documentation

Overview

Package connection contains the API and helpers for the Network Service Mesh Connection

Index

Constants

View Source
const (
	// Workspace - NSM workspace location mechanism property key
	Workspace = "workspace"
	// PodNameKey - pod name a container is running in
	PodNameKey = "podName"
	// NamespaceKey - namespace a container is running in
	NamespaceKey = "namespace"
)

Variables

View Source
var ConnectionEventType_name = map[int32]string{
	0: "INITIAL_STATE_TRANSFER",
	1: "UPDATE",
	2: "DELETE",
}
View Source
var ConnectionEventType_value = map[string]int32{
	"INITIAL_STATE_TRANSFER": 0,
	"UPDATE":                 1,
	"DELETE":                 2,
}
View Source
var State_name = map[int32]string{
	0: "UP",
	1: "DOWN",
}
View Source
var State_value = map[string]int32{
	"UP":   0,
	"DOWN": 1,
}

Functions

func AddMechanism

func AddMechanism(mtype string, validator func(*Mechanism) error)

AddMechanism adds a Mechanism

func FilterMapOnManagerScopeSelector

func FilterMapOnManagerScopeSelector(c map[string]*Connection, selector *MonitorScopeSelector) map[string]*Connection

func RegisterMonitorConnectionServer

func RegisterMonitorConnectionServer(s *grpc.Server, srv MonitorConnectionServer)

Types

type Connection

type Connection struct {
	Id                         string                               `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	NetworkService             string                               `protobuf:"bytes,2,opt,name=network_service,json=networkService,proto3" json:"network_service,omitempty"`
	Mechanism                  *Mechanism                           `protobuf:"bytes,3,opt,name=mechanism,proto3" json:"mechanism,omitempty"`
	Context                    *connectioncontext.ConnectionContext `protobuf:"bytes,4,opt,name=context,proto3" json:"context,omitempty"`
	Labels                     map[string]string                    `` /* 153-byte string literal not displayed */
	Path                       *Path                                `protobuf:"bytes,6,opt,name=path,proto3" json:"path,omitempty"`
	NetworkServiceEndpointName string                               `` /* 143-byte string literal not displayed */
	State                      State                                `protobuf:"varint,9,opt,name=state,proto3,enum=connection.State" json:"state,omitempty"`
	XXX_NoUnkeyedLiteral       struct{}                             `json:"-"`
	XXX_unrecognized           []byte                               `json:"-"`
	XXX_sizecache              int32                                `json:"-"`
}

func (*Connection) Clone

func (c *Connection) Clone() *Connection

Clone clones connection

func (*Connection) Descriptor

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

func (*Connection) Equals

func (c *Connection) Equals(connection *Connection) bool

Equals returns if connection equals given connection

func (*Connection) GetContext

func (*Connection) GetDestinationNetworkServiceManagerName

func (c *Connection) GetDestinationNetworkServiceManagerName() string

GetDestinationNetworkServiceManagerName - return destination network service manager name

func (*Connection) GetId

func (m *Connection) GetId() string

func (*Connection) GetLabels

func (m *Connection) GetLabels() map[string]string

func (*Connection) GetMechanism

func (m *Connection) GetMechanism() *Mechanism

func (*Connection) GetNetworkService

func (m *Connection) GetNetworkService() string

func (*Connection) GetNetworkServiceEndpointName

func (m *Connection) GetNetworkServiceEndpointName() string

func (*Connection) GetPath

func (m *Connection) GetPath() *Path

func (*Connection) GetSourceNetworkServiceManagerName

func (c *Connection) GetSourceNetworkServiceManagerName() string

GetSourceNetworkServiceManagerName - return source network service manager name

func (*Connection) GetState

func (m *Connection) GetState() State

func (*Connection) IsComplete

func (c *Connection) IsComplete() error

IsComplete checks if connection is complete valid

func (*Connection) IsRemote

func (c *Connection) IsRemote() bool

IsRemote returns if connection is remote

func (*Connection) IsValid

func (c *Connection) IsValid() error

IsValid checks if connection is minimally valid

func (*Connection) MatchesMonitorScopeSelector

func (c *Connection) MatchesMonitorScopeSelector(selector *MonitorScopeSelector) bool

func (*Connection) ProtoMessage

func (*Connection) ProtoMessage()

func (*Connection) Reset

func (m *Connection) Reset()

func (*Connection) String

func (m *Connection) String() string

func (*Connection) UpdateContext

func (c *Connection) UpdateContext(context *connectioncontext.ConnectionContext) error

UpdateContext checks and tries to set connection context

func (*Connection) XXX_DiscardUnknown

func (m *Connection) XXX_DiscardUnknown()

func (*Connection) XXX_Marshal

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

func (*Connection) XXX_Merge

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

func (*Connection) XXX_Size

func (m *Connection) XXX_Size() int

func (*Connection) XXX_Unmarshal

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

type ConnectionEvent

type ConnectionEvent struct {
	Type                 ConnectionEventType    `protobuf:"varint,1,opt,name=type,proto3,enum=connection.ConnectionEventType" json:"type,omitempty"`
	Connections          map[string]*Connection `` /* 163-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

func (*ConnectionEvent) Descriptor

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

func (*ConnectionEvent) GetConnections

func (m *ConnectionEvent) GetConnections() map[string]*Connection

func (*ConnectionEvent) GetType

func (m *ConnectionEvent) GetType() ConnectionEventType

func (*ConnectionEvent) ProtoMessage

func (*ConnectionEvent) ProtoMessage()

func (*ConnectionEvent) Reset

func (m *ConnectionEvent) Reset()

func (*ConnectionEvent) String

func (m *ConnectionEvent) String() string

func (*ConnectionEvent) XXX_DiscardUnknown

func (m *ConnectionEvent) XXX_DiscardUnknown()

func (*ConnectionEvent) XXX_Marshal

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

func (*ConnectionEvent) XXX_Merge

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

func (*ConnectionEvent) XXX_Size

func (m *ConnectionEvent) XXX_Size() int

func (*ConnectionEvent) XXX_Unmarshal

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

type ConnectionEventType

type ConnectionEventType int32
const (
	ConnectionEventType_INITIAL_STATE_TRANSFER ConnectionEventType = 0
	ConnectionEventType_UPDATE                 ConnectionEventType = 1
	ConnectionEventType_DELETE                 ConnectionEventType = 2
)

func (ConnectionEventType) EnumDescriptor

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

func (ConnectionEventType) String

func (x ConnectionEventType) String() string

type Mechanism

type Mechanism struct {
	Cls                  string            `protobuf:"bytes,1,opt,name=cls,proto3" json:"cls,omitempty"`
	Type                 string            `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Parameters           map[string]string `` /* 161-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*Mechanism) Clone

func (m *Mechanism) Clone() *Mechanism

Clone clones mechanism

func (*Mechanism) Descriptor

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

func (*Mechanism) Equals

func (m *Mechanism) Equals(mechanism *Mechanism) bool

Equals returns if mechanism equals given mechanism

func (*Mechanism) GetCls

func (m *Mechanism) GetCls() string

func (*Mechanism) GetParameters

func (m *Mechanism) GetParameters() map[string]string

func (*Mechanism) GetType

func (m *Mechanism) GetType() string

func (*Mechanism) IsValid

func (m *Mechanism) IsValid() error

IsValid - is the Mechanism Valid?

func (*Mechanism) ProtoMessage

func (*Mechanism) ProtoMessage()

func (*Mechanism) Reset

func (m *Mechanism) Reset()

func (*Mechanism) String

func (m *Mechanism) String() string

func (*Mechanism) XXX_DiscardUnknown

func (m *Mechanism) XXX_DiscardUnknown()

func (*Mechanism) XXX_Marshal

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

func (*Mechanism) XXX_Merge

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

func (*Mechanism) XXX_Size

func (m *Mechanism) XXX_Size() int

func (*Mechanism) XXX_Unmarshal

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

type MonitorConnectionClient

type MonitorConnectionClient interface {
	MonitorConnections(ctx context.Context, in *MonitorScopeSelector, opts ...grpc.CallOption) (MonitorConnection_MonitorConnectionsClient, error)
}

MonitorConnectionClient is the client API for MonitorConnection service.

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

type MonitorConnectionServer

type MonitorConnectionServer interface {
	MonitorConnections(*MonitorScopeSelector, MonitorConnection_MonitorConnectionsServer) error
}

MonitorConnectionServer is the server API for MonitorConnection service.

type MonitorConnection_MonitorConnectionsClient

type MonitorConnection_MonitorConnectionsClient interface {
	Recv() (*ConnectionEvent, error)
	grpc.ClientStream
}

type MonitorConnection_MonitorConnectionsServer

type MonitorConnection_MonitorConnectionsServer interface {
	Send(*ConnectionEvent) error
	grpc.ServerStream
}

type MonitorScopeSelector

type MonitorScopeSelector struct {
	PathSegments         []*PathSegment `protobuf:"bytes,1,rep,name=path_segments,json=pathSegments,proto3" json:"path_segments,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*MonitorScopeSelector) Descriptor

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

func (*MonitorScopeSelector) GetPathSegments

func (m *MonitorScopeSelector) GetPathSegments() []*PathSegment

func (*MonitorScopeSelector) ProtoMessage

func (*MonitorScopeSelector) ProtoMessage()

func (*MonitorScopeSelector) Reset

func (m *MonitorScopeSelector) Reset()

func (*MonitorScopeSelector) String

func (m *MonitorScopeSelector) String() string

func (*MonitorScopeSelector) XXX_DiscardUnknown

func (m *MonitorScopeSelector) XXX_DiscardUnknown()

func (*MonitorScopeSelector) XXX_Marshal

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

func (*MonitorScopeSelector) XXX_Merge

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

func (*MonitorScopeSelector) XXX_Size

func (m *MonitorScopeSelector) XXX_Size() int

func (*MonitorScopeSelector) XXX_Unmarshal

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

type Path

type Path struct {
	Index                uint32         `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	PathSegments         []*PathSegment `protobuf:"bytes,2,rep,name=path_segments,json=pathSegments,proto3" json:"path_segments,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*Path) Clone

func (m *Path) Clone() *Path

Clone clones connection

func (*Path) Descriptor

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

func (*Path) GetIndex

func (m *Path) GetIndex() uint32

func (*Path) GetPathSegments

func (m *Path) GetPathSegments() []*PathSegment

func (*Path) IsValid

func (m *Path) IsValid() error

IsValid returns true if Path p is Valid

func (*Path) ProtoMessage

func (*Path) ProtoMessage()

func (*Path) Reset

func (m *Path) Reset()

func (*Path) String

func (m *Path) String() string

func (*Path) XXX_DiscardUnknown

func (m *Path) XXX_DiscardUnknown()

func (*Path) XXX_Marshal

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

func (*Path) XXX_Merge

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

func (*Path) XXX_Size

func (m *Path) XXX_Size() int

func (*Path) XXX_Unmarshal

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

type PathSegment

type PathSegment struct {
	Name                 string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Id                   string               `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	Token                string               `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	Expires              *timestamp.Timestamp `protobuf:"bytes,4,opt,name=expires,proto3" json:"expires,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*PathSegment) Descriptor

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

func (*PathSegment) GetExpires

func (m *PathSegment) GetExpires() *timestamp.Timestamp

func (*PathSegment) GetId

func (m *PathSegment) GetId() string

func (*PathSegment) GetName

func (m *PathSegment) GetName() string

func (*PathSegment) GetToken

func (m *PathSegment) GetToken() string

func (*PathSegment) ProtoMessage

func (*PathSegment) ProtoMessage()

func (*PathSegment) Reset

func (m *PathSegment) Reset()

func (*PathSegment) String

func (m *PathSegment) String() string

func (*PathSegment) XXX_DiscardUnknown

func (m *PathSegment) XXX_DiscardUnknown()

func (*PathSegment) XXX_Marshal

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

func (*PathSegment) XXX_Merge

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

func (*PathSegment) XXX_Size

func (m *PathSegment) XXX_Size() int

func (*PathSegment) XXX_Unmarshal

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

type State

type State int32
const (
	State_UP   State = 0
	State_DOWN State = 1
)

func (State) EnumDescriptor

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

func (State) String

func (x State) String() string

type UnimplementedMonitorConnectionServer

type UnimplementedMonitorConnectionServer struct {
}

UnimplementedMonitorConnectionServer can be embedded to have forward compatible implementations.

func (*UnimplementedMonitorConnectionServer) MonitorConnections

Directories

Path Synopsis
mechanisms
cls
kernel
Package kernel - describe kernel mechanism
Package kernel - describe kernel mechanism
srv6
Package srv6 - parameters keys of SRV6 remote mechanism
Package srv6 - parameters keys of SRV6 remote mechanism
wireguard
Package wireguard - constants and helper methods for Wireguard remote mechanism
Package wireguard - constants and helper methods for Wireguard remote mechanism

Jump to

Keyboard shortcuts

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