Documentation
¶
Index ¶
- Constants
- type Config
- type Configurer
- type Job
- func (j *Job) AutoAck() bool
- func (j *Job) Delay() int64
- func (j *Job) GroupID() string
- func (j *Job) Headers() map[string][]string
- func (j *Job) ID() string
- func (j *Job) Metadata() string
- func (j *Job) Name() string
- func (j *Job) Offset() int64
- func (j *Job) Partition() int32
- func (j *Job) Payload() []byte
- func (j *Job) Priority() int64
- func (j *Job) Topic() string
- func (j *Job) UpdatePriority(p int64)
- type JobOptions
- type Jobs
- type JobsConfig
- type LogRecord
- type Logger
- type Plugin
Constants ¶
View Source
const (
PluginName = "monolog"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// TCP server address (default port 9913)
Addr string `mapstructure:"addr"`
// Connection read timeout
ReadTimeout time.Duration `mapstructure:"read_timeout"`
// Maximum message size in bytes
MaxMessageSize int64 `mapstructure:"max_message_size"`
// Jobs integration
Jobs JobsConfig `mapstructure:"jobs"`
}
Config represents Monolog server configuration
func (*Config) InitDefaults ¶
InitDefaults sets default values for configuration
type Configurer ¶
type Configurer interface {
// UnmarshalKey takes a single key and unmarshal it into a Struct
UnmarshalKey(name string, out any) error
// Has checks if a config section exists
Has(name string) bool
}
Configurer interface for configuration access
type Job ¶
type Job struct {
// Job contains name of job broker (usually PHP class)
Job string `json:"job"`
// Ident is unique identifier of the job
Ident string `json:"id"`
// Pld is the payload (usually JSON)
Pld []byte `json:"payload"`
// Hdr contains headers with key-value pairs
Hdr map[string][]string `json:"headers"`
// Options contains job execution options
Options *JobOptions `json:"options,omitempty"`
}
Job represents a job message to be pushed to Jobs plugin Implements jobs.Message interface
func (*Job) UpdatePriority ¶
type JobOptions ¶
type JobOptions struct {
// Priority is job priority, default - 10
Priority int64 `json:"priority"`
// Pipeline manually specified pipeline
Pipeline string `json:"pipeline,omitempty"`
// Delay defines time duration to delay execution for
Delay int64 `json:"delay,omitempty"`
// AutoAck use to ack a job right after it arrived from the driver
AutoAck bool `json:"auto_ack"`
}
JobOptions carry information about how to handle given job
type JobsConfig ¶
type JobsConfig struct {
Pipeline string `mapstructure:"pipeline"` // Target pipeline in Jobs
Priority int64 `mapstructure:"priority"` // Default priority for jobs
Delay int64 `mapstructure:"delay"` // Default delay (0 = immediate)
AutoAck bool `mapstructure:"auto_ack"` // Auto-acknowledge jobs
}
JobsConfig configures Jobs plugin integration
type LogRecord ¶
type LogRecord struct {
Event string `json:"event"` // Always "LOG_RECEIVED"
UUID string `json:"uuid"` // Unique log record identifier
ClientID int `json:"client_id"` // TCP connection ID
RemoteAddr string `json:"remote_addr"` // Client IP:port
ReceivedAt time.Time `json:"received_at"` // Server timestamp
Payload map[string]any `json:"payload"` // Parsed Monolog JSON record
Project *string `json:"project,omitempty"` // Project name (from context)
Error *string `json:"error,omitempty"` // Parse error if any
}
LogRecord represents a parsed Monolog log record for Jobs
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is the Monolog server plugin
Click to show internal directories.
Click to hide internal directories.