inspector

package module
v0.0.0-...-3f24f47 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

README

inspector

Package inspector implements Language Server Protocol Inspector specification in Go.

Documentation

Overview

Package inspector implements Language Server Protocol Inspector specification in Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogFormat

type LogFormat uint8

LogFormat represents a Language Server Protocol Inspector log format.

const (
	// TextFormat represents a text format of inspector log.
	TextFormat LogFormat = 1 + iota

	// JSONFormat represents a JSON format of inspector log.
	JSONFormat
)

func (LogFormat) String

func (lf LogFormat) String() string

String implements fmt.Stringer.

type Logger

type Logger interface {
	TraceRequest(serverID string, req *Payload, expected bool, queueLength int) error
	TraceResponse(serverID string, req *Payload, meta Metadata) error
	TraceRequestCompleted(serverID string, command string, reqSequence int, meta Metadata) error
	TraceEvent(serverID string, event *Payload) error
}

Logger represents a Language Server Protocol Inspector specification logger.

type MessageKind

type MessageKind uint8

MessageKind represents a message kind.

const (
	// SendNotification represents a send notification message kind.
	SendNotification MessageKind = 1 + iota

	// ReceiveNotification represents a receive notification message kind.
	ReceiveNotification

	// SendRequest represents a send request message kind.
	SendRequest

	// ReceiveRequest represents a receive request message kind.
	ReceiveRequest

	// SendResponse represents a send response message kind.
	SendResponse

	// ReceiveResponse represents a receive response message kind.
	ReceiveResponse
)

func (MessageKind) String

func (ms MessageKind) String() string

String implements fmt.Stringer.

type Metadata

type Metadata struct {
	QueuingStartTime time.Time
}

Metadata represents a request metadata.

type Payload

type Payload struct {
	Time       time.Time     `json:"time"`
	Msg        string        `json:"msg"`
	MsgKind    MessageKind   `json:"msgKind"`
	MsgType    string        `json:"msgType"`
	MsgID      string        `json:"msgId,omitempty"`
	MsgLatency time.Duration `json:"msgLatency,omitempty"`
	Arg        []interface{} `json:"arg"`
}

Payload represents a Language Server Protocol Inspector specification payload.

func (*Payload) MarshalLogObject

func (p *Payload) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject implements zapcore.ObjectMarshaler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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