cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cmd contains all cli commands, their arguments and tests to them

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonOptionsCommander

type CommonOptionsCommander interface {
	SetCommon(commonOpts CommonOpts)
	Execute(args []string) error
}

CommonOptionsCommander extends flags.Commander with SetCommon All commands should implement this interfaces

type CommonOpts

type CommonOpts struct {
	Version string
}

CommonOpts sets externally from main, shared across all commands

func (*CommonOpts) SetCommon

func (c *CommonOpts) SetCommon(opts CommonOpts)

SetCommon satisfies CommonOptionsCommander interface and sets common option fields The method called by main for each command

type Server

type Server struct {
	ServiceURL string `long:"service_url" env:"SERVICE_URL" description:"http service url" default:"http://localhost:8080"`
	Port       int    `long:"service_port" env:"SERVICE_PORT" description:"http server port" default:"8080"`

	WebRoot string `long:"web-root" env:"WEB_ROOT" default:"./web" description:"web root directory"`

	CommonOpts
}

Server runs REST API web server

func (*Server) Execute

func (s *Server) Execute(_ []string) error

Execute runs http web server

Jump to

Keyboard shortcuts

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