streamlog

package
v5.1.1-release+incompa... Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogAddress

func GetLogAddress(serviceID string) string

GetLogAddress 动态获取日志服务端地址

func New

func New(ctx logger.Info) (logger.Logger, error)

New new logger

func ValidateLogOpt

func ValidateLogOpt(cfg map[string]string) error

ValidateLogOpt 验证参数

Types

type Client

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

Client stream client

func NewClient

func NewClient(server string) (c *Client, err error)

NewClient 新建客户端

func (*Client) ChangeAddress

func (c *Client) ChangeAddress(server string) error

ChangeAddress 更换服务地址

func (*Client) Close

func (c *Client) Close()

Close close

func (*Client) Dial

func (c *Client) Dial() error

Dial 连接

func (*Client) IsClosed

func (c *Client) IsClosed() bool

IsClosed close

func (*Client) ReConnect

func (c *Client) ReConnect() error

ReConnect 重连

func (*Client) Write

func (c *Client) Write(message string) error

write if get a error. will close the conn.

type Dis

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

Dis dis manage

type Endpoint

type Endpoint struct {
	Name   string `json:"name"`
	URL    string `json:"url"`
	Weight int    `json:"weight"`
	Mode   int    `json:"-"` //0 表示URL变化,1表示Weight变化 ,2表示全变化
}

Endpoint endpoint

type ResponseBody

type ResponseBody struct {
	ValidationError url.Values  `json:"validation_error,omitempty"`
	Msg             string      `json:"msg,omitempty"`
	Bean            interface{} `json:"bean,omitempty"`
	List            []*Endpoint `json:"list,omitempty"`
	//数据集总数
	ListAllNumber int `json:"number,omitempty"`
	//当前页码数
	Page int `json:"page,omitempty"`
}

ResponseBody api返回数据格式

func ParseResponseBody

func ParseResponseBody(red io.ReadCloser) (re ResponseBody, err error)

ParseResponseBody 解析成ResponseBody

type StreamLog

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

StreamLog 消息流log

func (*StreamLog) Close

func (s *StreamLog) Close() error

Close 关闭

func (*StreamLog) Log

func (s *StreamLog) Log(msg *logger.Message) error

Log log

func (*StreamLog) Name

func (s *StreamLog) Name() string

Name 返回logger name

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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