Documentation
¶
Index ¶
- func LoadClientMTLSConfig(certs MTLSSpecShape) (*tls.Config, error)
- func LoadServingCertBundle(certsSpec CertsSpecShape) (*tls.Certificate, *x509.CertPool, error)
- func Must[T any](t T, err ...error) T
- func ParsePEMEncodedCert(data []byte) (*x509.Certificate, error)
- func ParsePEMEncodedCertChain(chain []byte) ([]*x509.Certificate, error)
- type CertsSpecShape
- type MTLSSpecShape
- type MultiErrGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadClientMTLSConfig ¶
func LoadClientMTLSConfig(certs MTLSSpecShape) (*tls.Config, error)
func LoadServingCertBundle ¶
func LoadServingCertBundle(certsSpec CertsSpecShape) (*tls.Certificate, *x509.CertPool, error)
func ParsePEMEncodedCert ¶
func ParsePEMEncodedCert(data []byte) (*x509.Certificate, error)
func ParsePEMEncodedCertChain ¶
func ParsePEMEncodedCertChain(chain []byte) ([]*x509.Certificate, error)
Types ¶
type CertsSpecShape ¶
type CertsSpecShape = struct {
// Path to a PEM encoded CA certificate file. Mutually exclusive with CACertData
CACert *string `json:"caCert,omitempty"`
// String containing PEM encoded CA certificate data. Mutually exclusive with CACert
CACertData []byte `json:"caCertData,omitempty"`
// Path to a PEM encoded server certificate file. Mutually exclusive with ServingCertData
ServingCert *string `json:"servingCert,omitempty"`
// String containing PEM encoded server certificate data. Mutually exclusive with ServingCert
ServingCertData []byte `json:"servingCertData,omitempty"`
// Path to a PEM encoded server key file. Mutually exclusive with ServingKeyData
ServingKey *string `json:"servingKey,omitempty"`
// String containing PEM encoded server key data. Mutually exclusive with ServingKey
ServingKeyData []byte `json:"servingKeyData,omitempty"`
}
type MTLSSpecShape ¶
type MTLSSpecShape = struct {
// Path to the server CA certificate.
ServerCA string `json:"serverCA,omitempty"`
// Path to the client CA certificate (not needed in all cases).
ClientCA string `json:"clientCA,omitempty"`
// Path to the certificate used for client-cert auth.
ClientCert string `json:"clientCert,omitempty"`
// Path to the private key used for client-cert auth.
ClientKey string `json:"clientKey,omitempty"`
}
type MultiErrGroup ¶
tasks := []func() error{/* */}
for _, task := range tasks {
eg.Go(func() error {
return task()
}
}
eg.Wait()
if err := eg.Error(); err != nil {
// handle error
}
func (*MultiErrGroup) Add ¶
func (i *MultiErrGroup) Add(tasks int)
func (*MultiErrGroup) Done ¶
func (i *MultiErrGroup) Done()
func (*MultiErrGroup) Error ¶
func (i *MultiErrGroup) Error() error
func (*MultiErrGroup) Errors ¶
func (i *MultiErrGroup) Errors() []error
func (*MultiErrGroup) Go ¶
func (i *MultiErrGroup) Go(fn func() error)
func (*MultiErrGroup) Wait ¶
func (i *MultiErrGroup) Wait()
Click to show internal directories.
Click to hide internal directories.