util

package
Version: v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DevelopmentEnv is the name of the environment variable used to mark the running mode of the application
	DevelopmentEnv = "GO_ENV"
	// WorkingPathEnv is the name of the environment variable used to mark the directory where the application runs
	WorkingPathEnv = "GO_WORKING_PATH"

	// DEV is a development pattern markup constant
	DEV = "development"
	// TESTING is a testing pattern markup constant
	TESTING = "testing"
	// PROD is a production pattern markup constant
	PROD = "production"
)

Variables

This section is empty.

Functions

func Development

func Development() bool

Development determines whether or not it is currently in development mode GO_ENV = development

func Env

func Env(name string) string

Env gets the specified environment variable

func FromWebSafeBase64 added in v0.0.12

func FromWebSafeBase64(str string) string

func GOENV

func GOENV() string

GOENV gets application running mode

func Production

func Production() bool

Production determines whether or not it is currently in production mode GO_ENV != testing && GO_ENV != development

func SetEnv

func SetEnv(name, value string) error

SetEnv sets environment variable

func SubStr added in v0.0.12

func SubStr(str string, start int, length int) string

SubStr 截取字符串 start 起点下标 length 需要截取的长度

func SubString added in v0.0.12

func SubString(str string, start int, end int) string

SubString 截取字符串 start 起点下标 end 终点下标(不包括)

func Testing

func Testing() bool

Testing determines whether or not it is currently in testing mode GO_ENV = testing

func ToWebSafeBase64 added in v0.0.12

func ToWebSafeBase64(str string) string

Types

This section is empty.

Source Files

Directories

Path Synopsis
Package inflection pluralizes and singularizes English nouns.
Package inflection pluralizes and singularizes English nouns.
Package now is a time toolkit for golang.
Package now is a time toolkit for golang.
pio
Package strftime is forked from https://github.com/lestrrat-go/strftime 仅保留针对字符串的 format
Package strftime is forked from https://github.com/lestrrat-go/strftime 仅保留针对字符串的 format

Jump to

Keyboard shortcuts

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