database

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCertificateOwnerParams added in v0.0.7

type AddCertificateOwnerParams struct {
	Owner  string `json:"owner"`
	CertID int64  `json:"cert_id"`
}

type AddCertificateParams

type AddCertificateParams struct {
	Name       string          `json:"name"`
	AutoRenew  bool            `json:"auto_renew"`
	Active     bool            `json:"active"`
	Dns        nulls.Int64     `json:"dns"`
	NotAfter   nulls.Time      `json:"not_after"`
	UpdatedAt  time.Time       `json:"updated_at"`
	Authority  types.Authority `json:"authority"`
	CommonName string          `json:"common_name"`
	Country    string          `json:"country"`
	Org        string          `json:"org"`
	OrgUnit    string          `json:"org_unit"`
	Locality   string          `json:"locality"`
	Province   string          `json:"province"`
}

type AddDomainsParams

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

type Agent added in v0.0.7

type Agent struct {
	ID          int64      `json:"id"`
	Address     string     `json:"address"`
	User        string     `json:"user"`
	Dir         string     `json:"dir"`
	Fingerprint string     `json:"fingerprint"`
	LastSync    nulls.Time `json:"last_sync"`
}

type AgentCert added in v0.0.7

type AgentCert struct {
	AgentID  int64      `json:"agent_id"`
	CertID   int64      `json:"cert_id"`
	NotAfter nulls.Time `json:"not_after"`
}

type Certificate

type Certificate struct {
	ID               int64           `json:"id"`
	Dns              nulls.Int64     `json:"dns"`
	AutoRenew        bool            `json:"auto_renew"`
	Active           bool            `json:"active"`
	Renewing         bool            `json:"renewing"`
	UpdatedAt        time.Time       `json:"updated_at"`
	TempParent       sql.NullInt64   `json:"temp_parent"`
	NotAfter         nulls.Time      `json:"not_after"`
	RenewRetry       nulls.Time      `json:"renew_retry"`
	Authority        types.Authority `json:"authority"`
	CommonName       string          `json:"common_name"`
	Country          string          `json:"country"`
	Org              string          `json:"org"`
	OrgUnit          string          `json:"org_unit"`
	Locality         string          `json:"locality"`
	Province         string          `json:"province"`
	DetailsUpdatedAt interface{}     `json:"details_updated_at"`
	Name             string          `json:"name"`
}

type CertificateDomain

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

type ChangeCertificateDetailsParams added in v0.0.7

type ChangeCertificateDetailsParams struct {
	Country  string `json:"country"`
	Org      string `json:"org"`
	OrgUnit  string `json:"org_unit"`
	Locality string `json:"locality"`
	Province string `json:"province"`
	ID       int64  `json:"id"`
}

type CheckCertOwnerParams added in v0.0.7

type CheckCertOwnerParams 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 DnsApiToken added in v0.0.7

type DnsApiToken struct {
	ID     int64  `json:"id"`
	Domain string `json:"domain"`
	Source string `json:"source"`
	Token  string `json:"token"`
}

type FindAgentToSyncRow added in v0.0.7

type FindAgentToSyncRow struct {
	AgentID      int64      `json:"agent_id"`
	Address      string     `json:"address"`
	User         string     `json:"user"`
	Dir          string     `json:"dir"`
	Fingerprint  string     `json:"fingerprint"`
	CertID       int64      `json:"cert_id"`
	CertNotAfter nulls.Time `json:"cert_not_after"`
	CommonName   string     `json:"common_name"`
}

type FindNextCertRow

type FindNextCertRow struct {
	ID         int64      `json:"id"`
	NotAfter   nulls.Time `json:"not_after"`
	CommonName string     `json:"common_name"`
}

type FindOwnedCertsRow

type FindOwnedCertsRow struct {
	ID         int64           `json:"id"`
	Name       string          `json:"name"`
	Authority  types.Authority `json:"authority"`
	AutoRenew  bool            `json:"auto_renew"`
	Active     bool            `json:"active"`
	Renewing   bool            `json:"renewing"`
	RenewRetry nulls.Time      `json:"renew_retry"`
	NotAfter   nulls.Time      `json:"not_after"`
	UpdatedAt  time.Time       `json:"updated_at"`
	CommonName string          `json:"common_name"`
	Country    string          `json:"country"`
	Org        string          `json:"org"`
	OrgUnit    string          `json:"org_unit"`
	Locality   string          `json:"locality"`
	Province   string          `json:"province"`
	Domain     sql.NullString  `json:"domain"`
}

type GetDomainStatesForCertRow

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

type Owner added in v0.0.7

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

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) (int64, error)

func (*Queries) AddCertificateOwner added in v0.0.7

func (q *Queries) AddCertificateOwner(ctx context.Context, arg AddCertificateOwnerParams) error

func (*Queries) AddDomains

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

func (*Queries) ChangeCertificateDetails added in v0.0.7

func (q *Queries) ChangeCertificateDetails(ctx context.Context, arg ChangeCertificateDetailsParams) error

func (*Queries) CheckCertOwner

func (q *Queries) CheckCertOwner(ctx context.Context, arg CheckCertOwnerParams) (int64, error)

func (*Queries) FindAgentToSync added in v0.0.7

func (q *Queries) FindAgentToSync(ctx context.Context) ([]FindAgentToSyncRow, error)

func (*Queries) FindDomainAcmeToken added in v0.0.7

func (q *Queries) FindDomainAcmeToken(ctx context.Context, dollar_1 string) ([]DnsApiToken, error)

func (*Queries) FindNextCert

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

func (*Queries) FindOwnedCerts

func (q *Queries) FindOwnedCerts(ctx context.Context, owner string) ([]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) SetCertificateAutoRenew added in v0.0.7

func (q *Queries) SetCertificateAutoRenew(ctx context.Context, arg SetCertificateAutoRenewParams) error

func (*Queries) SetDomainStateForCert

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

func (*Queries) SetRetryFlag added in v0.0.7

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

func (*Queries) TriggerManualRenew added in v0.0.7

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

func (*Queries) UpdateAgentCertNotAfter added in v0.0.7

func (q *Queries) UpdateAgentCertNotAfter(ctx context.Context, arg UpdateAgentCertNotAfterParams) error

func (*Queries) UpdateAgentLastSync added in v0.0.7

func (q *Queries) UpdateAgentLastSync(ctx context.Context, arg UpdateAgentLastSyncParams) 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 SetCertificateAutoRenewParams added in v0.0.7

type SetCertificateAutoRenewParams struct {
	AutoRenew bool  `json:"auto_renew"`
	ID        int64 `json:"id"`
}

type SetDomainStateForCertParams

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

type UpdateAgentCertNotAfterParams added in v0.0.7

type UpdateAgentCertNotAfterParams struct {
	NotAfter nulls.Time `json:"not_after"`
	AgentID  int64      `json:"agent_id"`
	CertID   int64      `json:"cert_id"`
}

type UpdateAgentLastSyncParams added in v0.0.7

type UpdateAgentLastSyncParams struct {
	LastSync nulls.Time `json:"last_sync"`
	ID       int64      `json:"id"`
}

type UpdateCertAfterRenewalParams

type UpdateCertAfterRenewalParams struct {
	NotAfter  nulls.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"`
	RenewRetry nulls.Time `json:"renew_retry"`
	ID         int64      `json:"id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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