mogura

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV_MOGURA_PASSPHRASE = "MOGURA_PASSPHRASE"

	WarningThresholdForRetrying = 3
)

Variables

This section is empty.

Functions

func GenSSHClientConfig

func GenSSHClientConfig(hostport, username, keyPath, passphrase string) (*ssh.ClientConfig, error)

Types

type DNSClient

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

func NewDNSClient

func NewDNSClient(conn *ssh.Client, remoteDNS string) *DNSClient

func (*DNSClient) Query

func (d *DNSClient) Query(domain, queryType string) (*dns.Msg, error)

func (*DNSClient) QueryA

func (d *DNSClient) QueryA(domain string) ([]*dns.A, error)

func (*DNSClient) QueryCNAME

func (d *DNSClient) QueryCNAME(domain string) ([]*dns.CNAME, error)

func (*DNSClient) QuerySRV

func (d *DNSClient) QuerySRV(domain string) ([]*dns.SRV, error)

type Mogura

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

func GoMogura

func GoMogura(c MoguraConfig) (*Mogura, error)

error is ssh connection and local listener error. error channel transfer flow error

func (*Mogura) Close

func (m *Mogura) Close() error

func (*Mogura) CloseLocalConn

func (m *Mogura) CloseLocalConn() error

func (*Mogura) CloseRemoteConn

func (m *Mogura) CloseRemoteConn() error

func (*Mogura) ConnectSSH

func (m *Mogura) ConnectSSH() error

func (*Mogura) ErrChan

func (m *Mogura) ErrChan() <-chan error

func (*Mogura) GoResolveCycle

func (m *Mogura) GoResolveCycle(interval int64) <-chan error

func (*Mogura) Listen

func (m *Mogura) Listen() error

func (*Mogura) ResolveRemote

func (m *Mogura) ResolveRemote() error

type MoguraConfig

type MoguraConfig struct {
	Name             string
	BastionHostPort  string
	Username         string
	KeyPath          string
	RemoteDNS        string
	LocalBindPort    string
	ForwardingTarget Target
}

type Target

type Target struct {
	TargetType string
	Target     string
	TargetPort int

	ForwardingTimeout time.Duration
	// contains filtered or unexported fields
}

func (*Target) Resolve

func (t *Target) Resolve(conn *ssh.Client, resolver string) error

func (*Target) ResolvedTargetAndPort

func (t *Target) ResolvedTargetAndPort() string

func (*Target) Validate

func (t *Target) Validate() error

Jump to

Keyboard shortcuts

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