Documentation
¶
Index ¶
- type InterfaceWithValidtableArgWithGRPCValidation
- type InterfaceWithValidtableArgWithTwirpValidation
- type InterfaceWithValidtableArgWithValidation
- type TestInterface
- type TestInterfacePool
- type TestInterfaceRoundRobinPool
- type TestInterfaceWithCircuitBreaker
- type TestInterfaceWithFallback
- type TestInterfaceWithLogger
- type TestInterfaceWithLogrus
- type TestInterfaceWithPrometheus
- type TestInterfaceWithRateLimit
- type TestInterfaceWithRetry
- type TestInterfaceWithTimeout
- type TestInterfaceWithTimeoutConfig
- type TestInterfaceWithTracing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InterfaceWithValidtableArgWithGRPCValidation ¶
type InterfaceWithValidtableArgWithGRPCValidation struct {
InterfaceWithValidtableArg
}
InterfaceWithValidtableArgWithGRPCValidation implements InterfaceWithValidtableArg interface instrumented with GRPC request validation
func NewInterfaceWithValidtableArgWithGRPCValidation ¶
func NewInterfaceWithValidtableArgWithGRPCValidation(base InterfaceWithValidtableArg) InterfaceWithValidtableArgWithGRPCValidation
NewInterfaceWithValidtableArgWithGRPCValidation returns InterfaceWithValidtableArgWithGRPCValidation
type InterfaceWithValidtableArgWithTwirpValidation ¶
type InterfaceWithValidtableArgWithTwirpValidation struct {
InterfaceWithValidtableArg
}
InterfaceWithValidtableArgWithTwirpValidation implements InterfaceWithValidtableArg interface instrumented with arguments validation
func NewInterfaceWithValidtableArgWithTwirpValidation ¶
func NewInterfaceWithValidtableArgWithTwirpValidation(base InterfaceWithValidtableArg) InterfaceWithValidtableArgWithTwirpValidation
NewInterfaceWithValidtableArgWithTwirpValidation returns InterfaceWithValidtableArgWithTwirpValidation
type InterfaceWithValidtableArgWithValidation ¶
type InterfaceWithValidtableArgWithValidation struct {
InterfaceWithValidtableArg
}
InterfaceWithValidtableArgWithValidation implements InterfaceWithValidtableArg interface instrumented with arguments validation
func NewInterfaceWithValidtableArgWithValidation ¶
func NewInterfaceWithValidtableArgWithValidation(base InterfaceWithValidtableArg) InterfaceWithValidtableArgWithValidation
NewInterfaceWithValidtableArgWithValidation returns InterfaceWithValidtableArgWithValidation
type TestInterface ¶
type TestInterface interface { F(ctx context.Context, a1 string, a2 ...string) (result1, result2 string, err error) NoError(string) string NoParamsOrResults() }
TestInterface is used to test templates
type TestInterfacePool ¶
type TestInterfacePool struct {
// contains filtered or unexported fields
}
TestInterfacePool implements TestInterface that uses pool of TestInterface
func NewTestInterfacePool ¶
func NewTestInterfacePool(impls ...TestInterface) TestInterfacePool
NewTestInterfacePool takes several implementations of the TestInterface and returns an instance of the TestInterface that uses sync.Pool of given implemetations
func (TestInterfacePool) F ¶
func (_d TestInterfacePool) F(ctx context.Context, a1 string, a2 ...string) (result1 string, result2 string, err error)
F implements TestInterface
func (TestInterfacePool) NoError ¶
func (_d TestInterfacePool) NoError(s1 string) (s2 string)
NoError implements TestInterface
func (TestInterfacePool) NoParamsOrResults ¶
func (_d TestInterfacePool) NoParamsOrResults()
NoParamsOrResults implements TestInterface
type TestInterfaceRoundRobinPool ¶
type TestInterfaceRoundRobinPool struct {
// contains filtered or unexported fields
}
TestInterfaceRoundRobinPool implements TestInterface that uses pool of TestInterface
func MustNewTestInterfaceRoundRobinPool ¶
func MustNewTestInterfaceRoundRobinPool(pool ...TestInterface) *TestInterfaceRoundRobinPool
MustNewTestInterfaceRoundRobinPool takes several implementations of the TestInterface and returns an instance of the TestInterface that picks one of the given implementations using Round-robin algorithm and delegates method call to it.
func NewTestInterfaceRoundRobinPool ¶
func NewTestInterfaceRoundRobinPool(pool ...TestInterface) (*TestInterfaceRoundRobinPool, error)
NewTestInterfaceRoundRobinPool takes several implementations of the TestInterface and returns an instance of the TestInterface that picks one of the given implementations using Round-robin algorithm and delegates method call to it
func (*TestInterfaceRoundRobinPool) F ¶
func (_d *TestInterfaceRoundRobinPool) F(ctx context.Context, a1 string, a2 ...string) (result1 string, result2 string, err error)
F implements TestInterface
func (*TestInterfaceRoundRobinPool) NoError ¶
func (_d *TestInterfaceRoundRobinPool) NoError(s1 string) (s2 string)
NoError implements TestInterface
func (*TestInterfaceRoundRobinPool) NoParamsOrResults ¶
func (_d *TestInterfaceRoundRobinPool) NoParamsOrResults()
NoParamsOrResults implements TestInterface
type TestInterfaceWithCircuitBreaker ¶
type TestInterfaceWithCircuitBreaker struct { TestInterface // contains filtered or unexported fields }
TestInterfaceWithCircuitBreaker implements TestInterface instrumented with circuit breaker
func NewTestInterfaceWithCircuitBreaker ¶
func NewTestInterfaceWithCircuitBreaker(base TestInterface, consecutiveErrors int, openInterval time.Duration) *TestInterfaceWithCircuitBreaker
NewTestInterfaceWithCircuitBreaker breakes a circuit after consecutiveErrors of errors and opens the circuit again after openInterval of time. If after openInterval first method call results in error we close open again.
type TestInterfaceWithFallback ¶
type TestInterfaceWithFallback struct {
// contains filtered or unexported fields
}
TestInterfaceWithFallback implements TestInterface interface wrapped with Prometheus metrics
func NewTestInterfaceWithFallback ¶
func NewTestInterfaceWithFallback(interval time.Duration, impls ...TestInterface) TestInterfaceWithFallback
NewTestInterfaceWithFallback takes several implementations of the TestInterface and returns an instance of TestInterface which calls all implementations concurrently with given interval and returns first non-error response.
func (TestInterfaceWithFallback) F ¶
func (_d TestInterfaceWithFallback) F(ctx context.Context, a1 string, a2 ...string) (result1 string, result2 string, err error)
F implements TestInterface
func (TestInterfaceWithFallback) NoError ¶
func (_d TestInterfaceWithFallback) NoError(s1 string) (s2 string)
NoError implements TestInterface
func (TestInterfaceWithFallback) NoParamsOrResults ¶
func (_d TestInterfaceWithFallback) NoParamsOrResults()
NoParamsOrResults implements TestInterface
type TestInterfaceWithLogger ¶
type TestInterfaceWithLogger struct {
// contains filtered or unexported fields
}
TestInterfaceWithLogger implements TestInterface that is instrumented with logging
func NewTestInterfaceWithLogger ¶
func NewTestInterfaceWithLogger(base TestInterface, stdout, stderr io.Writer) TestInterfaceWithLogger
NewTestInterfaceWithLogger instruments an implementation of the TestInterface with simple logging
func (TestInterfaceWithLogger) F ¶
func (_d TestInterfaceWithLogger) F(ctx context.Context, a1 string, a2 ...string) (result1 string, result2 string, err error)
F implements TestInterface
func (TestInterfaceWithLogger) NoError ¶
func (_d TestInterfaceWithLogger) NoError(s1 string) (s2 string)
NoError implements TestInterface
func (TestInterfaceWithLogger) NoParamsOrResults ¶
func (_d TestInterfaceWithLogger) NoParamsOrResults()
NoParamsOrResults implements TestInterface
type TestInterfaceWithLogrus ¶
type TestInterfaceWithLogrus struct {
// contains filtered or unexported fields
}
TestInterfaceWithLogrus implements TestInterface that is instrumented with logrus logger
func NewTestInterfaceWithLogrus ¶
func NewTestInterfaceWithLogrus(base TestInterface, log *logrus.Entry) TestInterfaceWithLogrus
NewTestInterfaceWithLogrus instruments an implementation of the TestInterface with simple logging
func (TestInterfaceWithLogrus) F ¶
func (_d TestInterfaceWithLogrus) F(ctx context.Context, a1 string, a2 ...string) (result1 string, result2 string, err error)
F implements TestInterface
func (TestInterfaceWithLogrus) NoError ¶
func (_d TestInterfaceWithLogrus) NoError(s1 string) (s2 string)
NoError implements TestInterface
func (TestInterfaceWithLogrus) NoParamsOrResults ¶
func (_d TestInterfaceWithLogrus) NoParamsOrResults()
NoParamsOrResults implements TestInterface
type TestInterfaceWithPrometheus ¶
type TestInterfaceWithPrometheus struct {
// contains filtered or unexported fields
}
TestInterfaceWithPrometheus implements TestInterface interface with all methods wrapped with Prometheus metrics
func NewTestInterfaceWithPrometheus ¶
func NewTestInterfaceWithPrometheus(base TestInterface, instanceName string) TestInterfaceWithPrometheus
NewTestInterfaceWithPrometheus returns an instance of the TestInterface decorated with prometheus summary metric
func (TestInterfaceWithPrometheus) F ¶
func (_d TestInterfaceWithPrometheus) F(ctx context.Context, a1 string, a2 ...string) (result1 string, result2 string, err error)
F implements TestInterface
func (TestInterfaceWithPrometheus) NoError ¶
func (_d TestInterfaceWithPrometheus) NoError(s1 string) (s2 string)
NoError implements TestInterface
func (TestInterfaceWithPrometheus) NoParamsOrResults ¶
func (_d TestInterfaceWithPrometheus) NoParamsOrResults()
NoParamsOrResults implements TestInterface
type TestInterfaceWithRateLimit ¶
type TestInterfaceWithRateLimit struct {
// contains filtered or unexported fields
}
TestInterfaceWithRateLimit implements TestInterface
func NewTestInterfaceWithRateLimit ¶
func NewTestInterfaceWithRateLimit(base TestInterface, concurrentRequests int, rps float64) *TestInterfaceWithRateLimit
NewTestInterfaceWithRateLimit instruments an implementation of the TestInterface with with rate limiting
func (*TestInterfaceWithRateLimit) F ¶
func (_d *TestInterfaceWithRateLimit) F(ctx context.Context, a1 string, a2 ...string) (result1 string, result2 string, err error)
F implements TestInterface
func (*TestInterfaceWithRateLimit) NoError ¶
func (_d *TestInterfaceWithRateLimit) NoError(s1 string) (s2 string)
NoError implements TestInterface
func (*TestInterfaceWithRateLimit) NoParamsOrResults ¶
func (_d *TestInterfaceWithRateLimit) NoParamsOrResults()
NoParamsOrResults implements TestInterface
type TestInterfaceWithRetry ¶
type TestInterfaceWithRetry struct { TestInterface // contains filtered or unexported fields }
TestInterfaceWithRetry implements TestInterface interface instrumented with retries
func NewTestInterfaceWithRetry ¶
func NewTestInterfaceWithRetry(base TestInterface, retryCount int, retryInterval time.Duration) TestInterfaceWithRetry
NewTestInterfaceWithRetry returns TestInterfaceWithRetry
type TestInterfaceWithTimeout ¶
type TestInterfaceWithTimeout struct { TestInterface // contains filtered or unexported fields }
TestInterfaceWithTimeout implements TestInterface interface instrumented with timeouts
func NewTestInterfaceWithTimeout ¶
func NewTestInterfaceWithTimeout(base TestInterface, config TestInterfaceWithTimeoutConfig) TestInterfaceWithTimeout
NewTestInterfaceWithTimeout returns TestInterfaceWithTimeout
type TestInterfaceWithTracing ¶
type TestInterfaceWithTracing struct { TestInterface // contains filtered or unexported fields }
TestInterfaceWithTracing implements TestInterface interface instrumented with opentracing spans
func NewTestInterfaceWithTracing ¶
func NewTestInterfaceWithTracing(base TestInterface, instance string, spanDecorator ...func(span opentracing.Span, params, results map[string]interface{})) TestInterfaceWithTracing
NewTestInterfaceWithTracing returns TestInterfaceWithTracing
Source Files
¶
- interface.go
- interface_with_circuitbreaker.go
- interface_with_fallback.go
- interface_with_grpc_validation.go
- interface_with_log.go
- interface_with_logrus.go
- interface_with_opentracing.go
- interface_with_prometheus.go
- interface_with_ratelimit.go
- interface_with_retry.go
- interface_with_robinpool.go
- interface_with_syncpool.go
- interface_with_timeout.go
- interface_with_twirp_validation.go
- interface_with_validation.go