whyq

package module
v0.0.0-...-a253cfb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

README

whyq-go

Display your https://www.whyq.sg/ orders in terminal.

Installation

make

Config

export WHYQ_URL=https://www.whyq.sg
export WHYQ_EMAIL=<your_email>
export WHYQ_PASSWORD=<your_password>

Usage

~ whyq
1. Mon 2023-06-19 <Item Name 1>
   Optional: <Optional Item Name 1>
2. Tue 2023-06-20 <Item Name 2>
   Optional: <Optional Item Name 2>
etc..

Why I wrote this

I want to have quick access to my office lunch orders. I use my second monitor to display my terminal dashboard, so I can just take a quick look to it.

But I can just visit the site, login, and view my orders?

The site's login session expires quickly, so I need to do this every time I want to see my order. Guess I'm just too lazy 🤷.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(c HttpDoer, baseURL string) *Client

func (*Client) Login

func (c *Client) Login(ctx context.Context, email, password string) error

func (*Client) Logout

func (c *Client) Logout(ctx context.Context) error

func (*Client) Orders

func (c *Client) Orders(ctx context.Context) ([]Order, error)

type HttpDoer

type HttpDoer interface {
	Do(r *http.Request) (*http.Response, error)
}

type Order

type Order struct {
	Date         time.Time
	Item         string
	OptionalItem string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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