example.com/api-content
Go API reference for the package example.com/api-content.
Public API
Function: ConsumesError
Canonical path: example.com/api-content.ConsumesError
Declared in: api.go
Signature
func ConsumesError(err error) int {}
Summary
ConsumesError accepts an error but does not return one.
Behavior
Accepts an error value and returns zero.
Function: GroupedResults
Canonical path: example.com/api-content.GroupedResults
Declared in: api.go
Signature
func GroupedResults() (x, y int, err error) {}
Summary
GroupedResults exposes grouped named Go result declarations.
Behavior
Returns zero values for x and y with a nil error.
Function: InjectedComment
Canonical path: example.com/api-content.InjectedComment
Declared in: api.go
Signature
func InjectedComment() {}
Behavior
Completes without performing an operation.
Function: LegacyRetry
Canonical path: example.com/api-content.LegacyRetry
Declared in: api.go
Signature
func LegacyRetry(operation func() (string, error)) (string, error) {}
Summary
LegacyRetry invokes operation once.
Behavior
Invokes operation once and returns its results.
Deprecation
Use Retry so callers can choose an explicit attempt limit.
Function: Retry
Canonical path: example.com/api-content.Retry
Declared in: api.go
Signature
func Retry(
attempts int,
operation func() (string, error),
) (result string, err error) {}
Summary
Retry invokes operation until it succeeds or exhausts the attempt limit.
Behavior
Retry calls operation at most attempts times and stops after the first success.
Parameters
- attempts: limits how many times operation may be called.
- operation: produces the value returned after a successful attempt.
Returns
- result: contains the first value produced without an error.
- err: contains the last operation error when every attempt fails.
Errors
Retry returns ErrUnavailable when attempts is less than one.
Preconditions
operation must be non-nil.
Side effects
Retry invokes operation and therefore permits its documented side effects.
Limitations
Retry performs attempts sequentially and does not add a delay between calls.
Function: ShadowedError
Canonical path: example.com/api-content.ShadowedError
Declared in: api.go
Signature
func ShadowedError[error any]() error {}
Function: Transform
Canonical path: example.com/api-content.Transform
Declared in: api.go
Signature
func Transform(string, func(string) string) (string, error) {}
Summary
Transform applies a callback to an input value.
Behavior
Returns an empty string and a nil error.
Function: Undocumented
Canonical path: example.com/api-content.Undocumented
Declared in: api.go
Signature
func Undocumented(value int) int {}
Behavior
Returns the supplied integer unchanged.
Interface: Runner
Canonical path: example.com/api-content.Runner
Declared in: api.go
Signature
type Runner interface {
Run(name string) error
}
Summary
Runner executes a named operation.
Receiver Method: Run
Canonical path: example.com/api-content.Runner.Run
Declared in: api.go
Signature
Run(name string) error
Behavior
Declares an operation that accepts a name and returns an error.
Struct: Client
Canonical path: example.com/api-content.Client
Declared in: api.go
Signature
type Client struct {
Endpoint string
// contains unexported members
}
Summary
Client configures a service endpoint.
Struct: Embedded
Canonical path: example.com/api-content.Embedded
Declared in: api.go
Signature
type Embedded struct {}
Summary
Embedded is an exported embedded field type.
Struct: Ordered
Canonical path: example.com/api-content.Ordered
Declared in: api.go
Signature
type Ordered struct {
First int
Embedded
Second string
}
Summary
Ordered preserves named and embedded fields in declaration order.
Variable: ErrUnavailable
Canonical path: example.com/api-content.ErrUnavailable
Declared in: api.go
Signature
var ErrUnavailable = errors.New("unavailable")
Summary
ErrUnavailable reports that an operation could not produce a value.
Variable: FirstPair
Canonical path: example.com/api-content.FirstPair
Declared in: api.go
Signature
var FirstPair = 1
Variable: SecondPair
Canonical path: example.com/api-content.SecondPair
Declared in: api.go
Signature
var SecondPair = 2