Skip to content

Commit

Permalink
[pkg/ottl]Godoc comments (open-telemetry#30564)
Browse files Browse the repository at this point in the history
**Description:** godoc comments added to non-commented public interfaces
in [pkg/ottl] packages

**Link to tracking Issue:** open-telemetry#28893

**Testing:** <Describe what testing was performed and which tests were
added.>

**Documentation:** <Describe the documentation added.>

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Co-authored-by: Curtis Robert <crobert@splunk.com>
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
  • Loading branch information
4 people authored and cparkins committed Feb 1, 2024
1 parent 6ea8c6a commit 2f961cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/ottl/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@ func (e Expr[K]) Eval(ctx context.Context, tCtx K) (any, error) {
return e.exprFunc(ctx, tCtx)
}

// Getter resolves a value at runtime without performing any type checking on the value that is returned.
type Getter[K any] interface {
// Get retrieves a value of type 'Any' and returns an error if there are any issues during retrieval.
Get(ctx context.Context, tCtx K) (any, error)
}

// Setter allows setting an untyped value on a predefined field within some data at runtime.
type Setter[K any] interface {
// Set sets a value of type 'Any' and returns an error if there are any issues during the setting process.
Set(ctx context.Context, tCtx K, val any) error
}

// GetSetter is an interface that combines the Getter and Setter interfaces.
// It should be used to represent the ability to both get and set a value.
type GetSetter[K any] interface {
Getter[K]
Setter[K]
Expand Down Expand Up @@ -284,6 +290,7 @@ func (g StandardBoolGetter[K]) Get(ctx context.Context, tCtx K) (bool, error) {

// FunctionGetter uses a function factory to return an instantiated function as an Expr.
type FunctionGetter[K any] interface {
// Get returns a function as an Expr[K] built with the provided Arguments
Get(args Arguments) (Expr[K], error)
}

Expand Down

0 comments on commit 2f961cd

Please sign in to comment.