Documentation ¶
Index ¶
- Constants
- type ClientAuthType
- type Configurer
- type Driver
- func (d *Driver) Pause(ctx context.Context, p string) error
- func (d *Driver) Push(ctx context.Context, job jobs.Message) error
- func (d *Driver) Resume(ctx context.Context, p string) error
- func (d *Driver) Run(ctx context.Context, p jobs.Pipeline) error
- func (d *Driver) State(ctx context.Context) (*jobs.State, error)
- func (d *Driver) Stop(ctx context.Context) error
- type Item
- func (i *Item) Ack() error
- func (i *Item) Body() []byte
- func (i *Item) Context() ([]byte, error)
- func (i *Item) GroupID() string
- func (i *Item) Headers() map[string][]string
- func (i *Item) ID() string
- func (i *Item) Nack() error
- func (i *Item) NackWithOptions(requeue bool, delay int) error
- func (i *Item) Priority() int64
- func (i *Item) Requeue(headers map[string][]string, delay int) error
- func (i *Item) Respond(_ []byte, _ string) error
- type Options
- type TLS
Constants ¶
View Source
const ( ConnCloseType string = "connection" ConsumeCloseType string = "consume" PublishCloseType string = "publish" StatCloseType string = "stat" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientAuthType ¶
type ClientAuthType string
ClientAuthType TSL auth type
const ( NoClientCert ClientAuthType = "no_client_cert" RequestClientCert ClientAuthType = "request_client_cert" RequireAnyClientCert ClientAuthType = "require_any_client_cert" VerifyClientCertIfGiven ClientAuthType = "verify_client_cert_if_given" RequireAndVerifyClientCert ClientAuthType = "require_and_verify_client_cert" )
type Configurer ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func FromConfig ¶
func FromConfig(tracer *sdktrace.TracerProvider, configKey string, log *zap.Logger, cfg Configurer, pipeline jobs.Pipeline, pq jobs.Queue) (*Driver, error)
FromConfig initializes AMQP pipeline
func FromPipeline ¶
func FromPipeline(tracer *sdktrace.TracerProvider, pipeline jobs.Pipeline, log *zap.Logger, cfg Configurer, pq jobs.Queue) (*Driver, error)
FromPipeline initializes consumer from pipeline
type Item ¶
type Item struct { // Job contains the pluginName of job broker (usually PHP class). Job string `json:"job"` // Ident is a unique identifier of the job, should be provided from outside Ident string `json:"id"` // Payload is string data (usually JSON) passed to Job broker. Payload []byte `json:"payload"` // Options contain a set of PipelineOptions specific to job execution. Can be empty. Options *Options `json:"options,omitempty"` // contains filtered or unexported fields }
func (*Item) Context ¶
Context packs job context (job, id) into binary payload. Not used in the amqp, amqp.Table used instead
type Options ¶
type Options struct { // Priority is job priority, default - 10 // pointer to distinguish 0 as a priority and nil as a priority not set Priority int64 `json:"priority"` // Pipeline manually specified pipeline. Pipeline string `json:"pipeline,omitempty"` // Delay defines time duration to delay execution for. Defaults to none. Delay int `json:"delay,omitempty"` // AutoAck option AutoAck bool `json:"auto_ack"` // AMQP Queue Queue string `json:"queue,omitempty"` // contains filtered or unexported fields }
Options carry information about how to handle a given job.
func (*Options) DelayDuration ¶
DelayDuration returns delay duration in the form of time.Duration.
Click to show internal directories.
Click to hide internal directories.