Git Product home page Git Product logo

goapi's Introduction

goapi

computes the exported API of a set of Go packages

Install

$> go get github.com/vbatts/goapi

Usage

$> goapi -h
Usage of goapi:
  -allow_new
        allow API additions (default true)
  -c string
        optional comma-separated filename(s) to check API against
  -contexts string
        optional comma-separated list of <goos>-<goarch>[-cgo] to override default contexts.
  -except string
        optional filename of packages that are allowed to change without triggering a failure in the tool
  -gopath
        include package names from GOPATH as well
  -next string
        optional filename of tentative upcoming API features for the next release. This file can be lazily maintained. It only affects the delta warnings from the -c file printed on success.
  -v    verbose debugging

Examples

Saving api for a project, and checking against it:

$> goapi -gopath github.com/vbatts/tar-split/tar/asm > asm-api.txt
$> cat asm-api.txt
pkg github.com/vbatts/tar-split/tar/asm, const OptFileCheck = 1
pkg github.com/vbatts/tar-split/tar/asm, const OptFileCheck Options
pkg github.com/vbatts/tar-split/tar/asm, const OptSegment = 2
pkg github.com/vbatts/tar-split/tar/asm, const OptSegment Options
pkg github.com/vbatts/tar-split/tar/asm, const OptVerify = 4
pkg github.com/vbatts/tar-split/tar/asm, const OptVerify Options
pkg github.com/vbatts/tar-split/tar/asm, func NewInputTarStream(io.Reader, storage.Packer, storage.FilePutter) (io.Reader, error)
pkg github.com/vbatts/tar-split/tar/asm, func NewOutputTarStream(storage.FileGetter, storage.Unpacker) io.ReadCloser
pkg github.com/vbatts/tar-split/tar/asm, type Options int
pkg github.com/vbatts/tar-split/tar/asm, var DefaultInputOptions Options
pkg github.com/vbatts/tar-split/tar/asm, var DefaultOutputOptions Options
$> goapi -gopath -c asm-api.txt github.com/vbatts/tar-split/tar/asm
$> echo $?
0

Seeing the API for a recursive path:

$> goapi $(go list crypto/...)
pkg crypto, const MD4 = 1
pkg crypto, const MD4 Hash
pkg crypto, const MD5 = 2
pkg crypto, const MD5 Hash
[...]
pkg crypto/aes, const BlockSize = 16
pkg crypto/aes, const BlockSize ideal-int
pkg crypto/aes, func NewCipher([]uint8) (cipher.Block, error)
pkg crypto/aes, method (KeySizeError) Error() string
pkg crypto/aes, type KeySizeError int
pkg crypto/cipher, func NewCBCDecrypter(Block, []uint8) BlockMode
pkg crypto/cipher, func NewCBCEncrypter(Block, []uint8) BlockMode
[...]

goapi's People

Contributors

vbatts avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.