dbTools

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB

func OpenDB(dc MySQL) (*gorm.DB, error)

func SSHOpenDB

func SSHOpenDB(sc SSH, dc MySQL) (*gorm.DB, *ssh.Client, error)

Types

type Dialer

type Dialer struct {
	Client *ssh.Client
}

func (*Dialer) Dial

func (v *Dialer) Dial(address string) (net.Conn, error)

type MySQL

type MySQL struct {
	Host     string `json:"host"`
	User     string `json:"user"`
	Port     int    `json:"port"`
	Password string `json:"password"`
	Database string `json:"database"`
}

type SSH

type SSH struct {
	Host     string `json:"host"`
	User     string `json:"user"`
	Port     int    `json:"port"`
	Type     string `json:"type"`
	Password string `json:"password"`
	KeyFile  string `json:"key"`
}

func (*SSH) DialWithKeyFile

func (s *SSH) DialWithKeyFile() (*ssh.Client, error)

func (*SSH) DialWithPassword

func (s *SSH) DialWithPassword() (*ssh.Client, error)

Jump to

Keyboard shortcuts

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