database

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database represents the database configuration.

func NewDatabase

func NewDatabase(storage *storage.Storage, name string) *Database

NewDatabase creates a new database.

func (*Database) CreateDatabase

func (database *Database) CreateDatabase() error

CreateDatabase creates the database file.

func (*Database) CreateDomainsTable

func (database *Database) CreateDomainsTable() error

CreateDomainsTable creates the domains table.

func (*Database) CreateProxiesTable

func (database *Database) CreateProxiesTable() error

CreateProxiesTable creates the proxies table.

func (*Database) CreateTables

func (database *Database) CreateTables() error

CreateTables creates the tables.

func (*Database) DomainCreate

func (database *Database) DomainCreate(domain string, proxify bool) bool

DomainCreate creates the domain.

func (*Database) DomainDelete

func (database *Database) DomainDelete(domain string) bool

DomainDelete deletes the domain.

func (*Database) DomainExists

func (database *Database) DomainExists(domain string) bool

DomainExists checks if the domain exists.

func (*Database) DomainGet

func (database *Database) DomainGet(domain string) (int, string, bool)

DomainGet gets the domain.

func (*Database) DomainList

func (database *Database) DomainList() map[string]bool

DomainList lists the domains.

func (*Database) DomainUpdate

func (database *Database) DomainUpdate(domain string, proxify bool) bool

DomainUpdate updates the domain.

func (*Database) GetConnection

func (database *Database) GetConnection() *sql.DB

GetConnection returns the connection to the database.

func (*Database) GetDomainsTableName

func (database *Database) GetDomainsTableName() string

GetDomainsTableName returns the name of the table.

func (*Database) GetName

func (database *Database) GetName() string

GetName returns the name of the database.

func (*Database) GetProxiesTableName

func (database *Database) GetProxiesTableName() string

func (*Database) GetStorage

func (database *Database) GetStorage() *storage.Storage

GetStorage returns the storage.

func (*Database) ProxyCreate

func (database *Database) ProxyCreate(proxyType, proxyHost string, proxyPort int) bool

ProxyCreate creates a new proxy.

func (*Database) ProxyDelete

func (database *Database) ProxyDelete(proxyType, proxyHost string, proxyPort int) bool

ProxyDelete deletes a proxy.

func (*Database) ProxyDisableAuthentication

func (database *Database) ProxyDisableAuthentication(proxyType, proxyHost string, proxyPort int) bool

ProxyDisableAuthentication disables authentication for a proxy.

func (*Database) ProxyEnableAuthentication

func (database *Database) ProxyEnableAuthentication(proxyType, proxyHost string, proxyPort int, username, password string) bool

ProxyEnableAuthentication enables authentication for a proxy.

func (*Database) ProxyExists

func (database *Database) ProxyExists(proxyType, proxyHost string, proxyPort int) bool

ProxyExists checks if a proxy exists.

func (*Database) ProxyFindByHost

func (database *Database) ProxyFindByHost(proxyHost string) []*ProxyServer

ProxyFindByHost finds all proxies by host.

func (*Database) ProxyList

func (database *Database) ProxyList() []string

ProxyList lists all proxies.

func (*Database) Start

func (database *Database) Start() error

Start creates the database and opens the connection.

func (*Database) Stop

func (database *Database) Stop() error

Stop closes the connection to the database.

func (*Database) TableExists

func (database *Database) TableExists(table string) bool

TableExists checks if the table exists.

type ProxyServer

type ProxyServer struct {
	Type     string
	Host     string
	Port     int
	Username *string
	Password *string
}

ProxyServer represents a proxy server configuration.

Jump to

Keyboard shortcuts

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