database

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCertificateParams

type AddCertificateParams struct {
	Owner     string        `json:"owner"`
	Dns       sql.NullInt64 `json:"dns"`
	NotAfter  time.Time     `json:"not_after"`
	UpdatedAt time.Time     `json:"updated_at"`
}

type AddDomainsParams

type AddDomainsParams struct {
	CertID int64  `json:"cert_id"`
	Domain string `json:"domain"`
	State  int64  `json:"state"`
}

type AddTempCertificateParams

type AddTempCertificateParams struct {
	Owner      string        `json:"owner"`
	UpdatedAt  time.Time     `json:"updated_at"`
	TempParent sql.NullInt64 `json:"temp_parent"`
}

type Certificate

type Certificate struct {
	ID          int64         `json:"id"`
	Owner       string        `json:"owner"`
	Dns         sql.NullInt64 `json:"dns"`
	AutoRenew   bool          `json:"auto_renew"`
	Active      bool          `json:"active"`
	Renewing    bool          `json:"renewing"`
	RenewFailed bool          `json:"renew_failed"`
	NotAfter    time.Time     `json:"not_after"`
	UpdatedAt   time.Time     `json:"updated_at"`
	TempParent  sql.NullInt64 `json:"temp_parent"`
}

type CertificateDomain

type CertificateDomain struct {
	DomainID int64  `json:"domain_id"`
	CertID   int64  `json:"cert_id"`
	Domain   string `json:"domain"`
	State    int64  `json:"state"`
}

type CheckCertOwnerRow

type CheckCertOwnerRow struct {
	ID    int64  `json:"id"`
	Owner string `json:"owner"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DnsAcme

type DnsAcme struct {
	ID    int64  `json:"id"`
	Type  string `json:"type"`
	Email string `json:"email"`
	Token string `json:"token"`
}

type FindNextCertRow

type FindNextCertRow struct {
	ID         int64          `json:"id"`
	NotAfter   time.Time      `json:"not_after"`
	Type       sql.NullString `json:"type"`
	Token      sql.NullString `json:"token"`
	TempParent sql.NullInt64  `json:"temp_parent"`
}

type FindOwnedCertsRow

type FindOwnedCertsRow struct {
	ID          int64     `json:"id"`
	AutoRenew   bool      `json:"auto_renew"`
	Active      bool      `json:"active"`
	Renewing    bool      `json:"renewing"`
	RenewFailed bool      `json:"renew_failed"`
	NotAfter    time.Time `json:"not_after"`
	UpdatedAt   time.Time `json:"updated_at"`
	Domain      string    `json:"domain"`
}

type GetDomainStatesForCertRow

type GetDomainStatesForCertRow struct {
	Domain string `json:"domain"`
	State  int64  `json:"state"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddCertificate

func (q *Queries) AddCertificate(ctx context.Context, arg AddCertificateParams) error

func (*Queries) AddDomains

func (q *Queries) AddDomains(ctx context.Context, arg AddDomainsParams) error

func (*Queries) AddTempCertificate

func (q *Queries) AddTempCertificate(ctx context.Context, arg AddTempCertificateParams) error

func (*Queries) CheckCertOwner

func (q *Queries) CheckCertOwner(ctx context.Context, id int64) (CheckCertOwnerRow, error)

func (*Queries) FindNextCert

func (q *Queries) FindNextCert(ctx context.Context) (FindNextCertRow, error)

func (*Queries) FindOwnedCerts

func (q *Queries) FindOwnedCerts(ctx context.Context) ([]FindOwnedCertsRow, error)

func (*Queries) GetDomainStatesForCert

func (q *Queries) GetDomainStatesForCert(ctx context.Context, certID int64) ([]GetDomainStatesForCertRow, error)

func (*Queries) GetDomainsForCertificate

func (q *Queries) GetDomainsForCertificate(ctx context.Context, certID int64) ([]string, error)

func (*Queries) RemoveCertificate

func (q *Queries) RemoveCertificate(ctx context.Context, id int64) error

func (*Queries) SetDomainStateForCert

func (q *Queries) SetDomainStateForCert(ctx context.Context, arg SetDomainStateForCertParams) error

func (*Queries) UpdateCertAfterRenewal

func (q *Queries) UpdateCertAfterRenewal(ctx context.Context, arg UpdateCertAfterRenewalParams) error

func (*Queries) UpdateDomains

func (q *Queries) UpdateDomains(ctx context.Context, arg UpdateDomainsParams) error

func (*Queries) UpdateRenewingState

func (q *Queries) UpdateRenewingState(ctx context.Context, arg UpdateRenewingStateParams) error

func (*Queries) UseTx

func (q *Queries) UseTx(ctx context.Context, cb func(tx *Queries) error) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type SetDomainStateForCertParams

type SetDomainStateForCertParams struct {
	State  int64 `json:"state"`
	CertID int64 `json:"cert_id"`
}

type UpdateCertAfterRenewalParams

type UpdateCertAfterRenewalParams struct {
	NotAfter  time.Time `json:"not_after"`
	UpdatedAt time.Time `json:"updated_at"`
	ID        int64     `json:"id"`
}

type UpdateDomainsParams

type UpdateDomainsParams struct {
	State   int64    `json:"state"`
	Domains []string `json:"domains"`
}

type UpdateRenewingStateParams

type UpdateRenewingStateParams struct {
	Renewing    bool  `json:"renewing"`
	RenewFailed bool  `json:"renew_failed"`
	ID          int64 `json:"id"`
}

Jump to

Keyboard shortcuts

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