meshbridge

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package meshbridge contains a wrapper interface for running multiple mesh connections in parallel and sharing routes between them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge interface {
	// Start starts the bridge. This opens all meshes and services.
	Start(ctx context.Context) error
	// Stop stops the bridge. This closes all meshes and services.
	Stop(ctx context.Context) error
	// ServeError returns a channel that will receive an error if any gRPC server
	// fails.
	ServeError() <-chan error
	// Resolver returns a net.Resolver that can be used to resolve DNS names.
	// If the meshdns server is not enabled, this returns the system resolver.
	Resolver() *net.Resolver
	// Mesh returns the mesh with the given ID. If ID is an invalid mesh ID,
	// nil is returned.
	Mesh(id string) mesh.Mesh
}

Bridge is the interface for a mesh bridge. It manages multiple mesh connections and services, sharing routes between them.

func New

func New(opts *Options) (Bridge, error)

New creates a new bridge.

type MeshOptions

type MeshOptions struct {
	// Mesh are the options for the mesh to connect to.
	Mesh *mesh.Options `json:",inline" yaml:",inline" toml:",inline" mapstructure:",squash"`
	// Services are the options for services to run and/or advertise.
	Services *services.Options `yaml:"services,omitempty" json:"services,omitempty" toml:"services,omitempty" mapstructure:"services,omitempty"`
}

MeshOptions are options for a mesh connection.

func (*MeshOptions) BindFlags

func (o *MeshOptions) BindFlags(fs *flag.FlagSet, ifaceName string, prefix ...string)

BindFlags binds the options to the given flagset.

func (*MeshOptions) DeepCopy added in v0.1.13

func (o *MeshOptions) DeepCopy() *MeshOptions

DeepCopy returns a deep copy of the options.

func (*MeshOptions) Validate

func (o *MeshOptions) Validate() error

Validate validates the options.

type Options

type Options struct {
	// Meshes are the meshes to bridge.
	Meshes map[string]*MeshOptions `json:",inline" yaml:",inline" toml:",inline" mapstructure:",squash"`
	// MeshDNS are options for running a meshdns server bridging all meshes.
	MeshDNS *services.MeshDNSOptions `json:"meshdns,omitempty" yaml:"meshdns,omitempty" toml:"meshdns,omitempty" mapstructure:"meshdns,omitempty"`
	// UseMeshDNS is true if the bridge should use the meshdns server.
	UseMeshDNS bool `json:"use-meshdns,omitempty" yaml:"use-meshdns,omitempty" toml:"use-meshdns,omitempty" mapstructure:"use-meshdns,omitempty"`
}

Options are options for the bridge.

func NewOptions

func NewOptions() *Options

NewOptions returns new options.

func (*Options) BindFlags

func (o *Options) BindFlags(fs *flag.FlagSet)

BindFlags binds the options to the given flagset.

func (*Options) DeepCopy added in v0.1.13

func (o *Options) DeepCopy() *Options

DeepCopy returns a deep copy of the options.

func (*Options) Validate

func (o *Options) Validate() error

Validate validates the options.

Jump to

Keyboard shortcuts

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