BUILDING MODERN CLI APPLICATIONS IN GO develop next-level CLIs to improve user experience, increase platform usage, and maximize production /
Evolve the humble CLI using Go and unleash the next generation of powerful, flexible, and empathy-driven interfaces Purchase of the print or Kindle book includes a free PDF eBook Key Features Discover how Go enables the development of elegant and intuitive CLIs Explore a range of CLI development asp...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
[S.l.] :
PACKT PUBLISHING LIMITED,
2023.
|
Edición: | 1st edition. |
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Intro
- Preface
- Title Page
- Copyright
- Dedication
- Contributors
- Table of Contents
- Part 1: Getting Started with a Solid Foundation
- Chapter 1: Understanding CLI Standards
- A brief introduction and history of the command line
- About the history
- Introducing the CLI
- The philosophy of CLI development
- Checklist for a successful CLI
- The guidelines
- Name
- Help and documentation
- Input
- Output
- Configuration
- Security
- Open source community
- Software lifespan and robustness
- Go for CLIs
- Summary
- Questions
- Answers
- Further reading
- Chapter 2: Structuring Go Code for CLI Applications
- Technical requirements
- Commonly used program layouts for robust applications
- Program layouts
- Common folders
- Determining use cases and requirements
- Use cases
- Requirements
- Disadvantages and benefits of use cases and requirements
- Use cases, diagrams, and requirements for a CLI
- Requirements for a metadata CLI
- Structuring an audio metadata CLI application
- Bounded context
- Language
- Entities and value objects
- Aggregation
- Service
- Events
- Repository
- Creating the structure
- Summary
- Questions
- Answers
- Further reading
- Chapter 3: Building an Audio Metadata CLI
- Technical requirements
- Defining the components
- cmd/
- cmd/api/
- cmd/cli/
- cmd/cli/command
- extractors/
- extractors/tags
- extractors/transcript
- internal/interfaces
- models/
- services/metadata
- storage/
- vendor/
- Implementing use cases
- Uploading audio
- Requesting metadata
- Testing a CLI
- Manual testing
- Testing and mocking
- Summary
- Questions
- Answers
- Chapter 4: Popular Frameworks for Building CLIs
- Technical requirements
- Cobra
- a library for building modern CLI applications
- Creating subcommands
- Global, local, and required flags
- Intelligent suggestions
- Automatically generated help and man pages
- Powering your CLI
- Viper
- easy configuration for CLIs
- Configuration types
- Watching for live config changes
- Basic calculator CLI using Cobra and Viper
- The Cobra CLI commands
- The Viper configuration
- Running the basic calculator
- Summary
- Questions
- Answers
- Further reading
- Part 2: The Ins and Outs of a CLI
- Chapter 5: Defining the Command-Line Process
- Technical requirements
- Receiving the input and user interaction
- Defining subcommands, arguments, and flags
- Piping
- Signals and control characters
- User interaction
- Processing data
- Returning the resulting output and defining best practices
- Summary
- Questions
- Answers
- Further reading
- Chapter 6: Calling External Processes and Handling Errors and Timeouts
- Technical requirements
- Calling external processes
- The os/exec package
- Creating commands using the Cmd struct
- Running the command
- Interacting with REST APIs
- Get request
- Pagination