rainbond: github.com/goodrain/rainbond/node/nodem/logger/streamlog Index | Files

package streamlog

import "github.com/goodrain/rainbond/node/nodem/logger/streamlog"


Package Files

streamclient.go streamlog.go

func GetLogAddress Uses

func GetLogAddress(serviceID string) string

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

func New Uses

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

New new logger

func ValidateLogOpt Uses

func ValidateLogOpt(cfg map[string]string) error

ValidateLogOpt 验证参数

type Client Uses

type Client struct {
    // contains filtered or unexported fields

Client stream client

func NewClient Uses

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

NewClient 新建客户端

func (*Client) ChangeAddress Uses

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

ChangeAddress 更换服务地址

func (*Client) Close Uses

func (c *Client) Close()

Close close

func (*Client) Dial Uses

func (c *Client) Dial() error

Dial 连接

func (*Client) IsClosed Uses

func (c *Client) IsClosed() bool

IsClosed close

func (*Client) ReConnect Uses

func (c *Client) ReConnect() error

ReConnect 重连

func (*Client) Write Uses

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

write if get a error. will close the conn.

type Dis Uses

type Dis struct {
    // contains filtered or unexported fields

Dis dis manage

type Endpoint Uses

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 Uses

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 Uses

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

ParseResponseBody 解析成ResponseBody

type StreamLog Uses

type StreamLog struct {
    // contains filtered or unexported fields

StreamLog 消息流log

func (*StreamLog) Close Uses

func (s *StreamLog) Close() error

Close 关闭

func (*StreamLog) Log Uses

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

Log log

func (*StreamLog) Name Uses

func (s *StreamLog) Name() string

Name 返回logger name

Package streamlog imports 19 packages (graph) and is imported by 1 packages. Updated 2019-08-23. Refresh now. Tools for package owners.