resource

package
v0.0.0-...-c8b78b8 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Port       string
	AppVersion string
	AppName    string
	Framework  string

	OtlpEndpoint string

	Mode string

	Base      string
	MaxNumber int
	MaxBond   int

	Number    int32
	Module    string
	Component string
)
View Source
var HttpClient *http.Client
View Source
var Int64ValueRecorder metric.Int64ValueRecorder
View Source
var Tracer trace.Tracer

Functions

func Configure

func Configure()

func Init

func Init()

func IsKubernetesMode

func IsKubernetesMode() bool

func IsLocalMode

func IsLocalMode() bool

func MoleculeUrl

func MoleculeUrl(molecule string) string

func TracePropagation

func TracePropagation()

Types

type RLogger

type RLogger interface {
	InfoF(ctx context.Context, format string, a ...interface{})
	Info(ctx context.Context, message string)
	WarningF(ctx context.Context, format string, a ...interface{})
	Warning(ctx context.Context, message string)
	Error(ctx context.Context, r *http.Request, message string) string
	ErrorErr(ctx context.Context, r *http.Request, message string, err error) string
	ErrorF(ctx context.Context, r *http.Request, format string, a ...interface{}) string
	Flush()
}
var (
	Logger RLogger
)

type SEntry

type SEntry struct {
	Severity       string           `json:"severity,omitempty"`
	Message        string           `json:"message,omitempty"`
	Timestamp      *STimestamp      `json:"timestamp,omitempty"`
	Labels         *SLabel          `json:"logging.googleapis.com/labels,omitempty"`
	ServiceContext *SServiceContext `json:"serviceContext,omitempty"`

	SpanId       string `json:"logging.googleapis.com/spanId,omitempty"`
	Trace        string `json:"logging.googleapis.com/trace,omitempty"`
	TraceSampled bool   `json:"logging.googleapis.com/trace_sampled,omitempty"`
}

type SLabel

type SLabel struct {
	LoggerName string `json:"loggerName,omitempty"`
}

https://cloud.google.com/logging/docs/agent/configuration#special-fields

type SLogger

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

func NewSLogger

func NewSLogger(projectId string) *SLogger

func (*SLogger) Error

func (l *SLogger) Error(ctx context.Context, r *http.Request, message string) string

func (*SLogger) ErrorErr

func (l *SLogger) ErrorErr(ctx context.Context, r *http.Request, message string, err error) string

func (*SLogger) ErrorF

func (l *SLogger) ErrorF(ctx context.Context, r *http.Request, format string, a ...interface{}) string

func (*SLogger) Flush

func (l *SLogger) Flush()

func (*SLogger) Info

func (l *SLogger) Info(ctx context.Context, message string)

func (*SLogger) InfoF

func (l *SLogger) InfoF(ctx context.Context, format string, a ...interface{})

func (*SLogger) Warning

func (l *SLogger) Warning(ctx context.Context, message string)

func (*SLogger) WarningF

func (l *SLogger) WarningF(ctx context.Context, format string, a ...interface{})

type SServiceContext

type SServiceContext struct {
	Service string `json:"service"`
	Version string `json:"version"`
}

type STimestamp

type STimestamp struct {
	Seconds int64 `json:"seconds"`
	Nanos   int   `json:"nanos"`
}

Jump to

Keyboard shortcuts

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