automate

package
v0.0.0-...-9625bed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2024 License: GPL-3.0 Imports: 9 Imported by: 3

README

Library that sends Cloud Messages using Automate API.

SendFormattedCloudMessage sends message formatted for the Cloud Receiver flow (download):

Automate flow

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudMessage

type CloudMessage struct {
	// Secret and DefaultTo can be stored in config. Secret is required.
	// https://llamalab.com/automate/cloud/ - generate secret.
	Secret    string
	DefaultTo string
	// contains filtered or unexported fields
}

func Create

func Create() (*CloudMessage, error)

func (*CloudMessage) Send

func (c *CloudMessage) Send(msg string)

Sends message to the default recipient.

func (*CloudMessage) SendTo

func (c *CloudMessage) SendTo(to string, msg string)

Sends message to the custom recipient.

func (*CloudMessage) SendUrgent

func (c *CloudMessage) SendUrgent(msg string)

Sends message to the default recipient with priority set to urgent. Note: Formatted payload with priority is supported only if UseFormattedPayload was called.

func (*CloudMessage) SendUrgentTo

func (c *CloudMessage) SendUrgentTo(to string, msg string)

Sends message to the custom recipient with priority set to urgent. Note: Formatted payload with priority is supported only if UseFormattedPayload was called.

func (*CloudMessage) UseFormattedPayload

func (c *CloudMessage) UseFormattedPayload(appName string)

When appName is set, the formatted payload will be used: $from [$hostname]|$priority|$message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL