passwordStore

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FIELD_ID       = "ID"
	FIELD_Key      = "Key"
	FIELD_Raw      = "Raw"
	FIELD_UserKey  = "UserKey"
	FIELD_Password = "Password"
	FIELD_Audit    = "Audit"
)

Define the field set as names

Functions

func ClearDown

func ClearDown(ctx context.Context) error

func Count

func Count() (int, error)

func CountWhere

func CountWhere(field string, value any) (int, error)

func Delete

func Delete(ctx context.Context, id int, note string) error

func DeleteBy

func DeleteBy(ctx context.Context, field string, value any, note string) error

func DeleteByKey

func DeleteByKey(ctx context.Context, key string, note string) error

func Drop

func Drop() error

func Export

func Export(message string)

func ExportCSV

func ExportCSV() error

func FetchDatabaseInstances

func FetchDatabaseInstances() func() ([]*database.DB, error)

FetchDatabaseInstances returns a function that fetches the current database instances.

This function is used to retrieve the active database instances being used by the application. It returns a function that, when called, returns a slice of pointers to `database.DB` and an error.

Returns:

func() ([]*database.DB, error): A function that returns a slice of pointers to `database.DB` and an error.

Example usage:

fetchDBFunc := FetchDatabaseInstances()
dbInstances, err := fetchDBFunc()
if err != nil {
    logHandler.ErrorLogger.Printf("Error fetching database instances: %v", err)
}
for _, db := range dbInstances {
    fmt.Printf("Database instance: %v\n", db)
}

func GetDefaultLookup

func GetDefaultLookup() (lookup.Lookup, error)

func GetLookup

func GetLookup(field, value string) (lookup.Lookup, error)

func ImportCSV

func ImportCSV() error

func Initialise

func Initialise(ctx context.Context, isolateDB bool)

Types

type Password_Store

type Password_Store struct {
	ID       int           `csv:"-" storm:"id,increment=100000"` // primary key with auto increment
	Key      string        `csv:"-" storm:"unique"`              // key
	Raw      string        `csv:"-" storm:"unique"`              // raw ID before encoding
	UserKey  string        `csv:"-" storm:"index"`               // user key
	Password string        `csv:"-"`
	Expired  dao.StormBool `csv:"-" storm:"index"` // is expired
	Audit    audit.Audit   `csv:"-"`               // audit data
}

Password_Store represents a Password_Store entity.

func GetAll

func GetAll() ([]Password_Store, error)

func GetAllWhere

func GetAllWhere(field string, value any) ([]Password_Store, error)

func GetBy

func GetBy(field string, value any) (Password_Store, error)

func GetById

func GetById(id any) (Password_Store, error)

func GetByKey

func GetByKey(key any) (Password_Store, error)

func New

func New(ctx context.Context, userKey, password string) (Password_Store, error)

func PostGet

func PostGet(recordList *[]Password_Store) ([]Password_Store, error)

func (*Password_Store) Export

func (record *Password_Store) Export(name string)

func (*Password_Store) PostGet

func (s *Password_Store) PostGet() error

func (*Password_Store) Spew

func (record *Password_Store) Spew()

func (*Password_Store) Update

func (record *Password_Store) Update(ctx context.Context, note string) error

func (*Password_Store) Validate

func (record *Password_Store) Validate() error

Jump to

Keyboard shortcuts

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