models

package
v0.0.0-...-6c57b59 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNotFound          modelError   = "models: resource not found"
	ErrIDInvalid         privateError = "models: ID provided was invalid"
	ErrURLInvalid        modelError   = "Invalid URL provided"
	ErrUniqueURLRequired modelError   = "URL must be unique"
	ErrCreatePass        modelError   = "Could not create pass"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pass

type Pass struct {
	ID           uint
	URL          string
	Password     string
	PasswordHash string
}

type PassDB

type PassDB interface {
	Create(pass *Pass) error
	// Update(pass *Pass) error
	// Delete(id uint) error
	Get() ([]Pass, error)
}

type PassService

type PassService interface {
	PassDB
}

func NewPassService

func NewPassService(db *sql.DB) PassService

type Service

type Service struct {
	PassService

	// Datasource name.
	DSN string
	// contains filtered or unexported fields
}

func NewServices

func NewServices(dsn string) (*Service, error)

func (*Service) Close

func (s *Service) Close() error

Close closes the database connection.

func (*Service) Open

func (s *Service) Open() (err error)

Open opens the database connection.

Jump to

Keyboard shortcuts

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