grpc

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// SpecTopic is a pubsub topic for resource spec.
	SpecTopic = "sources/+/clusters/+/spec"

	// StatusTopic is a pubsub topic for resource status.
	StatusTopic = "sources/+/clusters/+/status"

	// SpecResyncTopic is a pubsub topic for resource spec resync.
	SpecResyncTopic = "sources/clusters/+/specresync"

	// StatusResyncTopic is a pubsub topic for resource status resync.
	StatusResyncTopic = "sources/+/clusters/statusresync"
)

Variables

This section is empty.

Functions

func NewAgentOptions

func NewAgentOptions(grpcOptions *GRPCOptions, clusterName, agentID string) *options.CloudEventsAgentOptions

func NewSourceOptions

func NewSourceOptions(gRPCOptions *GRPCOptions, sourceID string) *options.CloudEventsSourceOptions

Types

type GRPCConfig

type GRPCConfig struct {
	// URL is the address of the gRPC server (host:port).
	URL string `json:"url" yaml:"url"`
	// CAFile is the file path to a cert file for the gRPC server certificate authority.
	CAFile string `json:"caFile,omitempty" yaml:"caFile,omitempty"`
	// ClientCertFile is the file path to a client cert file for TLS.
	ClientCertFile string `json:"clientCertFile,omitempty" yaml:"clientCertFile,omitempty"`
	// ClientKeyFile is the file path to a client key file for TLS.
	ClientKeyFile string `json:"clientKeyFile,omitempty" yaml:"clientKeyFile,omitempty"`
}

GRPCConfig holds the information needed to build connect to gRPC server as a given user.

type GRPCOptions

type GRPCOptions struct {
	URL            string
	CAFile         string
	ClientCertFile string
	ClientKeyFile  string
}

GRPCOptions holds the options that are used to build gRPC client.

func BuildGRPCOptionsFromFlags

func BuildGRPCOptionsFromFlags(configPath string) (*GRPCOptions, error)

BuildGRPCOptionsFromFlags builds configs from a config filepath.

func NewGRPCOptions

func NewGRPCOptions() *GRPCOptions

func (*GRPCOptions) GetCloudEventsClient

func (o *GRPCOptions) GetCloudEventsClient(ctx context.Context, clientOpts ...protocol.Option) (cloudevents.Client, error)

func (*GRPCOptions) GetGRPCClientConn

func (o *GRPCOptions) GetGRPCClientConn() (*grpc.ClientConn, error)

Directories

Path Synopsis
protobuf
v1

Jump to

Keyboard shortcuts

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