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
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.
Click to show internal directories.
Click to hide internal directories.