conf

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package conf is the configuration package for native client

Index

Constants

This section is empty.

Variables

View Source
var DriverMap = map[DriverType]string{
	MySQL:      "mysql",
	Redis:      "redis",
	Memcache:   "memcache",
	Kafka:      "kafka",
	Mongo:      "mongo",
	PostgreSQL: "postgres",
	Zookeeper:  "zookeeper",
	Unknown:    "unknown",
}

DriverMap is the map of [driver, name]

View Source
var DriverTypeMap = reverseMap(DriverMap)

DriverTypeMap is the map of driver [name, driver]

Functions

This section is empty.

Types

type Driver

type Driver interface {
	Kind() string
	Probe() (bool, string)
}

Driver Interface

type DriverType

type DriverType int

DriverType is the client driver

const (
	Unknown DriverType = iota
	MySQL
	Redis
	Memcache
	Kafka
	Mongo
	PostgreSQL
	Zookeeper
)

The Driver Type of native client

func (*DriverType) DriverType

func (d *DriverType) DriverType(name string) DriverType

DriverType convert the string to DriverType

func (DriverType) MarshalJSON

func (d DriverType) MarshalJSON() (b []byte, err error)

MarshalJSON is marshal the driver

func (DriverType) MarshalYAML added in v1.3.0

func (d DriverType) MarshalYAML() (interface{}, error)

MarshalYAML is marshal the driver type

func (DriverType) String

func (d DriverType) String() string

String convert the DriverType to string

func (*DriverType) UnmarshalJSON

func (d *DriverType) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON is Unmarshal the driver type

func (*DriverType) UnmarshalYAML

func (d *DriverType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML is unmarshal the driver type

type Options

type Options struct {
	base.DefaultProbe `yaml:",inline"`

	Host       string            `` /* 129-byte string literal not displayed */
	DriverType DriverType        `` /* 212-byte string literal not displayed */
	Username   string            `` /* 131-byte string literal not displayed */
	Password   string            `` /* 133-byte string literal not displayed */
	Data       map[string]string `` /* 130-byte string literal not displayed */

	//TLS
	global.TLS `yaml:",inline"`
}

Options implements the configuration for native client

func (*Options) Check added in v1.7.0

func (d *Options) Check() error

Check do the configuration check

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳