cwp

package module
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 5 Imported by: 0

README

cwp (Current Weather Print) 😟

build Version

Coverage Status codebeat badge Go Report Card

  • cwp version 0.2.10
  • 指定した場所の気象情報をCLI上に表示するコマンド

Description

  • OpenWeatherMap(https://openweathermap.org/) が提供しているAPI を使用して指定した場所の天気や気温を取得する
  • API から取得した情報 CLI上に表示する
  • 出力項目は,天気・気温
    • 出力形式は,デフォルトはプレーンテキスト
    • (ex) 天気: 晴れ☀️ 気温: 22度

Usage

$ cwp [オプション]

オプション:
    -place:  天気予報を行う場所を指定(デフォルトは日本)
    -units: 測定単位
    -lang: 出力言語(デフォルトは日本語)
    -format: 出力形式を指定(デフォルトはプレーンテキスト)
    -version: cwpのバージョン情報を表示
    -help: cwpコマンドのバージョン情報および利用可能なオプションを表示

License

MIT License

About

License

Developers

  • Nakaoka Tomoki

Icon

Icon

Documentation

Overview

package urleap

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitly

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

func NewBitly

func NewBitly(group string) *Bitly

func (*Bitly) Delete

func (bitly *Bitly) Delete(config *Config, shortenURL string) error

func (*Bitly) Groups

func (bitly *Bitly) Groups(config *Config) ([]*Group, error)

func (*Bitly) List

func (bitly *Bitly) List(config *Config) ([]*ShortenUrl, error)

func (*Bitly) QRCode

func (bitly *Bitly) QRCode(config *Config, shortenURL string) ([]byte, error)

func (*Bitly) Shorten

func (bitly *Bitly) Shorten(config *Config, url string) (*ShortenUrl, error)

type Config

type Config struct {
	Token   string
	RunMode Mode
}

func NewConfig

func NewConfig(token string, mode Mode) *Config

type Group

type Group struct {
	Guid     string `json:"guid"`
	IsActive bool   `json:"is_active"`
}

type Mode

type Mode int
const (
	Shorten Mode = iota + 1
	List
	ListGroup
	Delete
	QRCode
)

func (Mode) String

func (m Mode) String() string

type ShortenUrl

type ShortenUrl struct {
	Shorten   string `json:"link"`
	Original  string `json:"long_url"`
	IsDeleted bool   `json:"is_deleted"`
	Group     string
}

func (*ShortenUrl) String

func (surl *ShortenUrl) String() string

type URLShortener

type URLShortener interface {
	List(config *Config) ([]*ShortenUrl, error)
	Shorten(config *Config, url string) (*ShortenUrl, error)
	Delete(config *Config, shortenURL string) error
	QRCode(config *Config, shortenURL string) ([]byte, error)
}

Directories

Path Synopsis
cmd
cwp command

Jump to

Keyboard shortcuts

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