github.com/StackExchange/blackbox/v2@v2.0.1-0.20220331193400-d84e904973ab/docs/dev-code-overview.md (about)

     1  Code Overview
     2  =============
     3  
     4  Here is how the code is laid out.
     5  
     6  TODO(tlim): Add a diagram of the layers
     7  
     8  ```
     9  cmd/blackbox/   The command line tool.
    10               blackbox.go   main()
    11               cli.go        Definition of all subcommands and flags
    12               drive.go      Processes flags and calls functions in verbs.go
    13                     NOTE: These are the only files that are aware of the
    14                           flags.  Everything else gets the flag data passed to it
    15                           as a parameter. This way the remaining system can be
    16                           used as a module.
    17  
    18  pkg/box/        High-level functions related to "the black box".
    19          verbs.go       One function per subcommand.
    20          box.go         Functions for manipulating the files in .blackbox
    21          boxutils.go    Helper functions for the above.
    22  
    23  pkg/bblog/      Module that provides logging facilities.
    24  pkg/bbutil/     Functions that are useful to box, plug-ins, etc.
    25  pkg/tainedname/ Module for printing filenames escaped for Bash.
    26  
    27  models/vcs.go        The interface that defines a VCS plug-in.
    28  models/crypters.go   The interface that defines a GPG plug-in.
    29  
    30  pkg/crypters/   Plug-ins for GPG functionality.
    31  pkg/crypters/gnupg   Plug-in that runs an external gpg binary (found via $PATH)
    32  
    33  pkg/vcs/        Plug-ins for VCS functionality.
    34  pkg/vcs/none        Repo-less mode.
    35  pkg/vcs/git         Git mode.
    36  ```