Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Services []*Service TestName string TestDuration time.Duration TestRunners int Repeats int SleepBetweenRequests time.Duration }
Config is config.
type Dependencies ¶
type Dependencies struct { Seq Sequence `json:",omitempty"` Par *Parallel `json:",omitempty"` Service *ServiceDep `json:",omitempty"` }
Dependencies describes dependencies.
func (*Dependencies) Call ¶
func (d *Dependencies) Call(ctx context.Context, tracer opentracing.Tracer) error
Call makes calls to all dependencies.
func (*Dependencies) Validate ¶
func (d *Dependencies) Validate(r *Registry) error
Validate performs validation and sets defaults.
type Endpoint ¶
type Endpoint struct { Name string Perf *Perf `json:",omitempty"` Depends *Dependencies `json:",omitempty"` // contains filtered or unexported fields }
Endpoint describes an endpoint
func (*Endpoint) NewInstance ¶
func (e *Endpoint) NewInstance(serviceInst *ServiceInstance) *EndpointInstance
NewInstance creates a new instance of endpoint for
type EndpointInstance ¶
type EndpointInstance struct { Endpoint // contains filtered or unexported fields }
EndpointInstance implements an endpoint in a single instance of a service.
func (*EndpointInstance) Call ¶
func (e *EndpointInstance) Call(ctx context.Context, tracer opentracing.Tracer) error
Call makes a call to this endpoint.
func (*EndpointInstance) ServeHTTP ¶
func (e *EndpointInstance) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Parallel ¶
type Parallel struct { Items []Dependencies MaxPar int `json:",omitempty"` }
Parallel describes parallel dependencies.
type Perf ¶
Perf controls service performance.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores all services.
func (*Registry) RegisterServices ¶
RegisterServices stores all services in Registry.
type Sequence ¶
type Sequence []Dependencies
Sequence describes sequential dependencies.
type Service ¶
type Service struct { Name string Endpoints []*Endpoint `json:",omitempty"` Count int `json:",omitempty"` // contains filtered or unexported fields }
Service is service.
func (*Service) DefaultEndpoint ¶
DefaultEndpoint returns default endpoint for this service (always the first). If none are defined, it creates one.
func (*Service) NextServerURL ¶
NextServerURL returns the URL of one of the servers, in round-robin fashion.
type ServiceDep ¶
type ServiceDep struct { Name string Endpoint string `json:",omitempty"` // contains filtered or unexported fields }
ServiceDep describes dependency on a specific service, and optionally endpoint.
func (*ServiceDep) Call ¶
func (s *ServiceDep) Call(ctx context.Context, tracer opentracing.Tracer) error
Call makes call to dependency service.
func (*ServiceDep) Validate ¶
func (s *ServiceDep) Validate(r *Registry) error
Validate performs validation and sets defaults.
type ServiceInstance ¶
type ServiceInstance struct { Endpoints []*EndpointInstance // contains filtered or unexported fields }
ServiceInstance represents a single instance of a service.
func (*ServiceInstance) Stop ¶
func (inst *ServiceInstance) Stop()
Stop shuts down the HTTP server and closes the tracer.