gapi

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

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

Go to latest
Published: Mar 22, 2023 License: BSD-2-Clause Imports: 5 Imported by: 0

README

gapi

Command line tool for calling Google API. https://github.com/google/google-api-go-client/

Based on https://github.com/google/google-api-go-client/tree/master/examples

Add an authentication method, Made it be able to call APIs that I want to use by CLI.

Command line

$ gapi [global options] <command> <sub-command>

Options:
  -cachetoken
        cache the OAuth 2.0 token (default true)
  -clientid string
        OAuth 2.0 Client ID.  If non-empty, overrides --clientid_file
  -clientid-file string
        Name of a file containing just the project's OAuth 2.0 Client ID from https://developers.google.com/console. (default "clientid.dat")
  -debug
        show HTTP traffic
  -httptest.serve string
        if non-empty, httptest.NewServer serves on this address and blocks
  -secret string
        OAuth 2.0 Client Secret.  If non-empty, overrides --secret_file
  -secret-file string
        Name of a file containing just the project's OAuth 2.0 Client Secret from https://developers.google.com/console. (default "clientsecret.dat")
  -service-account string
        /path/to/service-account.json
  -version
        show Version
stat
  • Retrieve link stats of URL which is generated by DynamicLinks.

      $ gapi [auth args] firebase-dynamiclinks stat https://xyz.app.goo.gl/some
    
  • Options for stat.

    -duration int
          Duration days (default 10)
    -file string
          /path/to/urls.txt
    -parallelism int
          Number of simultaneous requests (default 5)
    

Build

$ make

Requirement

  • Go 1.20
  • git
  • make

License

BSD 2-Clause License

SEE LICENSE

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListCommandNames

func ListCommandNames() []string

func RegisterCommand

func RegisterCommand(name, scope string, main CommandFunc)

Types

type CommandEntry

type CommandEntry struct {
	Func  CommandFunc
	Scope string
}

func GetCommand

func GetCommand(name string) (*CommandEntry, error)

type CommandFunc

type CommandFunc func(c *http.Client, argv []string) int

type LogTransport

type LogTransport struct {
	Rt http.RoundTripper
}

func (*LogTransport) RoundTrip

func (t *LogTransport) RoundTrip(req *http.Request) (*http.Response, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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