Documentation
¶
Overview ¶
Package megaphone provides a client for Megaphone, Redbubble's event broadcasting system for inter-service communication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigError ¶
type ConfigError struct {
// contains filtered or unexported fields
}
ConfigError is returned when the configuration provided for a Client is invalid.
func NewConfigError ¶
func NewConfigError(e error) *ConfigError
NewConfigError returns a general ConfigError.
func NewConfigErrorWithField ¶
func NewConfigErrorWithField(e error, field string) *ConfigError
NewConfigErrorWithField returns a ConfigError with details about the invalid Config field.
func (*ConfigError) Error ¶
func (ce *ConfigError) Error() string
type FluentdClient ¶ added in v1.0.0
type FluentdClient struct { FluentdConfig // contains filtered or unexported fields }
Client provides a standard interface to publish events to Megaphone. Conventionally, a FileLogger is used if no configuration for a FluentLogger is provided, allowing for easy local development in absence of a local Megaphone Fluentd container.
func (*FluentdClient) Publish ¶ added in v1.0.0
func (c *FluentdClient) Publish(topic, subtopic, schema, partitionKey string, payload []byte) (err error)
Publish sends an event to Megaphone, or to a local file depending on the Client configuration.
func (*FluentdClient) PublishRawMessage ¶ added in v1.1.0
func (c *FluentdClient) PublishRawMessage(streamName string, partitionKey string, messageBytes []byte) error
type FluentdConfig ¶ added in v1.0.0
FluentdConfig holds the configuration for a FluentdClient.
type KinesisSynchronousPublisher ¶ added in v1.0.0
type KinesisSynchronousPublisher struct {
// contains filtered or unexported fields
}
func NewKinesisSynchronousPublisher ¶ added in v1.0.0
func NewKinesisSynchronousPublisher(config kinesisclient.Config) (*KinesisSynchronousPublisher, error)
func (*KinesisSynchronousPublisher) Publish ¶ added in v1.0.0
func (c *KinesisSynchronousPublisher) Publish(topic, subtopic, schema, partitionKey string, payload []byte) error
func (*KinesisSynchronousPublisher) PublishRawMessage ¶ added in v1.1.0
func (c *KinesisSynchronousPublisher) PublishRawMessage(streamName string, partitionKey string, messageBytes []byte) error
type PayloadError ¶
type PayloadError struct {
// contains filtered or unexported fields
}
PayloadError is returned when the event payload to be published is invalid.
func NewPayloadError ¶
func NewPayloadError(e error, payload string) *PayloadError
NewPayloadError returns a PayloadError for a given event payload.
func (*PayloadError) Error ¶
func (pe *PayloadError) Error() string
type PublicationError ¶
type PublicationError struct {
// contains filtered or unexported fields
}
PublicationError is returned when an event couldn't be published.
func NewPublicationError ¶
func NewPublicationError(e error, event string) *PublicationError
NewPublicationError return a PublicationError for a given event.
func (*PublicationError) Error ¶
func (pe *PublicationError) Error() string
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package logger provides a logger that the Megaphone client can use to publish to a local file or to Megaphone via Fluentd.
|
Package logger provides a logger that the Megaphone client can use to publish to a local file or to Megaphone via Fluentd. |