util

package
Version: v2.9.4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

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

Source Files

Jump to

Keyboard shortcuts

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