github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/cmd/juju/user/export_test.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package user
     5  
     6  var (
     7  	RandomPasswordNotify = &randomPasswordNotify
     8  	ReadPassword         = &readPassword
     9  	ServerFileNotify     = &serverFileNotify
    10  	WriteServerFile      = writeServerFile
    11  )
    12  
    13  // NewAddCommand returns an AddCommand with the api provided as specified.
    14  func NewAddCommand(api AddUserAPI) *AddCommand {
    15  	return &AddCommand{
    16  		api: api,
    17  	}
    18  }
    19  
    20  // NewChangePasswordCommand returns a ChangePasswordCommand with the api
    21  // and writer provided as specified.
    22  func NewChangePasswordCommand(api ChangePasswordAPI, writer EnvironInfoCredsWriter) *ChangePasswordCommand {
    23  	return &ChangePasswordCommand{
    24  		api:    api,
    25  		writer: writer,
    26  	}
    27  }
    28  
    29  // NewDisableCommand returns a DisableCommand with the api provided as
    30  // specified.
    31  func NewDisableCommand(api DisenableUserAPI) *DisableCommand {
    32  	return &DisableCommand{
    33  		DisenableUserBase{
    34  			api: api,
    35  		},
    36  	}
    37  }
    38  
    39  // NewEnableCommand returns a EnableCommand with the api provided as
    40  // specified.
    41  func NewEnableCommand(api DisenableUserAPI) *EnableCommand {
    42  	return &EnableCommand{
    43  		DisenableUserBase{
    44  			api: api,
    45  		},
    46  	}
    47  }
    48  
    49  // NewInfoCommand returns an InfoCommand with the api provided as specified.
    50  func NewInfoCommand(api UserInfoAPI) *InfoCommand {
    51  	return &InfoCommand{
    52  		InfoCommandBase: InfoCommandBase{
    53  			api: api,
    54  		},
    55  	}
    56  }
    57  
    58  // NewListCommand returns a ListCommand with the api provided as specified.
    59  func NewListCommand(api UserInfoAPI) *ListCommand {
    60  	return &ListCommand{
    61  		InfoCommandBase: InfoCommandBase{
    62  			api: api,
    63  		},
    64  	}
    65  }