types

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection added in v1.2.1

type Connection struct {
	Connection *opts.ConnectionOptions
}

Connection is a convenience struct wrapping opts.ConnectionOptions so we can marshal Config to JSON. The Marshaler methods are implemented to return a string of protobuf bytes because protobuf oneof's cannot be unmarshalled correctly by json.Unmarshal()

func (*Connection) MarshalJSON added in v1.2.1

func (c *Connection) MarshalJSON() ([]byte, error)

func (*Connection) UnmarshalJSON added in v1.2.1

func (c *Connection) UnmarshalJSON(v []byte) error

UnmarshalJSON unmarshals JSON into a connection struct

type Relay

type Relay struct {
	Active     bool               `json:"-"`
	Id         string             `json:"-"`
	CancelCtx  context.Context    `json:"-"`
	CancelFunc context.CancelFunc `json:"-"`
	RelayCh    chan interface{}   `json:"-"`
	Backend    backends.Backend   `json:"-"`
	Options    *opts.RelayOptions `json:"config"`
	// contains filtered or unexported fields
}

func (*Relay) MarshalJSON added in v1.2.1

func (r *Relay) MarshalJSON() ([]byte, error)

MarshalJSON marshals a tunnel to JSON

func (*Relay) StartRelay

func (r *Relay) StartRelay(delay time.Duration) error

StartRelay starts a configured relay, it's workers, and the GRPC workers; StartRelay will block for "delay" duration, waiting for errors.

func (*Relay) UnmarshalJSON added in v1.2.1

func (r *Relay) UnmarshalJSON(v []byte) error

UnmarshalJSON unmarshals JSON into a tunnel struct

type Tunnel added in v1.4.0

type Tunnel struct {
	Active           bool                `json:"-"`
	Id               string              `json:"-"`
	CancelCtx        context.Context     `json:"-"`
	CancelFunc       context.CancelFunc  `json:"-"`
	Backend          backends.Backend    `json:"-"`
	Options          *opts.TunnelOptions `json:"config"`
	TunnelService    tunnel.ITunnel
	PlumberClusterID string `json:"-"`
	PlumberID        string `json:"-"`
	PlumberVersion   string `json:"-"`
	// contains filtered or unexported fields
}

func (*Tunnel) Close added in v1.4.0

func (d *Tunnel) Close()

func (*Tunnel) MarshalJSON added in v1.4.0

func (d *Tunnel) MarshalJSON() ([]byte, error)

MarshalJSON marshals a tunnel to JSON

func (*Tunnel) StartTunnel added in v1.4.0

func (d *Tunnel) StartTunnel(delay time.Duration) error

StartTunnel will attempt to start the replay tunnel. Upon the start, it will wait for the given "delay" listening for errors. It will return an error if it encounters any errors on the ErrorChan or if the Tunnel call fails.

Subsequent failures inside of Tunnel() are not handled yet.

func (*Tunnel) UnmarshalJSON added in v1.4.0

func (d *Tunnel) UnmarshalJSON(v []byte) error

UnmarshalJSON unmarshals JSON into a tunnel struct

Jump to

Keyboard shortcuts

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