mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-03-03 18:20:19 +00:00
29 lines
575 B
Go
29 lines
575 B
Go
// Copyright 2020-2023 Project Capsule Authors.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package cert
|
|
|
|
import "time"
|
|
|
|
type CertificateOptions interface {
|
|
DNSNames() []string
|
|
ExpirationDate() time.Time
|
|
}
|
|
|
|
type certOpts struct {
|
|
dnsNames []string
|
|
expirationDate time.Time
|
|
}
|
|
|
|
func (c certOpts) DNSNames() []string {
|
|
return c.dnsNames
|
|
}
|
|
|
|
func (c certOpts) ExpirationDate() time.Time {
|
|
return c.expirationDate
|
|
}
|
|
|
|
func NewCertOpts(expirationDate time.Time, dnsNames ...string) CertificateOptions {
|
|
return &certOpts{dnsNames: dnsNames, expirationDate: expirationDate}
|
|
}
|