core

package
v0.0.0-...-8276e37 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: NCSA Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ToolName contains the name of the application.
	ToolName string = "Coinspy"
	// ToolVersion contains the version number of the application.
	ToolVersion string = "2.0.0-dev"
	// ToolID contains a user-agent-style representation of ToolName/ToolVersion.
	ToolID string = ToolName + "/" + ToolVersion
	// ToolURL contains the URL where the application can be found.
	ToolURL string = "https://gitlab.com/rbrt-weiler/coinspy"

	// EnvFileName contains the expected name for the env file.
	EnvFileName string = ".coinspyenv"
	// LineBreak defines the format of linebreaks in the Pushover message.
	LineBreak string = "\r\n"
	// PushoverMessageLength defines the maximum length of a Pushover message.
	PushoverMessageLength int = 1024

	// ErrSuccess means no error.
	ErrSuccess int = 0
	// ErrGeneric represents an generic error.
	ErrGeneric int = 1
	// ErrUsage is thrown when the usage message is shown.
	ErrUsage int = 2
)

Variables

View Source
var (
	// Config stores the parsed CLI arguments.
	Config types.AppConfig
	// Cons is a helper variable used for printing output.
	Cons consolehelper.ConsoleHelper
)

Functions

func CheckArguments

func CheckArguments()

CheckArguments performs a sanity check on the parsed CLI arguments.

func HTMLizeMessage

func HTMLizeMessage(message string) (htmlMessage string)

HTMLizeMessage adds HTML links to Yahoo finance charts to each line.

func LoadEnv

func LoadEnv()

LoadEnv loads the env file, if available.

func ProviderList

func ProviderList() (providers map[string][]string, err error)

ProviderList returns a map containing all possible providers. The key of the map is the provider name, while the value - an array - contains all possible markets for that provider.

func SanitizeMessage

func SanitizeMessage(message string) (messageParts []string, err error)

SanitizeMessage checks the length of a message and returns an array of strings, each containing a part that will go through Pushover without being cut off.

func SendPushoverMessage

func SendPushoverMessage(token string, user string, message string, asOf time.Time) (err error)

SendPushoverMessage is used to send a Pushover notification.

func SetupFlags

func SetupFlags()

SetupFlags configures and parses all possible CLI arguments.

Types

This section is empty.

Jump to

Keyboard shortcuts

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