Documentation ¶
Index ¶
- Variables
- type CertDataService
- func (svc *CertDataService) AllByExpiration() ([]CertificateData, error)
- func (svc *CertDataService) AllForIndexPage() ([]DisplayData, error)
- func (svc *CertDataService) AllWCertsThatExpireSoon() ([]CertificateData, error)
- func (svc *CertDataService) AllWebCertsThatMightExpireSoon() ([]CertificateData, error)
- func (svc *CertDataService) Destroy(certData *CertificateData) error
- func (svc *CertDataService) FindById(id int) (*CertificateData, error)
- func (svc *CertDataService) Store(certData *CreateCertificateData) (*CertificateData, error)
- func (svc *CertDataService) Update(certData *CertificateData) error
- type CertificateData
- type CreateCertificateData
- type DisplayData
- type Migrator
- type Reader
- type Repository
- type Service
- type SqliteRepository
- func (repo *SqliteRepository) AllByExpiration() ([]CertificateData, error)
- func (repo *SqliteRepository) AllWCertsThatExpireSoon() ([]CertificateData, error)
- func (repo *SqliteRepository) AllWebCertsThatMightExpireSoon() ([]CertificateData, error)
- func (repo *SqliteRepository) Destroy(certData *CertificateData) error
- func (repo *SqliteRepository) FindById(id int) (*CertificateData, error)
- func (repo *SqliteRepository) Migrate(databaseURL string) error
- func (repo *SqliteRepository) Store(certData *CreateCertificateData) (*CertificateData, error)
- func (repo *SqliteRepository) Update(certData *CertificateData) error
- type StorageTestMockService
- func (mock *StorageTestMockService) AllByExpiration() ([]CertificateData, error)
- func (mock *StorageTestMockService) AllForIndexPage() ([]DisplayData, error)
- func (mock *StorageTestMockService) AllWCertsThatExpireSoon() ([]CertificateData, error)
- func (mock *StorageTestMockService) AllWebCertsThatMightExpireSoon() ([]CertificateData, error)
- func (mock *StorageTestMockService) Destroy(certData *CertificateData) error
- func (mock *StorageTestMockService) FindById(id int) (*CertificateData, error)
- func (mock *StorageTestMockService) Store(createCertData *CreateCertificateData) (*CertificateData, error)
- func (mock *StorageTestMockService) Update(certData *CertificateData) error
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKaboom = errors.New("Implement me! Kaboom!") ErrRecordIdOutOfBands = errors.New("Database Id can't be 0 for certs") )
Functions ¶
This section is empty.
Types ¶
type CertDataService ¶
type CertDataService struct {
// contains filtered or unexported fields
}
func (*CertDataService) AllByExpiration ¶
func (svc *CertDataService) AllByExpiration() ([]CertificateData, error)
func (*CertDataService) AllForIndexPage ¶
func (svc *CertDataService) AllForIndexPage() ([]DisplayData, error)
func (*CertDataService) AllWCertsThatExpireSoon ¶
func (svc *CertDataService) AllWCertsThatExpireSoon() ([]CertificateData, error)
func (*CertDataService) AllWebCertsThatMightExpireSoon ¶
func (svc *CertDataService) AllWebCertsThatMightExpireSoon() ([]CertificateData, error)
func (*CertDataService) Destroy ¶
func (svc *CertDataService) Destroy(certData *CertificateData) error
func (*CertDataService) FindById ¶
func (svc *CertDataService) FindById(id int) (*CertificateData, error)
func (*CertDataService) Store ¶
func (svc *CertDataService) Store(certData *CreateCertificateData) (*CertificateData, error)
func (*CertDataService) Update ¶
func (svc *CertDataService) Update(certData *CertificateData) error
type CertificateData ¶
type CertificateData struct { ID int `db:"id" json:"id"` Name string `db:"name" json:"name"` Subject string `db:"subject" json:"subject"` Type string `db:"type" json:"type"` NotAfter time.Time `db:"not_after" json:"not_after"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
func (*CertificateData) ExpiresIn ¶
func (cd *CertificateData) ExpiresIn() time.Duration
func (*CertificateData) ExpiresInString ¶
func (cd *CertificateData) ExpiresInString() string
func (*CertificateData) Status ¶
func (cd *CertificateData) Status() string
func (*CertificateData) ToDisplayData ¶
func (cd *CertificateData) ToDisplayData() DisplayData
type CreateCertificateData ¶
CreateCertificateData used to create CertificateData record
type DisplayData ¶
type DisplayData struct { ID int `json:"id"` Name string `json:"name"` Subject string `json:"subject"` Type string `json:"type"` ExpiresIn string `json:"expires_in"` NotAfter time.Time `json:"not_after"` Status string `json:"status"` Button string `json:"status"` }
DisplayData has all data in final concrete format ready for display in eg. HTML template
type Reader ¶
type Reader interface { FindById(id int) (*CertificateData, error) AllByExpiration() ([]CertificateData, error) AllWebCertsThatMightExpireSoon() ([]CertificateData, error) AllWCertsThatExpireSoon() ([]CertificateData, error) }
type Repository ¶
type Service ¶
type Service interface { FindById(id int) (*CertificateData, error) AllByExpiration() ([]CertificateData, error) AllForIndexPage() ([]DisplayData, error) Store(createCertData *CreateCertificateData) (*CertificateData, error) Destroy(certData *CertificateData) error Update(certData *CertificateData) error AllWebCertsThatMightExpireSoon() ([]CertificateData, error) AllWCertsThatExpireSoon() ([]CertificateData, error) }
func NewService ¶
func NewService(repo Repository) Service
func NewTestMock ¶
func NewTestMock() Service
type SqliteRepository ¶
type SqliteRepository struct {
// contains filtered or unexported fields
}
func NewSqliteRepository ¶
func NewSqliteRepository(connectionPool *sqlx.DB) *SqliteRepository
func (*SqliteRepository) AllByExpiration ¶
func (repo *SqliteRepository) AllByExpiration() ([]CertificateData, error)
func (*SqliteRepository) AllWCertsThatExpireSoon ¶
func (repo *SqliteRepository) AllWCertsThatExpireSoon() ([]CertificateData, error)
func (*SqliteRepository) AllWebCertsThatMightExpireSoon ¶
func (repo *SqliteRepository) AllWebCertsThatMightExpireSoon() ([]CertificateData, error)
func (*SqliteRepository) Destroy ¶
func (repo *SqliteRepository) Destroy(certData *CertificateData) error
func (*SqliteRepository) FindById ¶
func (repo *SqliteRepository) FindById(id int) (*CertificateData, error)
func (*SqliteRepository) Migrate ¶
func (repo *SqliteRepository) Migrate(databaseURL string) error
func (*SqliteRepository) Store ¶
func (repo *SqliteRepository) Store(certData *CreateCertificateData) (*CertificateData, error)
func (*SqliteRepository) Update ¶
func (repo *SqliteRepository) Update(certData *CertificateData) error
type StorageTestMockService ¶
type StorageTestMockService struct { }
func (*StorageTestMockService) AllByExpiration ¶
func (mock *StorageTestMockService) AllByExpiration() ([]CertificateData, error)
func (*StorageTestMockService) AllForIndexPage ¶
func (mock *StorageTestMockService) AllForIndexPage() ([]DisplayData, error)
func (*StorageTestMockService) AllWCertsThatExpireSoon ¶
func (mock *StorageTestMockService) AllWCertsThatExpireSoon() ([]CertificateData, error)
func (*StorageTestMockService) AllWebCertsThatMightExpireSoon ¶
func (mock *StorageTestMockService) AllWebCertsThatMightExpireSoon() ([]CertificateData, error)
func (*StorageTestMockService) Destroy ¶
func (mock *StorageTestMockService) Destroy(certData *CertificateData) error
func (*StorageTestMockService) FindById ¶
func (mock *StorageTestMockService) FindById(id int) (*CertificateData, error)
func (*StorageTestMockService) Store ¶
func (mock *StorageTestMockService) Store(createCertData *CreateCertificateData) (*CertificateData, error)
func (*StorageTestMockService) Update ¶
func (mock *StorageTestMockService) Update(certData *CertificateData) error
type Writer ¶
type Writer interface { Store(createCertData *CreateCertificateData) (*CertificateData, error) Destroy(certData *CertificateData) error Update(certData *CertificateData) error }
Click to show internal directories.
Click to hide internal directories.