gonew

package module
v0.0.0-...-3bba280 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 3 Imported by: 0

README

Foobar

Getting started with gonew

Start by installing gonew using go install:

$ go install golang.org/x/tools/cmd/gonew@latest

To copy an existing template, run gonew in your new project's parent directory with two arguments:

  • first, the path to the template you wish to copy, and
  • second, the module name of the project you are creating.

For example:

$ gonew github.com/antiphp/gonew github.com/antiphp/foobar
$ cd ./foobar

Getting started with foobar

$ go run ./cmd/foobar --help
NAME:
   Foobar - A new cli application

USAGE:
   Foobar [global options] command [command options] [arguments...]

VERSION:
   <unknown> @ 1970-01-01T01:00:00+01:00

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h                           show help
   --log.ctx value [ --log.ctx value ]  A list of context field appended to every log. Format: key=value. [$LOG_CTX]
   --log.format value                   Specify the format of logs. Supported formats: 'logfmt', 'json', 'console' [$LOG_FORMAT]
   --log.level value                    Specify the log level. e.g. 'debug', 'info', 'error'. (default: "info") [$LOG_LEVEL]
   --version, -v                        print the version

   Foobar

   --addr value  HTTP address to listen to (default: ":8080") [$ADDR]

Documentation

Overview

Package gonew contains a blueprint project skeleton.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Foobar

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

Foobar represents a foobar application.

func New

func New(log *logger.Logger, opts ...OptFunc) (*Foobar, error)

New returns a new foobar.

func (*Foobar) Foobar

func (f *Foobar) Foobar(_ context.Context, msg string) (string, error)

Foobar runs foobar.

type OptFunc

type OptFunc func(*Foobar)

OptFunc represents an optional foobar configuration.

func WithNotSoRandomOpt

func WithNotSoRandomOpt(rng int) OptFunc

WithNotSoRandomOpt applies a not so random foobar configuration option.

Directories

Path Synopsis
Package api contains the HTTP server.
Package api contains the HTTP server.
cmd
Package cmd contains reusable, command-related helper functions.
Package cmd contains reusable, command-related helper functions.
foobar command
Package main runs the agent.
Package main runs the agent.
internal
http
Package http contains HTTP related helper functions.
Package http contains HTTP related helper functions.
render
Package render renders HTTP responses.
Package render renders HTTP responses.

Jump to

Keyboard shortcuts

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