util

package
v2.9.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cliutil contains methods used across all cli commands @todo: get rid of os.Exits and use errors instread

Index

Constants

View Source
const (
	// EnvLocal is a builtin environment, it means services launched
	// with `micro run` will use default, zero dependency implementations for
	// interfaces, like mdns for registry.
	EnvLocal = "local"
	// EnvServer is a builtin environment, it represents your local `micro server`
	EnvServer = "server"
	// EnvPlatform is a builtin environment, the One True Micro Live(tm) environment.
	EnvPlatform = "platform"
)

Variables

This section is empty.

Functions

func AddEnv

func AddEnv(env Env)

func IsLocal

func IsLocal(ctx *ccli.Context) bool

func IsPlatform

func IsPlatform(ctx *ccli.Context) bool

func IsServer

func IsServer(ctx *ccli.Context) bool

func SetEnv

func SetEnv(envName string)

SetEnv selects an environment to be used.

func SetupCommand

func SetupCommand(ctx *ccli.Context)

SetupCommand includes things that should run for each command.

Types

type Env

type Env struct {
	Name         string
	ProxyAddress string
}

func GetEnv

func GetEnv(ctx *ccli.Context) Env

GetEnv returns the current selected environment Does not take

func GetEnvByName

func GetEnvByName(env string) Env

func GetEnvs

func GetEnvs() []Env

Jump to

Keyboard shortcuts

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