You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: userpass.go
    path of file: ./repos/vault/api/auth/userpass
    
    the code of the file until where you have to start completion: // Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package userpass

import (
	"context"
	"fmt"
	"io"
	"os"
	"strings"

	"github.com/hashicorp/vault/api"
)

type UserpassAuth struct {
	mountPath    string
	username     string
	password     string
	passwordFile string
	passwordEnv  string
}

type Password struct {
	// Path on the file system where the password corresponding to this
	// application's Vault role can be found.
	FromFile string
	// The name of the environment variable containing the password
	// that corresponds to this application's Vault role.
	FromEnv string
	// The password as a plaintext string value.
	FromString string
}

var _ api.AuthMethod = (*UserpassAuth)(nil)

type LoginOption func(a *UserpassAuth) error

const (
	defaultMountPath = "userpass"
)

// NewUserpassAuth ini
    
func (a *UserpassAuth) Login(ctx context.Context, client *api.Client) (*api.Secret, error) {
	if ctx == nil {
		ctx = context.Background()
	}

	loginData := make(map[string]interface{})

	if a.passwordFile != "" {
		passwordValue, err := a.readPasswordFromFile()
		if err != nil {
			return nil, fmt.Errorf("error reading password: %w", err)
		}
		loginData["password"] = passwordValue
	} else if a.passwordEnv != "" {
		passwordValue := os.Getenv(a.passwordEnv)
		if passwordValue == "" {
			return nil, fmt.Errorf("password was specified with an environment variable with an empty value")
		}
		loginData["password"] = passwordValue
	} else {
		loginData["password"] = a.password
	}

	path := fmt.Sprintf("auth/%s/login/%s", a.mountPath, a.username)
	resp, err := client.Logical().WriteWithContext(ctx, path, loginData)
	if err != nil {
		return nil, fmt.Errorf("unable to log in with userpass auth: %w", err)
	}

	return resp, nil
}