healthplanet

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 16 Imported by: 0

README

healthplanet

Test Status MIT License PkgGoDev

healthplanet is a cli and client library for healthplanet.jp.

Synopsis

% healthplanet metrics
% healthplanet request -status=innerscan
var token = "deadbeef"
var cli *healthplanet.Client = healthplanet.NewClient(token)
ret, err := cli.Status(context.Background(), "innerscan", time.Now().AddDate(0, 0, -7), time.Now())

Description

healthplanet is a cli and client library for healthplanet.jp.

Installation

# go install
% go install github.com/Songmu/healthplanet/cmd/healthplanet@latest

# Install the latest version. (Install it into ./bin/ by default).
% curl -sfL https://raw.githubusercontent.com/Songmu/healthplanet/main/install.sh | sh -s

# Specify installation directory ($(go env GOPATH)/bin/) and version.
% curl -sfL https://raw.githubusercontent.com/Songmu/healthplanet/main/install.sh | sh -s -- -b $(go env GOPATH)/bin [vX.Y.Z]

# In alpine linux (as it does not come with curl by default)
% wget -O - -q https://raw.githubusercontent.com/Songmu/healthplanet/main/install.sh | sh -s [vX.Y.Z]

Author

Songmu

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, argv []string, outStream, errStream io.Writer) error

Run the healthplanet

Types

type Client

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

Client is a client for healthplanet

func NewClient

func NewClient(token string) *Client

NewClient returns the new client

func (*Client) Status

func (cl *Client) Status(ctx context.Context, status string, from, to time.Time) (*Response, error)

Status returns statuses

type Data

type Data struct {
	Date    string `json:"date"`
	KeyData string `json:"keydata"`
	Model   string `json:"model"`
	Tag     string `json:"tag"`
}

type Response

type Response struct {
	BirthDate string  `json:"birth_date"`
	Data      []*Data `json:"data"`
	Height    string  `json:"height"`
	Sex       string  `json:"sex"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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