proxy

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitConfig

func CommitConfig(host, name string, cfg *models.CCConfig) error

CommitConfig commit phase of config change

func DelNamespace

func DelNamespace(host, name string, cfg *models.CCConfig) error

DelNamespace delete namespace

func PrepareConfig

func PrepareConfig(host, name string, cfg *models.CCConfig) error

PrepareConfig prepare phase of config change

func QueryProxyConfigFingerprint

func QueryProxyConfigFingerprint(host string, cfg *models.CCConfig) (string, error)

QueryProxyConfigFingerprint return config fingerprint of proxy

Types

type APIClient

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

APIClient api client

func NewAPIClient

func NewAPIClient(addr, user, password string) *APIClient

NewAPIClient create api client

func (*APIClient) CommitConfig

func (c *APIClient) CommitConfig(name string) error

CommitConfig send commit config

func (*APIClient) DelNamespace

func (c *APIClient) DelNamespace(name string) error

DelNamespace send delete namespace to proxy

func (*APIClient) GetNamespaceSQLFingerprint

func (c *APIClient) GetNamespaceSQLFingerprint(name string) (*SQLFingerprint, error)

GetNamespaceSQLFingerprint return sql fingerprint of specific namespace

func (*APIClient) Ping

func (c *APIClient) Ping() error

Ping ping proxy

func (*APIClient) PrepareConfig

func (c *APIClient) PrepareConfig(name string) error

PrepareConfig send prepare config

type SQLFingerprint

type SQLFingerprint struct {
	SlowSQL  map[string]string `json:"slow_sql"`
	ErrorSQL map[string]string `json:"error_sql"`
}

SQLFingerprint sql指纹

func QueryNamespaceSQLFingerprint

func QueryNamespaceSQLFingerprint(host, name string, cfg *models.CCConfig) (*SQLFingerprint, error)

QueryNamespaceSQLFingerprint return sql fingerprint

type Stats

type Stats struct {
	Host     string `json:"host"`
	Closed   bool   `json:"closed"`
	Error    string `json:"error"`
	UnixTime int64  `json:"unixtime"`
	Timeout  bool   `json:"timeout"`
}

Stats proxy stats

func GetStats

func GetStats(p *models.ProxyMonitorMetric, cfg *models.CCConfig, timeout time.Duration) *Stats

GetStats return proxy status

Jump to

Keyboard shortcuts

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