storage

package
v0.0.0-...-0248c43 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(sc StorageCreater)

Types

type EsStorage

type EsStorage struct {
	Host     string
	Port     string
	Username string
	Password string
	Index    string
	Body     interface{}
	// contains filtered or unexported fields
}

EsStorage ealsticsearch请求对象

func (EsStorage) GetData

func (es EsStorage) GetData() (res map[string]interface{}, err error)

GetData 发起请求

func (EsStorage) GetStorage

func (EsStorage) GetStorage(config map[string]interface{}) (es interface{}, err error)

func (EsStorage) GetTypes

func (EsStorage) GetTypes() []string

改储存的名字

type RequestError

type RequestError struct {
	Message string
}

RequestError 请求错误

func (RequestError) Error

func (requestError RequestError) Error() string

type Storage

type Storage interface {
	GetData() (map[string]interface{}, error)
}

func GetStorage

func GetStorage(config map[string]interface{}) (Storage, error)

GetStorage 根据配置信息获取监控储存

type StorageCreater

type StorageCreater interface {
	GetTypes() []string
	// 获取相关Storage,必须支持空参数放回一个相关Storage实体
	GetStorage(config map[string]interface{}) (interface{}, error)
}

Jump to

Keyboard shortcuts

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