cmd

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JujuXDGDataHomeEnvKey is used to override the default
	// XDG Data Home location.
	JujuXDGDataHomeEnvKey = "JUJU_DATA"

	// XDGDataHome is a path where data for the running user
	// should be stored according to the xdg standard.
	XDGDataHome = "XDG_DATA_HOME"
)

Variables

This section is empty.

Functions

func JujuXDGDataHome

func JujuXDGDataHome() string

JujuXDGDataHome returns the current juju home.

func JujuXDGDataHomeDir

func JujuXDGDataHomeDir() string

JujuXDGDataHomeDir returns the directory where juju should store application-specific files

func JujuXDGDataHomePath

func JujuXDGDataHomePath(names ...string) string

JujuXDGDataHomePath returns the path to a file in the current juju home.

func NewListTermsCommand

func NewListTermsCommand() cmd.Command

NewListTermsCommand returns a new command that can be used to list owned Terms and Conditions documents.

func NewPushTermCommand

func NewPushTermCommand() cmd.Command

NewPushTermCommand returns a new command that can be used to create new (revisions) of Terms and Conditions documents.

func NewReleaseTermCommand

func NewReleaseTermCommand() cmd.Command

NewReleaseTermCommand returns a new command that can be used to publish existing owner terms Conditions documents.

func NewShowTermCommand

func NewShowTermCommand() cmd.Command

NewShowTermCommand returns a new command that can be used to shows Terms and Conditions document.

func SetJujuXDGDataHome

func SetJujuXDGDataHome(newJujuXDGDataHomeHome string) string

SetJujuXDGDataHome sets the value of juju home and returns the current one.

Types

type IDMClient

type IDMClient interface {
	// WhoAmI returns the user's username as declared by the identity managed.
	WhoAmI() (string, error)
	// Groups returns public grous the specified user belongs to.
	Groups(username string) ([]string, error)
}

IDMClient defines the interface of an identity client used by the list-terms command.

type TermsId

type TermsId struct {
	Tenant   string
	Owner    string
	Name     string
	Revision int
}

TermsId represents a single term id. The term can either be owned or "public" (meaning there is no owner). The Revision starts at 1. Therefore a value of 0 means the revision is unset.

func ParseTerm

func ParseTerm(s string) (*TermsId, error)

ParseTerm takes a termID as a string and parses it into a Term. A complete term is in the form: tenant:owner/name/revision This function accepts partially specified identifiers typically in one of the following forms: name owner/name owner/name/27 # Revision 27 name/283 # Revision 283 cs:owner/name # Tenant cs

func (*TermsId) String

func (t *TermsId) String() string

String returns the term in canonical form. This would be one of:

tenant:owner/name/revision
tenant:name
owner/name/revision
owner/name
name/revision
name

func (*TermsId) Validate

func (t *TermsId) Validate() error

Validate returns an error if the Term contains invalid data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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