Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Amqp ¶
type Amqp struct{}
Amqp is a struct representing all data that could be necessary to properly connect to a broker using the AMQP protocol.
type ConnectionError ¶
type ConnectionError struct {
// contains filtered or unexported fields
}
ConnectionError is a custom error used to give more information about errors returned during a connection to the broker.
func (*ConnectionError) Error ¶
func (c *ConnectionError) Error() string
Error returns the information related to the issue.
func (*ConnectionError) GetProtocol ¶
func (c *ConnectionError) GetProtocol() Protocol
GetProtocol returns the Protocol used by the Sender when the error occurred.
type Message ¶
Message is the representation of a message to send. It composed of the filename and its content.
type Mqtt ¶
Mqtt is a struct representing all data that could be necessary to properly connect to a broker using the MQTT protocol.
type Options ¶
type Options struct { BrokerUrl string ClientId string Username string Password string Topic string Protocol Mqtt Amqp Stomp }
Options gathers all data used by the Sender to be correctly built. As the same Options struct can be used to build multiple Sender, it is composed with all protocol related structs.
func (*Options) GetLogOutput ¶
GetLogOutput gives the kind of os.File to use to write logs.
func (*Options) MustBeValid ¶
func (o *Options) MustBeValid()
MustBeValid checks if all data passing through the Options' struct are valid regarding the defined Protocol. This function panic if the options are not valid.
type Protocol ¶
type Protocol string
Protocol is a type representing the protocol which will be used
type Sender ¶
type Sender interface { // Connect is used to establish a connection between Foxy and the broker. // If anything happens during the connection resulting in error, this error is automatically returned. Connect() error // Send is used to send one or multiple files' content to the broker. // If all messages are sent without any issue, the returned value will be nil. Otherwise, the slice of errors // will be filled with all Send(msg []Message) []error // Disconnect is a method allowing the disconnection from the broker to avoid pending connection. Disconnect() }
Sender defines the methods needed by any protocol to be considered as valid by Foxy.
type SendingError ¶
type SendingError struct {
// contains filtered or unexported fields
}
SendingError is a custom error used to give more information about errors returned during sending message to the broker.
func (*SendingError) Error ¶
func (s *SendingError) Error() string
Error returns the information related to the issue.
func (*SendingError) GetFileName ¶
func (s *SendingError) GetFileName() string
GetFileName returns the file's name used from which the content was being extracted.