Documentation ¶
Overview ¶
package govector provides runtime GoVector components to be used by the govector plugin.
Package provides a GoVector logger that maintains vector clocks for a process and correctly propagates the vector clocks to other processes through its service-level instrumentation.
More info on govector: https://github.com/DistributedClocks/GoVector
Index ¶
- type GoVecLogger
- func (g *GoVecLogger) Debug(ctx context.Context, format string, args ...any) (context.Context, error)
- func (g *GoVecLogger) Error(ctx context.Context, format string, args ...any) (context.Context, error)
- func (g *GoVecLogger) GetSendCtx(ctx context.Context, msg string) ([]byte, error)
- func (g *GoVecLogger) Info(ctx context.Context, format string, args ...any) (context.Context, error)
- func (g *GoVecLogger) Logf(ctx context.Context, options backend.LogOptions, format string, args ...any) (context.Context, error)
- func (g *GoVecLogger) UnpackReceiveCtx(ctx context.Context, msg string, bytes []byte) error
- func (g *GoVecLogger) Warn(ctx context.Context, format string, args ...any) (context.Context, error)
- type GoVector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoVecLogger ¶
type GoVecLogger struct {
// contains filtered or unexported fields
}
GoVecLogger implements the GoVector interface (including the backend.Logger) by using the GoVector Logger
func GetLogger ¶
func GetLogger() *GoVecLogger
Returns the current GoVectorLogger. Used by the govector plugin when instrumenting the server and client side objects of services.
func NewGoVecLogger ¶
func NewGoVecLogger(ctx context.Context, loggerName string) (*GoVecLogger, error)
Returns a new object of type GoVecLogger
func (*GoVecLogger) Debug ¶
func (g *GoVecLogger) Debug(ctx context.Context, format string, args ...any) (context.Context, error)
Implements backend.Logger interface
func (*GoVecLogger) Error ¶
func (g *GoVecLogger) Error(ctx context.Context, format string, args ...any) (context.Context, error)
Implements backend.Logger interface
func (*GoVecLogger) GetSendCtx ¶
Implements GoVector interface
func (*GoVecLogger) Info ¶
func (g *GoVecLogger) Info(ctx context.Context, format string, args ...any) (context.Context, error)
Implements backend.Logger interface
func (*GoVecLogger) Logf ¶
func (g *GoVecLogger) Logf(ctx context.Context, options backend.LogOptions, format string, args ...any) (context.Context, error)
Implements backend.Logger interface
func (*GoVecLogger) UnpackReceiveCtx ¶
Implements GoVector interface
type GoVector ¶
type GoVector interface { // Gets the govector context (the vector clock) as a bytes array that will be sent from one process to another GetSendCtx(ctx context.Context, msg string) ([]byte, error) // Unpacks the received context `bytes` and merges the context into the process' current vector clock UnpackReceiveCtx(ctx context.Context, msg string, bytes []byte) error }
Represents the GoVector logger interface exposed to applications and used by the GoVector plugin