Documentation
¶
Index ¶
Examples ¶
Constants ¶
View Source
const ScopeName = "github.com/cep21/circuitotel"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Factory ¶
type Factory struct { MeterProvider metric.MeterProvider // contains filtered or unexported fields }
Example ¶
// Make a factory. With defaults, it uses the // global meter provider. factory := circuitotel.Factory{ // You can pass your own provider if you wish // MeterProvider: nil } manager := circuit.Manager{ // Pass the factory constructor to your manager DefaultCircuitProperties: []circuit.CommandPropertiesConstructor{ factory.CommandPropertiesConstructor, }, } // Now make and use circuits like normal c := manager.MustCreateCircuit("test-circuit") _ = c.Execute(context.Background(), func(_ context.Context) error { return nil }, nil)
Output:
Example (Simple) ¶
// For many, the default factory is sufficient var f circuitotel.Factory manager := circuit.Manager{ // Pass the factory constructor to your manager DefaultCircuitProperties: []circuit.CommandPropertiesConstructor{ f.CommandPropertiesConstructor, }, } _ = manager.MustCreateCircuit("test-circuit")
Output:
func (*Factory) CommandPropertiesConstructor ¶
Click to show internal directories.
Click to hide internal directories.