Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseService ¶
BaseService has generic methods for sending and parsing expresso service
responses
func NewBaseService ¶
func NewBaseService() *BaseService
NewBaseService returns a BaseService with the default http Client
func (*BaseService) ServiceSend ¶
func (b *BaseService) ServiceSend(method string, url string, data interface{}, i interface{}) error
ServiceSend sends a request of type METHOD to the url with data as the
JSON payload and puts the response into i
type Bloodlines ¶
type Bloodlines interface { GetAllContent(offset int, limit int) ([]*models.Content, error) NewContent(newContent *models.Content) (*models.Content, error) GetContentByID(id uuid.UUID) (*models.Content, error) UpdateContent(update *models.Content) (*models.Content, error) DeleteContent(id uuid.UUID) error GetAllReceipts(offset int, limit int) ([]*models.Receipt, error) SendReceipt(receipt *models.Receipt) (*models.Receipt, error) GetReceiptByID(id uuid.UUID) (*models.Receipt, error) GetAllTriggers(offset int, limit int) ([]*models.Trigger, error) NewTrigger(t *models.Trigger) (*models.Trigger, error) GetTriggerByKey(key string) (*models.Trigger, error) UpdateTrigger(update *models.Trigger) (*models.Trigger, error) DeleteTrigger(key string) error ActivateTrigger(key string, receipt *models.Receipt) (*models.SendRequest, error) NewPreference(id uuid.UUID) (*models.Preference, error) GetPreference(id uuid.UUID) (*models.Preference, error) UpdatePreference(*models.Preference) (*models.Preference, error) DeletePreference(id uuid.UUID) error }
Bloodlines wraps all the methods of the bloodlines API
func NewBloodlines ¶
func NewBloodlines(config config.Bloodlines) Bloodlines
NewBloodlines creates and returns a Bloodlines struct pointed at the service denoted in config
type MySQL ¶
MySQL implements SQL with the mysql driver
type Rabbit ¶
type Rabbit struct { Conn *amqp.Connection Channel *amqp.Channel Queue *amqp.Queue Config config.Rabbit }
Rabbit stores references to RabbitMQ connections, channels, queues, and config
type RabbitI ¶
type RabbitI interface { Produce(interface{}) error Consume() (<-chan amqp.Delivery, error) Destroy() }
RabbitI describes the gateway for interacting with RabbitMQ
type SQL ¶
type SQL interface { Modify(string, ...interface{}) error Select(string, ...interface{}) (*sql.Rows, error) Destroy() }
SQL describes the implementation of any sql gateway
type Sendgrid ¶
type Sendgrid struct {
// contains filtered or unexported fields
}
Sendgrid implements SendgridI for a given sendgrid config
type SendgridI ¶
SendgridI is the interface for sendgrid gateways
func NewSendgrid ¶
NewSendgrid returns a pointer to a Sendgrid struct
type ServiceResponse ¶
type ServiceResponse struct { Msg string `json:"message,omitempty"` Data interface{} `json:"data,omitempty"` Success bool `json:"success,omitempty"` }
ServiceResponse is used to unmarshal data from expresso services. It can be used in conjunction with the following methods like this:
data, _ := ServiceGet(url) var c []*models.Content err := json.Unmarshal(data, &c)
Since ServiceGet returns data as a []byte, we can unmarshal it to whatever is needed in the calling method. Here, its []*models.Content