g

package
v0.0.0-...-d9ad550 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZIPKIN_OPTION_TAG = 1 + iota
	ZIPKIN_OPTION_ANNOTATE
)

Variables

View Source
var (
	// server
	ErrHandshake = errors.New("handshake failed")
	ErrOperation = errors.New("request operation not valid")
	// ring
	ErrRingEmpty = errors.New("ring buffer empty")
	ErrRingFull  = errors.New("ring buffer full")
	// timer
	ErrTimerFull   = errors.New("timer full")
	ErrTimerEmpty  = errors.New("timer empty")
	ErrTimerNoItem = errors.New("timer item not exist")
	// channel
	ErrPushMsgArg   = errors.New("rpc pushmsg arg error")
	ErrPushMsgsArg  = errors.New("rpc pushmsgs arg error")
	ErrMPushMsgArg  = errors.New("rpc mpushmsg arg error")
	ErrMPushMsgsArg = errors.New("rpc mpushmsgs arg error")
	// bucket
	ErrBroadCastArg     = errors.New("rpc broadcast arg error")
	ErrBroadCastRoomArg = errors.New("rpc broadcast room arg error")

	// room
	ErrRoomDroped = errors.New("room droped")
	// rpc
	ErrLogic = errors.New("logic rpc is not available")
)

.

View Source
var (
	Conf *conf.Config

	Logger logger

	StatMetrics *Metrics
)
View Source
var ServiceRegistrar *consulsd.Registrar
View Source
var ServiceResolver naming.Resolver

Functions

func GetCurrentDir

func GetCurrentDir() string

func InstanceDiscovery

func InstanceDiscovery() error

func NewConsulResolver

func NewConsulResolver(c *consulapi.Client, service string) naming.Resolver

func NewZipkinReporter

func NewZipkinReporter() reporter.Reporter

func NewZipkinSpanFromCtx

func NewZipkinSpanFromCtx(ctx context.Context, f zipkinTracerFunc) (span zipkingo.Span, newCtx context.Context, err error)

func NewZipkinTracer

func NewZipkinTracer(opts ...zipkingo.TracerOption) (*zipkingo.Tracer, error)

func SetPid

func SetPid(curPath string) int

Types

type FieldsFunc

type FieldsFunc func() *LogFields

type LogFields

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

func NewLogFields

func NewLogFields() *LogFields

func (LogFields) Append

func (this LogFields) Append(k string, v interface{}) *LogFields

func (LogFields) Get

func (this LogFields) Get() logrus.Fields

type Metrics

type Metrics struct {
	// online
	Online    metrics.Gauge
	TcpOnline metrics.Gauge
	WsOnline  metrics.Gauge
	// messages
	AllMsg           metrics.Counter
	PushMsg          metrics.Counter
	BroadcastMsg     metrics.Counter
	BroadcastRoomMsg metrics.Counter
	//speed
	SpeedMsgSecond metrics.Gauge
	// buckets
	BucketChannels metrics.Histogram
	BucketRooms    metrics.Histogram
}

func MetricsInstrumenting

func MetricsInstrumenting() *Metrics

func (*Metrics) DecrTcpOnline

func (s *Metrics) DecrTcpOnline()

func (*Metrics) DecrWsOnline

func (s *Metrics) DecrWsOnline()

func (*Metrics) IncrBroadcastMsg

func (s *Metrics) IncrBroadcastMsg()

func (*Metrics) IncrBroadcastRoomMsg

func (s *Metrics) IncrBroadcastRoomMsg()

func (*Metrics) IncrPushMsg

func (s *Metrics) IncrPushMsg()

func (*Metrics) IncrTcpOnline

func (s *Metrics) IncrTcpOnline()

func (*Metrics) IncrWsOnline

func (s *Metrics) IncrWsOnline()

type ZipkinTag

type ZipkinTag struct {
	K string
	V string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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