Documentation ¶
Overview ¶
These functions are coming from consul/lib/cluster.go
These functions are coming from consul/lib/eof.go
These functions are coming from consul/lib/math.go
These functions are coming from consul/path.go
Index ¶
- func BoolToPtr(b bool) *bool
- func CheckHCLKeys(node ast.Node, valid []string) error
- func CheckNamespaceScope(provided string, requested []string) []string
- func CleanEnvVar(s string, r byte) string
- func CleanFilename(filename string, replace string) string
- func CleanFilenameASCIIOnly(filename string, replace string) string
- func CleanFilenameStrict(filename string, replace string) string
- func CompareMapStringString(a, b map[string]string) bool
- func CompareSliceSetString(a, b []string) bool
- func CompareTimePtrs(a, b *time.Duration) bool
- func CopyMapStringFloat64(m map[string]float64) map[string]float64
- func CopyMapStringInt(m map[string]int) map[string]int
- func CopyMapStringInterface(m map[string]interface{}) map[string]interface{}
- func CopyMapStringSliceString(m map[string][]string) map[string][]string
- func CopyMapStringString(m map[string]string) map[string]string
- func CopyMapStringStruct(m map[string]struct{}) map[string]struct{}
- func CopySliceInt(s []int) []int
- func CopySliceString(s []string) []string
- func EnsurePath(path string, dir bool) error
- func Float64ToPtr(f float64) *float64
- func HashUUID(input string) (output string, hashed bool)
- func Int32ToPtr(i int32) *int32
- func Int64ToPtr(i int64) *int64
- func Int8ToPtr(i int8) *int8
- func IntMax(a, b int) int
- func IntMin(a, b int) int
- func IntToPtr(i int) *int
- func IsErrEOF(err error) bool
- func IsUUID(str string) bool
- func IsValidInterpVariable(str string) bool
- func MapStringStringSliceValueSet(m map[string][]string) []string
- func MaxInt(a, b int) int
- func MergeMapStringString(m map[string]string, n map[string]string) map[string]string
- func MinInt(a, b int) int
- func PathEscapesSandbox(sandboxDir, path string) bool
- func RandomStagger(intv time.Duration) time.Duration
- func RateScaledInterval(rate float64, min time.Duration, n int) time.Duration
- func RemoveEqualFold(xs *[]string, search string)
- func SetToSliceString(set map[string]struct{}) []string
- func SliceSetDisjoint(first, second []string) (bool, []string)
- func SliceStringContains(list []string, item string) bool
- func SliceStringHasPrefix(list []string, prefix string) bool
- func SliceStringIsSubset(larger, smaller []string) (bool, []string)
- func SliceStringToSet(s []string) map[string]struct{}
- func StringHasPrefixInSlice(s string, prefixes []string) bool
- func StringToPtr(str string) *string
- func TimeToPtr(t time.Duration) *time.Duration
- func Uint64Max(a, b uint64) uint64
- func Uint64ToPtr(u uint64) *uint64
- func UintToPtr(u uint) *uint
- func UnusedKeys(obj interface{}) error
- type StopFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckNamespaceScope ¶ added in v0.12.2
CheckNamespaceScope ensures that the provided namespace is equal to or a parent of the requested namespaces. Returns requested namespaces which are not equal to or a child of the provided namespace.
func CleanEnvVar ¶ added in v0.5.5
CleanEnvVar replaces all occurrences of illegal characters in an environment variable with the specified byte.
func CleanFilename ¶ added in v1.0.0
CleanFilename replaces invalid characters in filename
func CleanFilenameASCIIOnly ¶ added in v1.0.0
CleanFilenameASCIIOnly replaces invalid and non-ASCII characters in filename
func CleanFilenameStrict ¶ added in v1.0.0
CleanFilenameStrict replaces invalid and punctuation characters in filename
func CompareMapStringString ¶ added in v0.9.0
CompareMapStringString returns true if the maps are equivalent. A nil and empty map are considered not equal.
func CompareSliceSetString ¶ added in v0.10.0
CompareSliceSetString returns true if the slices contain the same strings. Order is ignored. The slice may be copied but is never altered. The slice is assumed to be a set. Multiple instances of an entry are treated the same as a single instance.
func CompareTimePtrs ¶ added in v0.12.4
CompareTimePtrs return true if a is the same as b.
func CopyMapStringInterface ¶ added in v0.12.4
func CopyMapStringSliceString ¶ added in v0.6.1
CopyMapStringSliceString copies a map of strings to string slices such as http.Header
func CopyMapStringStruct ¶ added in v0.6.1
func CopySliceInt ¶
func CopySliceString ¶
func EnsurePath ¶ added in v1.3.0
EnsurePath is used to make sure a path exists
func Float64ToPtr ¶ added in v0.9.0
Float64ToPtr returns the pointer to an float64
func HashUUID ¶ added in v0.6.0
HashUUID takes an input UUID and returns a hashed version of the UUID to ensure it is well distributed.
func Int32ToPtr ¶ added in v1.3.0
Int32ToPtr returns the pointer to an int32
func Int64ToPtr ¶ added in v0.6.0
Int64ToPtr returns the pointer to an int64
func IsErrEOF ¶ added in v1.3.0
IsErrEOF returns true if we get an EOF error from the socket itself, or an EOF equivalent error from yamux.
func IsValidInterpVariable ¶ added in v0.9.0
IsValidInterpVariable returns true if a valid dotted variable names for interpolation. The string must begin with one or more non-dot characters which may be followed by sequences containing a dot followed by a one or more non-dot characters.
func MapStringStringSliceValueSet ¶
MapStringStringSliceValueSet returns the set of values in a map[string][]string
func MergeMapStringString ¶ added in v1.2.13
MergeMapStringString will merge two maps into one. If a duplicate key exists the value in the second map will replace the value in the first map. If both maps are empty or nil this returns an empty map.
func PathEscapesSandbox ¶ added in v0.10.7
PathEscapesSandbox returns whether previously cleaned path inside the sandbox directory (typically this will be the allocation directory) escapes.
func RandomStagger ¶ added in v1.3.0
RandomStagger returns an interval between 0 and the duration
func RateScaledInterval ¶ added in v1.3.0
RateScaledInterval is used to choose an interval to perform an action in order to target an aggregate number of actions per second across the whole cluster.
func RemoveEqualFold ¶ added in v0.11.0
RemoveEqualFold removes the first string that EqualFold matches. It updates xs in place
func SetToSliceString ¶ added in v1.3.0
func SliceSetDisjoint ¶
func SliceStringContains ¶ added in v0.12.2
SliceStringContains returns whether item exists at least once in list.
func SliceStringHasPrefix ¶ added in v1.0.13
SliceStringHasPrefix returns true if any string in list starts with prefix
func SliceStringIsSubset ¶
SliceStringIsSubset returns whether the smaller set of strings is a subset of the larger. If the smaller slice is not a subset, the offending elements are returned.
func SliceStringToSet ¶
func StringHasPrefixInSlice ¶ added in v1.0.13
StringHasPrefixInSlice returns true if string starts with any prefix in list
func StringToPtr ¶ added in v0.5.5
StringToPtr returns the pointer to a string
func Uint64ToPtr ¶ added in v0.5.5
Uint64ToPtr returns the pointer to an uint64
func UnusedKeys ¶ added in v0.11.0
func UnusedKeys(obj interface{}) error
UnusedKeys returns a pretty-printed error if any `hcl:",unusedKeys"` is not empty
Types ¶
type StopFunc ¶ added in v1.1.13
type StopFunc func()
StopFunc is used to stop a time.Timer created with NewSafeTimer
func NewSafeTimer ¶ added in v1.1.13
NewSafeTimer creates a time.Timer but does not panic if duration is <= 0.
Using a time.Timer is recommended instead of time.After when it is necessary to avoid leaking goroutines (e.g. in a select inside a loop).
Returns the time.Timer and also a StopFunc, forcing the caller to deal with stopping the time.Timer to avoid leaking a goroutine.
Directories ¶
Path | Synopsis |
---|---|
Package boltdd contains a wrapper around BBoltDB to deduplicate writes and encode values using mgspack.
|
Package boltdd contains a wrapper around BBoltDB to deduplicate writes and encode values using mgspack. |
constraints
|
|
semver
semver is a Semver Constraints package copied from github.com/hashicorp/go-version @ 2046c9d0f0b03c779670f5186a2a4b2c85493a71 Unlike Constraints in go-version, Semver constraints use Semver 2.0 ordering rules and only accept properly formatted Semver versions.
|
semver is a Semver Constraints package copied from github.com/hashicorp/go-version @ 2046c9d0f0b03c779670f5186a2a4b2c85493a71 Unlike Constraints in go-version, Semver constraints use Semver 2.0 ordering rules and only accept properly formatted Semver versions. |
Package envoy provides a high level view of the variables that go into selecting an envoy version.
|
Package envoy provides a high level view of the variables that go into selecting an envoy version. |
Copied from github.com/hashicorp/consul/sdk/freeport and tweaked for use by Nomad.
|
Copied from github.com/hashicorp/consul/sdk/freeport and tweaked for use by Nomad. |
grpc-middleware
|
|
Package noxssrw (No XSS ResponseWriter) behaves like the Go standard library's ResponseWriter by detecting the Content-Type of a response if it has not been explicitly set.
|
Package noxssrw (No XSS ResponseWriter) behaves like the Go standard library's ResponseWriter by detecting the Content-Type of a response if it has not been explicitly set. |
pluginutils
|
|
catalog
Package catalog is used to register internal plugins such that they can be loaded.
|
Package catalog is used to register internal plugins such that they can be loaded. |
Code generated by go generate; DO NOT EDIT.
|
Code generated by go generate; DO NOT EDIT. |
The archive utilities manage the internal format of a snapshot, which is a tar file with the following contents: meta.json - JSON-encoded snapshot metadata from Raft state.bin - Encoded snapshot data from Raft SHA256SUMS - SHA-256 sums of the above two files The integrity information is automatically created and checked, and a failure there just looks like an error to the caller.
|
The archive utilities manage the internal format of a snapshot, which is a tar file with the following contents: meta.json - JSON-encoded snapshot metadata from Raft state.bin - Encoded snapshot data from Raft SHA256SUMS - SHA-256 sums of the above two files The integrity information is automatically created and checked, and a failure there just looks like an error to the caller. |
Package testlog creates a *log.Logger backed by *testing.T to ease logging in tests.
|
Package testlog creates a *log.Logger backed by *testing.T to ease logging in tests. |
Package testtask implements a portable set of commands useful as stand-ins for user tasks.
|
Package testtask implements a portable set of commands useful as stand-ins for user tasks. |