xbase

package
Version: v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UNSUPPORT type.
	UNSUPPORT = "UNSUPPORT"

	// DDL type.
	DDL = "DDL"

	// USEDB type.
	USEDB = "USEDB"

	// SHOW type.
	SHOW = "SHOW"

	// SELECT type.
	SELECT = "SELECT"

	// INSERT type.
	INSERT = "INSERT"

	// UPDATE type.
	UPDATE = "UPDATE"

	// DELETE type.
	DELETE = "DELETE"

	// REPLACE type.
	REPLACE = "REPLACE"

	// EXPLAIN type.
	EXPLAIN = "EXPLAIN"

	// HELP type.
	HELP = "HELP"

	// KILL type.
	KILL = "KILL"

	// SET type.
	SET = "SET"

	// TRANSACTION type.
	TRANSACTION = "TRANSACTION"

	// CHECKSUM type.
	CHECKSUM = "CHECKSUM"

	// DO type.
	DO = "DO"

	// OPTIMIZE type.
	OPTIMIZE = "OPTIMIZE"

	// CHECK type.
	CHECK = "CHECK"

	// RADON type
	RADON = "RADON"
)

Variables

This section is empty.

Functions

func HTTPGet

func HTTPGet(url string) (string, error)

HTTPGet used to do restful get request.

func HTTPPost

func HTTPPost(url string, payload interface{}) (*http.Response, func(), error)

HTTPPost used to do restful post request.

func HTTPPut

func HTTPPut(url string, payload interface{}) (*http.Response, func(), error)

HTTPPut used to do restful put request.

func HTTPReadBody

func HTTPReadBody(resp *http.Response) string

HTTPReadBody returns the body of the response.

func TruncateQuery

func TruncateQuery(query string, max int) string

TruncateQuery used to truncate the query with max length.

func WriteFile

func WriteFile(file string, data []byte) error

WriteFile used to write data to file.

Types

type DiskStatus

type DiskStatus struct {
	All  uint64
	Used uint64
	Free uint64
}

DiskStatus tuple.

func DiskUsage

func DiskUsage(path string) (*DiskStatus, error)

DiskUsage returns the disk info of the path.

type LogInfo

type LogInfo struct {
	Name string
	// Ts is the timestamp with UTC().UnixNano.
	Ts int64
}

LogInfo tuple.

type RotateFile

type RotateFile interface {
	Write(b []byte) (int, error)
	Sync() error
	Close()
	Name() string
	GetOldLogInfos() ([]LogInfo, error)
	GetNextLogInfo(logName string) (LogInfo, error)
	GetCurrLogInfo(ts int64) (LogInfo, error)
}

RotateFile interface.

func NewRotateFile

func NewRotateFile(dir string, prefix string, extension string, maxSize int) RotateFile

NewRotateFile creates a new rotateFile.

type Throttle

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

Throttle tuple.

func NewThrottle

func NewThrottle(l int) *Throttle

NewThrottle creates the new throttle.

func (*Throttle) Acquire

func (throttle *Throttle) Acquire()

Acquire used to acquire the lock of throttle.

func (*Throttle) Limits

func (throttle *Throttle) Limits() int

Limits returns the limits of the throttle.

func (*Throttle) Release

func (throttle *Throttle) Release()

Release used to do nothing.

func (*Throttle) Set

func (throttle *Throttle) Set(l int)

Set used to set the quota for the throttle.

Directories

Path Synopsis
Package stats is a wrapper for expvar.
Package stats is a wrapper for expvar.
Package sync2 provides extra functionality along the same lines as sync.
Package sync2 provides extra functionality along the same lines as sync.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL