file

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptionsFunc

type OptionsFunc func(*ReadPasswordFromFile)

OptionsFunc is a function used to configure ReadPasswordFromFile

func WithFile

func WithFile(file string) OptionsFunc

WithFile sets the a file where to look for a password

func WithFs

func WithFs(fs afero.Fs) OptionsFunc

WithFs set the filesystem

type ReadPasswordFromFile

type ReadPasswordFromFile struct {
	// contains filtered or unexported fields
}

ReadPasswordFromFile allows you to read a passowrd from a file

func NewReadPasswordFromFile

func NewReadPasswordFromFile(options ...OptionsFunc) *ReadPasswordFromFile

NewReadPasswordFromFile returns a ReadPasswordFromFile

func (*ReadPasswordFromFile) Options

func (s *ReadPasswordFromFile) Options(opts ...OptionsFunc)

Options configure the ReadPasswordFromFile

func (*ReadPasswordFromFile) Read

func (s *ReadPasswordFromFile) Read() (string, error)

Read returns a password from a file. It return an error when the file does not exist or the content of the file can not be read.

Jump to

Keyboard shortcuts

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