connect

package
v0.0.0-...-cbf242d Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Connect_Subscribe_FullMethodName = "/pomerium.zero.Connect/Subscribe"
)

Variables

View Source
var Connect_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pomerium.zero.Connect",
	HandlerType: (*ConnectServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _Connect_Subscribe_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "connect/connect.proto",
}

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

View Source
var File_connect_connect_proto protoreflect.FileDescriptor

Functions

func RegisterConnectServer

func RegisterConnectServer(s grpc.ServiceRegistrar, srv ConnectServer)

Types

type BootstrapConfigUpdated

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

BootstrapConfigUpdated is sent when the bootstrap configuration has been updated. Bootstrap configuration is received via cluster API directly, and does not involve long running operations to construct it, like with a regular config.

func (*BootstrapConfigUpdated) Descriptor deprecated

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

Deprecated: Use BootstrapConfigUpdated.ProtoReflect.Descriptor instead.

func (*BootstrapConfigUpdated) ProtoMessage

func (*BootstrapConfigUpdated) ProtoMessage()

func (*BootstrapConfigUpdated) ProtoReflect

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

func (*BootstrapConfigUpdated) Reset

func (x *BootstrapConfigUpdated) Reset()

func (*BootstrapConfigUpdated) String

func (x *BootstrapConfigUpdated) String() string

type Config

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

func NewConfig

func NewConfig(endpoint string) (*Config, error)

NewConfig returns a new Config from an endpoint string, that has to be in a URL format. The endpoint can be either http:// or https:// that will be used to determine whether TLS should be used. if port is not specified, it will be inferred from the scheme (80 for http, 443 for https).

func (*Config) GetConnectionURI

func (c *Config) GetConnectionURI() string

GetConnectionURI returns connection string conforming to https://github.com/grpc/grpc/blob/master/doc/naming.md

func (*Config) GetDialOptions

func (c *Config) GetDialOptions() []grpc.DialOption

func (*Config) GetDialTimeout

func (c *Config) GetDialTimeout() time.Duration

GetDialTimeout returns the timeout for the dial operation

func (*Config) RequireTLS

func (c *Config) RequireTLS() bool

type ConfigUpdated

type ConfigUpdated struct {

	// version of the configuration changeset
	ChangesetVersion int64 `protobuf:"varint,1,opt,name=changeset_version,json=changesetVersion,proto3" json:"changeset_version,omitempty"`
	// contains filtered or unexported fields
}

ConfigUpdated is sent when the configuration has been updated for the connected Pomerium Core deployment

func (*ConfigUpdated) Descriptor deprecated

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

Deprecated: Use ConfigUpdated.ProtoReflect.Descriptor instead.

func (*ConfigUpdated) GetChangesetVersion

func (x *ConfigUpdated) GetChangesetVersion() int64

func (*ConfigUpdated) ProtoMessage

func (*ConfigUpdated) ProtoMessage()

func (*ConfigUpdated) ProtoReflect

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

func (*ConfigUpdated) Reset

func (x *ConfigUpdated) Reset()

func (*ConfigUpdated) String

func (x *ConfigUpdated) String() string

type ConnectClient

type ConnectClient interface {
	// Subscribe is used to send a stream of messages from the Zero Cloud to the
	// Pomerium Core in managed mode.
	Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Connect_SubscribeClient, error)
}

ConnectClient is the client API for Connect 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 NewAuthorizedConnectClient

func NewAuthorizedConnectClient(
	ctx context.Context,
	endpoint string,
	tokenProvider TokenProviderFn,
) (ConnectClient, error)

func NewConnectClient

func NewConnectClient(cc grpc.ClientConnInterface) ConnectClient

type ConnectServer

type ConnectServer interface {
	// Subscribe is used to send a stream of messages from the Zero Cloud to the
	// Pomerium Core in managed mode.
	Subscribe(*SubscribeRequest, Connect_SubscribeServer) error
}

ConnectServer is the server API for Connect service. All implementations should embed UnimplementedConnectServer for forward compatibility

type Connect_SubscribeClient

type Connect_SubscribeClient interface {
	Recv() (*Message, error)
	grpc.ClientStream
}

type Connect_SubscribeServer

type Connect_SubscribeServer interface {
	Send(*Message) error
	grpc.ServerStream
}

type Message

type Message struct {

	// Types that are assignable to Message:
	//
	//	*Message_ConfigUpdated
	//	*Message_BootstrapConfigUpdated
	Message isMessage_Message `protobuf_oneof:"message"`
	// contains filtered or unexported fields
}

Message is an aggregate of all possible messages that can be sent from the cloud to the core in managed mode.

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetBootstrapConfigUpdated

func (x *Message) GetBootstrapConfigUpdated() *BootstrapConfigUpdated

func (*Message) GetConfigUpdated

func (x *Message) GetConfigUpdated() *ConfigUpdated

func (*Message) GetMessage

func (m *Message) GetMessage() isMessage_Message

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

type Message_BootstrapConfigUpdated

type Message_BootstrapConfigUpdated struct {
	BootstrapConfigUpdated *BootstrapConfigUpdated `protobuf:"bytes,2,opt,name=bootstrap_config_updated,json=bootstrapConfigUpdated,proto3,oneof"`
}

type Message_ConfigUpdated

type Message_ConfigUpdated struct {
	ConfigUpdated *ConfigUpdated `protobuf:"bytes,1,opt,name=config_updated,json=configUpdated,proto3,oneof"`
}

type SubscribeRequest

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

SubscribeRequest is used to subscribe to a stream of messages from the Zero Cloud to the Pomerium Core.

The Authorization: Bearer header must contain a valid token, that belongs to a cluster identity with appropriate claims set.

func (*SubscribeRequest) Descriptor deprecated

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

Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) ProtoReflect

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

func (*SubscribeRequest) Reset

func (x *SubscribeRequest) Reset()

func (*SubscribeRequest) String

func (x *SubscribeRequest) String() string

type TokenProviderFn

type TokenProviderFn func(ctx context.Context, minTTL time.Duration) (string, error)

TokenProviderFn is a function that returns a token that is expected to be valid for at least minTTL

type UnimplementedConnectServer

type UnimplementedConnectServer struct {
}

UnimplementedConnectServer should be embedded to have forward compatible implementations.

func (UnimplementedConnectServer) Subscribe

type UnsafeConnectServer

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

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

Jump to

Keyboard shortcuts

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