crypto

package
v0.0.0-...-af5c341 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRootCrt = errors.New("failed to parse root certificate")
)

Functions

This section is empty.

Types

type Tls

type Tls struct {
	Enable     bool   `json:"enable" yaml:"enable" env:"TLS_ENABLE" envDefault:"false"`
	SkipVerify bool   `json:"skip_verify" yaml:"skip_verify" env:"TLS_SKIP_VERIFY"`
	FromFile   bool   `json:"from_file" yaml:"from_file" env:"TLS_FROM_FILE"`
	Key        string `json:"key" yaml:"key" env:"TLS_KEY" `   // server.key
	Cert       string `json:"cert" yaml:"cert" env:"TLS_CERT"` // client.crt
	CA         string `json:"ca" yaml:"ca" env:"TLS_CA"`       // server.crt
}

func (Tls) GetServerTlsConfig

func (t Tls) GetServerTlsConfig() (grpc.ServerOption, error)

GetServerTlsConfig for server

func (Tls) GetTLSLinkConfig

func (t Tls) GetTLSLinkConfig() (credentials.TransportCredentials, error)

GetTLSLinkConfig for client

func (*Tls) Scan

func (t *Tls) Scan(value interface{}) error

func (Tls) Value

func (t Tls) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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