global

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-2-Clause Imports: 4 Imported by: 4

Documentation

Overview

Package global provides information on global variables and status

Package global provides information on global variables and status

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMysqlError added in v1.1.6

func IsMysqlError(err error, wantedErrNum int) bool

IsMysqlError returns true if the given error matches the expected number

  • format of MySQL error messages changed in database-sql-driver/mysql v1.7.0 so adjusting code to handle the expected format

Error 1109 (42S02): Unknown table 'GLOBAL_VARIABLES' in information_schema

Types

type Status

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

Status holds a handle to the database where the status can be queried

func NewStatus

func NewStatus(db *sql.DB) *Status

NewStatus returns a *Status structure to the user

func (*Status) Get

func (status *Status) Get(name string) int

Get returns the value of the variable name requested (if found), or if not an error - note: we assume we have checked a variable first as there's no logic here to switch between I_S and P_S

type Variables

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

Variables holds the handle and variables collected from the database

func NewVariables

func NewVariables(db *sql.DB) *Variables

NewVariables returns a pointer to an initialised Variables structure with one collection done.

func (Variables) Get

func (v Variables) Get(key string) string

Get returns the value of the given variable if found or an empty string if not.

Jump to

Keyboard shortcuts

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