database

package
v0.0.0-...-ecdb9b8 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func CheckDatabaseConnection

func CheckDatabaseConnection()

func StartMySql

func StartMySql()

func StartMySqlSSH

func StartMySqlSSH()

Types

type Client

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

func Dial

func Dial(network, addr string, config *ssh.ClientConfig) (*Client, error)

Dial starts a client connection to the given SSH server. This is wrap the ssh.Dial

func DialWithKey

func DialWithKey(addr, user, keyfile string) (*Client, error)

DialWithKey starts a client connection to the given SSH server with key authmethod.

func DialWithKeyWithPassphrase

func DialWithKeyWithPassphrase(addr, user, keyfile string, passphrase string) (*Client, error)

DialWithKeyWithPassphrase same as DialWithKey but with a passphrase to decrypt the private key

func DialWithPasswd

func DialWithPasswd(addr, user, passwd string) (*Client, error)

DialWithPasswd starts a client connection to the given SSH server with passwd authmethod.

func (*Client) Close

func (c *Client) Close() error

func (*Client) Cmd

func (c *Client) Cmd(cmd string) *remoteScript

Cmd create a command on client

func (*Client) Script

func (c *Client) Script(script string) *remoteScript

Script

func (*Client) ScriptFile

func (c *Client) ScriptFile(fname string) *remoteScript

ScriptFile

func (*Client) Shell

func (c *Client) Shell() *remoteShell

Shell create a noninteractive shell on client.

func (*Client) Terminal

func (c *Client) Terminal(config *TerminalConfig) *remoteShell

Terminal create a interactive shell on client.

type Dialer

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

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"`
}

func (*MySQL) New

func (m *MySQL) New() (db *gorm.DB, err error)

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)

type TerminalConfig

type TerminalConfig struct {
	Term   string
	Hight  int
	Weight int
	Modes  ssh.TerminalModes
}

type ViaSSHDialer

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

func (*ViaSSHDialer) Dial

func (self *ViaSSHDialer) Dial(context context.Context, addr string) (net.Conn, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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