common

package
v0.0.0-...-a002913 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConformYAML

func ConformYAML(input interface{}) (interface{}, error)

ConformYAML ensures all keys of any nested maps are strings. This is necessary because YAML unmarshals map[interface{}]interface{} in nested maps, which cannot be serialized by bson. Also, handle []interface{}. cf. gopkg.in/juju/charm.v4/actions.go cleanse

func FormatTime

func FormatTime(t *time.Time, formatISO bool) string

FormatTime returns a string with the local time formatted in an arbitrary format used for status or and localized tz or in UTC timezone and format RFC3339 if u is specified.

func SortStringsNaturally

func SortStringsNaturally(s []string) []string

SortStringsNaturally sorts strings according to their natural sort order.

Types

type ConstraintsAPI

type ConstraintsAPI interface {
	Close() error
	GetEnvironmentConstraints() (constraints.Value, error)
	GetServiceConstraints(string) (constraints.Value, error)
	SetEnvironmentConstraints(constraints.Value) error
	SetServiceConstraints(string, constraints.Value) error
}

Constraints API defines methods on the client API that the get-constraints and set-constraints commands call

type GetConstraintsCommand

type GetConstraintsCommand struct {
	envcmd.EnvCommandBase
	ServiceName string
	// contains filtered or unexported fields
}

GetConstraintsCommand shows the constraints for a service or environment.

func (*GetConstraintsCommand) Info

func (c *GetConstraintsCommand) Info() *cmd.Info

func (*GetConstraintsCommand) Init

func (c *GetConstraintsCommand) Init(args []string) error

func (*GetConstraintsCommand) Run

func (c *GetConstraintsCommand) Run(ctx *cmd.Context) error

func (*GetConstraintsCommand) SetFlags

func (c *GetConstraintsCommand) SetFlags(f *gnuflag.FlagSet)

type SetConstraintsCommand

type SetConstraintsCommand struct {
	envcmd.EnvCommandBase
	ServiceName string

	Constraints constraints.Value
	// contains filtered or unexported fields
}

SetConstraintsCommand shows the constraints for a service or environment.

func (*SetConstraintsCommand) Info

func (c *SetConstraintsCommand) Info() *cmd.Info

func (*SetConstraintsCommand) Init

func (c *SetConstraintsCommand) Init(args []string) (err error)

func (*SetConstraintsCommand) Run

func (c *SetConstraintsCommand) Run(_ *cmd.Context) (err error)

func (*SetConstraintsCommand) SetFlags

func (c *SetConstraintsCommand) SetFlags(f *gnuflag.FlagSet)

Jump to

Keyboard shortcuts

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