utils

package
v0.0.0-...-f6fdd69 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidTaskNameRegexp = regexp.MustCompile(`(?i)^[A-Za-z0-9\-]+$`)

ValidTaskNameRegexp matches task names consisting of alpha-numeric characters and dashes

Functions

func AddConsulEnvToTask

func AddConsulEnvToTask(t *napi.Task)

AddConsulEnvToTask inspects the environment for consul-related variables, adding any found to the given task's environment

func PeerControlAddrs

func PeerControlAddrs(consul *capi.Client, service, tag string) ([]ma.Multiaddr, error)

func StringPtr

func StringPtr(str string) *string

StringPtr stack allocates a string literal and returns a reference to it

Types

type NodeOptions

type NodeOptions map[string]interface{}

func (NodeOptions) Bool

func (opts NodeOptions) Bool(key string) (bool, bool)

func (NodeOptions) Float

func (opts NodeOptions) Float(key string) (float64, bool)

func (NodeOptions) Int

func (opts NodeOptions) Int(key string) (int, bool)

func (NodeOptions) Object

func (opts NodeOptions) Object(key string) (NodeOptions, bool)

func (NodeOptions) Slice

func (opts NodeOptions) Slice(key string) ([]interface{}, bool)

func (NodeOptions) String

func (opts NodeOptions) String(key string) (string, bool)

func (NodeOptions) StringSlice

func (opts NodeOptions) StringSlice(key string) ([]string, bool)

Jump to

Keyboard shortcuts

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