sql

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetError

func GetError(err error) error

GetError translates gorm errors into database package errors

func NewDB

func NewDB(dialect, connectionString string) database.DB

NewDB bootstraps a new File DB instance

Types

type Certificate

type Certificate struct {
	GormModel
	database.Certificate
}

Certificate is the implementation for the Certificate struct in the database package

type CertificateRepository

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

CertificateRepository implements the CertificateRepository interface from database package

func (*CertificateRepository) Create

func (repo *CertificateRepository) Create(certificate *database.Certificate) error

Create creates a certificate

func (*CertificateRepository) DeleteByNameSerialNumber

func (repo *CertificateRepository) DeleteByNameSerialNumber(nameSerialNumber string) error

DeleteByNameSerialNumber deletes a certificate by NameSerialNumber

func (*CertificateRepository) GetByNameSerialNumber

func (repo *CertificateRepository) GetByNameSerialNumber(nameSerialNumber string) (*database.Certificate, error)

GetByNameSerialNumber gets a certificate by NameSerialNumber

type GormModel

type GormModel struct {
	ID uint `gorm:"primary_key"`
}

GormModel holds default gorm object markup

Jump to

Keyboard shortcuts

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