user

package
v0.0.0-...-be26699 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2015 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const InfoCommandDoc = `` /* 958-byte string literal not displayed */
View Source
const ListCommandDoc = `
List all the current users in the Juju server.

See Also:
   juju user info
`

Variables

This section is empty.

Functions

func NewSuperCommand

func NewSuperCommand() cmd.Command

NewSuperCommand creates the user supercommand and registers the subcommands that it supports.

func UserFriendlyDuration

func UserFriendlyDuration(when, now time.Time) string

UserFriendlyDuration translates a time in the past into a user friendly string representation relative to the "now" time argument.

Types

type AddCommand

type AddCommand struct {
	UserCommandBase
	User        string
	DisplayName string
	Password    string
	OutPath     string
	Generate    bool
}

AddCommand adds new users into a Juju Server.

func (*AddCommand) Info

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

Info implements Command.Info.

func (*AddCommand) Init

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

Init implements Command.Init.

func (*AddCommand) Run

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

Run implements Command.Run.

func (*AddCommand) SetFlags

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

SetFlags implements Command.SetFlags.

type AddUserAPI

type AddUserAPI interface {
	AddUser(username, displayName, password string) (names.UserTag, error)
	Close() error
}

AddUserAPI defines the usermanager API methods that the add command uses.

type ChangePasswordAPI

type ChangePasswordAPI interface {
	SetPassword(username, password string) error
	Close() error
}

ChangePasswordAPI defines the usermanager API methods that the change password command uses.

type ChangePasswordCommand

type ChangePasswordCommand struct {
	UserCommandBase
	Password string
	Generate bool
	OutPath  string
	User     string
}

ChangePasswordCommand changes the password for a user.

func (*ChangePasswordCommand) Info

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

Info implements Command.Info.

func (*ChangePasswordCommand) Init

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

Init implements Command.Init.

func (*ChangePasswordCommand) Run

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

Run implements Command.Run.

func (*ChangePasswordCommand) SetFlags

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

SetFlags implements Command.SetFlags.

type DisableCommand

type DisableCommand struct {
	DisenableUserBase
}

DisableCommand disables users.

func (*DisableCommand) Info

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

Info implements Command.Info.

func (*DisableCommand) Run

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

Info implements Command.Run.

type DisenableUserAPI

type DisenableUserAPI interface {
	EnableUser(username string) error
	DisableUser(username string) error
	Close() error
}

DisenableUserAPI defines the API methods that the disable and enable commands use.

type DisenableUserBase

type DisenableUserBase struct {
	UserCommandBase
	// contains filtered or unexported fields
}

DisenableUserBase common code for enable/disable user commands

func (*DisenableUserBase) Init

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

Init implements Command.Init.

type EnableCommand

type EnableCommand struct {
	DisenableUserBase
}

EnableCommand enables users.

func (*EnableCommand) Info

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

Info implements Command.Info.

func (*EnableCommand) Run

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

Info implements Command.Run.

type EnvironInfoCredsWriter

type EnvironInfoCredsWriter interface {
	Write() error
	SetAPICredentials(creds configstore.APICredentials)
	Location() string
}

EnvironInfoCredsWriter defines methods of the configstore API info that are used to change the password.

type InfoCommand

type InfoCommand struct {
	InfoCommandBase
	Username string
}

InfoCommand retrieves information about a single user.

func (*InfoCommand) Info

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

Info implements Command.Info.

func (*InfoCommand) Init

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

Init implements Command.Init.

func (*InfoCommand) Run

func (c *InfoCommand) Run(ctx *cmd.Context) (err error)

Run implements Command.Run.

func (*InfoCommand) SetFlags

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

SetFlags implements Command.SetFlags.

type InfoCommandBase

type InfoCommandBase struct {
	UserCommandBase
	// contains filtered or unexported fields
}

InfoCommandBase is a common base for 'juju user info' and 'juju user list'.

func (*InfoCommandBase) SetFlags

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

type ListCommand

type ListCommand struct {
	InfoCommandBase
	// contains filtered or unexported fields
}

ListCommand shows all the users in the Juju server.

func (*ListCommand) Info

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

Info implements Command.Info.

func (*ListCommand) Run

func (c *ListCommand) Run(ctx *cmd.Context) (err error)

Run implements Command.Run.

func (*ListCommand) SetFlags

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

SetFlags implements Command.SetFlags.

type ShareEnvironmentAPI

type ShareEnvironmentAPI interface {
	ShareEnvironment(users ...names.UserTag) error
	Close() error
}

ShareEnvironmentAPI defines the client API methods that the add command uses.

type UserCommandBase

type UserCommandBase struct {
	envcmd.EnvCommandBase
}

UserCommandBase is a helper base structure that has a method to get the user manager client.

func (*UserCommandBase) NewUserManagerClient

func (c *UserCommandBase) NewUserManagerClient() (*usermanager.Client, error)

NewUserManagerClient returns a usermanager client for the root api endpoint that the environment command returns.

type UserInfo

type UserInfo struct {
	Username       string `yaml:"user-name" json:"user-name"`
	DisplayName    string `yaml:"display-name" json:"display-name"`
	DateCreated    string `yaml:"date-created" json:"date-created"`
	LastConnection string `yaml:"last-connection" json:"last-connection"`
	Disabled       bool   `yaml:"disabled,omitempty" json:"disabled,omitempty"`
}

UserInfo defines the serialization behaviour of the user information.

type UserInfoAPI

type UserInfoAPI interface {
	UserInfo([]string, usermanager.IncludeDisabled) ([]params.UserInfo, error)
	Close() error
}

UserInfoAPI defines the API methods that the info command uses.

Jump to

Keyboard shortcuts

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