core

package module
v0.0.3-beta Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 8 Imported by: 8

README

SQLCommenter Core [In development]

SQLcommenter is a plugin/middleware/wrapper to augment application related information/tags with SQL Statements that can be used later to correlate user code with SQL statements.

This package contains configuration options, framework interface and support functions for all the sqlcommenter go modules

Installation

This is a support package and will be installed indirectly by other go sqlcommenter packages

Usages

Configuration

Users are given control over what tags they want to append by using core.CommenterOptions struct.

type CommenterOptions struct {
	EnableDBDriver    bool
	EnableTraceparent bool   // OpenTelemetry trace information
	EnableRoute       bool   // applicable for web frameworks
	EnableFramework   bool   // applicable for web frameworks
	EnableController  bool   // applicable for web frameworks
	EnableAction      bool   // applicable for web frameworks
	EnableApplication bool
	Application       string // user-provided application-name. optional
}

Documentation

Index

Constants

View Source
const (
	Route       string = "route"
	Controller  string = "controller"
	Action      string = "action"
	Framework   string = "framework"
	Driver      string = "db_driver"
	Traceparent string = "traceparent"
	Application string = "application"
)

Variables

This section is empty.

Functions

func ConvertMapToComment

func ConvertMapToComment(tags map[string]string) string

func ExtractTraceparent

func ExtractTraceparent(ctx context.Context) propagation.MapCarrier

func GetFunctionName

func GetFunctionName(i interface{}) string

Types

type CommenterOptions

type CommenterOptions struct {
	EnableDBDriver    bool
	EnableRoute       bool
	EnableFramework   bool
	EnableController  bool
	EnableAction      bool
	EnableTraceparent bool
	EnableApplication bool
	Application       string
}

type RequestTagsProvider

type RequestTagsProvider interface {
	Route() string
	Action() string
	Framework() string
}

Jump to

Keyboard shortcuts

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