commonbuilders

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// metric params
	TotalOpsMetricName    = "totalOps"
	FailedOpsMetricName   = "failedOps"
	OpsDurationMetricName = "opsDuration"

	// context decorator param
	ContextDecoratorFuncName = "ctxFunc"
)

constructor parameter names

Variables

This section is empty.

Functions

This section is empty.

Types

type MethodInvocation

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

func NewMethodInvocation

func NewMethodInvocation(method *astgen.MethodConfig) *MethodInvocation

func (*MethodInvocation) Build

func (m *MethodInvocation) Build() ast.Stmt

Build builds the call to the original method, as descried in the method configuration.

func (*MethodInvocation) SetReceiver

func (m *MethodInvocation) SetReceiver(s *ast.SelectorExpr)

type ReturnResults

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

func NewReturnResults

func NewReturnResults(m *astgen.MethodConfig) *ReturnResults

func (*ReturnResults) Build

func (r *ReturnResults) Build() ast.Stmt

Build builds a return statement based on the method configuration it was created with.

type StartTimeRecorder

type StartTimeRecorder struct {
	TimePackageAlias string
	StartFieldName   string
}

func RecordStartTime

func RecordStartTime(timePackageAlias string) *StartTimeRecorder

func (StartTimeRecorder) Build

func (r StartTimeRecorder) Build() ast.Stmt

Build builds a statement that records the current timestamp in a new variable.

Jump to

Keyboard shortcuts

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