lib

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONMarshal

func JSONMarshal(t interface{}) ([]byte, error)

Types

type Config

type Config struct {
	Service struct {
		Vultr struct {
			APIKey string
		}
		DigitalOcean struct {
			APIKey string
		}
		AWS struct {
			AWSAccessKeyID     string
			AWSSecretAccessKey string
			Region             string
		}
		GitHub struct {
			APIKey string
			Orgs   []string
			Users  []string
		}
	}
	Waybar struct {
		Pango       string
		PangoJoiner string
	}
	Menu struct {
		Template  string
		Joiner    string
		IsDefault bool
	}
}

func Cfg

func Cfg() (Config, error)

type Service

type Service struct {
	Client ServiceClient  `json:"-"`
	ID     string         `json:"id"`
	Name   string         `json:"name"`
	Status *ServiceStatus `json:"status"`
}

type ServiceClient

type ServiceClient interface {
	GetServiceStatus() (*ServiceStatus, error)
}

type ServiceStatus

type ServiceStatus struct {
	AccountBalance  decimal.Decimal `json:"account_balance"`
	CurrentCharges  decimal.Decimal `json:"current_charges"`
	PreviousCharges decimal.Decimal `json:"previous_charges"`
}

Jump to

Keyboard shortcuts

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