certificate

package
v1.3.1-beta Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCert

func ParseCert(privateKey, pemValue string) (*tls.Certificate, error)

Types

type Certificate

type Certificate struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	Domains    []string  `json:"domains"`
	Cluster    string    `json:"cluster"`
	NotBefore  time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:not_before;comment:生效时间"`
	NotAfter   time.Time `gorm:"type:timestamp;NOT NULL;DEFAULT:CURRENT_TIMESTAMP;column:not_after;comment:失效时间"`
	Updater    string    `json:"updater"`
	UpdateTime time.Time `json:"update_time"`
}

type File

type File struct {
	ID   string `json:"id"`
	Key  []byte `json:"key"`
	Cert []byte `json:"cert"`
}

type ICertificateService

type ICertificateService interface {
	Get(ctx context.Context, id string) (*Certificate, *File, error)
	List(ctx context.Context, clusterId string) ([]*Certificate, error)
	Save(ctx context.Context, id, clusterId string, key, cert []byte) (*Certificate, error)
	Delete(ctx context.Context, id string) error
}

Jump to

Keyboard shortcuts

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