Example #1
0
func (c *Cloud) setAuth(args *cloudsigma.Args) *cloudsigma.Args {
	if c.BasicAuth == nil {
		return args
	}
	args.Username = c.BasicAuth.Username
	args.Password = c.BasicAuth.Password
	return args
}
Example #2
0
func (c *Cloud) setArgs(args *cloudsigma.Args) (*cloudsigma.Args, error) {
	if args.RequiresAuth && c.BasicAuth == nil {
		return nil, errors.New("BasicAuth must not be nil.")
	}
	args = c.setAuth(args)
	args.Location = c.Location
	return args, nil
}