cmd

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VerboseFlag bool

	PushApiEndpoint string
	PushToDevices   []string
	PushTitle       string
	PushUrl         string
	PushUrlTitle    string
	PushPriority    string
	PushSound       string
	PushTimestamp   int64
	PushAttachment  string

	LimitsApiEndpoint string
)
View Source
var (
	Version         = "dev"
	ApplicationName = "pushover-cli"
	CommandName     = "pushover-cli"
)

Functions

func ClearConfig

func ClearConfig() (string, error)

ClearConfig will remove the first configuration file that can be found from the system. It will return the path that was removed and a possible error.

func Execute

func Execute()

func GetConfigDir

func GetConfigDir() configdir.ConfigDir

func SaveConfig

func SaveConfig(config *Config)

Types

type ApiRateLimit

type ApiRateLimit struct {
	RequestsTotalPerMonth int64
	RequestsRemaining     int64
	ResetAt               time.Time
}

type ApiResponse

type ApiResponse struct {
	Status  int      `json:"status"`
	Request string   `json:"request"`
	Errors  []string `json:"errors,omitempty"`
}

type Config

type Config struct {
	UserKey  string `json:"user-key"`
	ApiToken string `json:"api-token"`
}

func LoadConfig

func LoadConfig() (config *Config, loaded bool)

LoadConfig tries to load the config that could be stored in many different locations based on the OS. It returns the current config and a flag if the config was successfully loaded.

Jump to

Keyboard shortcuts

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