modules

package
v4.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConnKey = struct{}{}

ConnKey for connector which store in context

View Source
var ResponseCreated = &http.Response{Proto: "Local", StatusCode: http.StatusCreated}
View Source
var ResponseNotAllowed = &http.Response{Proto: "Local", StatusCode: http.StatusMethodNotAllowed}
View Source
var ResponseNotFound = &http.Response{Proto: "Local", StatusCode: http.StatusNotFound}
View Source
var ResponseOK = &http.Response{Proto: "Local", StatusCode: http.StatusOK}
View Source
var ResponseServerError = &http.Response{Proto: "Local", StatusCode: http.StatusInternalServerError}

Functions

func EncodeCertPEM

func EncodeCertPEM(cert *x509.Certificate) []byte

EncodeCertPEM returns PEM-endcoded certificate data

func ModuleAssert

func ModuleAssert(ctx context.Context, options ExecOptions) (string, string)

func ModuleCommand

func ModuleCommand(ctx context.Context, options ExecOptions) (string, string)

func ModuleCopy

func ModuleCopy(ctx context.Context, options ExecOptions) (string, string)

func ModuleDebug

func ModuleDebug(ctx context.Context, options ExecOptions) (string, string)

func ModuleFetch

func ModuleFetch(ctx context.Context, options ExecOptions) (string, string)

func ModuleGenCert

func ModuleGenCert(ctx context.Context, options ExecOptions) (stdout string, stderr string)

ModuleGenCert generate cert file. if root_key and root_cert is empty, generate Self-signed certificate.

func ModuleImage

func ModuleImage(ctx context.Context, options ExecOptions) (stdout string, stderr string)

func ModuleSetFact

func ModuleSetFact(ctx context.Context, options ExecOptions) (string, string)

func ModuleTemplate

func ModuleTemplate(ctx context.Context, options ExecOptions) (string, string)

func NewLocalRepository

func NewLocalRepository(reference string) (*remote.Repository, error)

func NewSelfSignedCACert

func NewSelfSignedCACert(cfg cgutilcert.Config, after time.Duration, key crypto.Signer) (*x509.Certificate, error)

NewSelfSignedCACert creates a CA certificate

func NewSignedCert

func NewSignedCert(cfg cgutilcert.Config, after time.Duration, key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer, isCA bool) (*x509.Certificate, error)

NewSignedCert creates a signed certificate using the given CA certificate and key

func RegisterModule

func RegisterModule(moduleName string, exec ModuleExecFunc) error

func RemoveDuplicateAltNames

func RemoveDuplicateAltNames(altNames *cgutilcert.AltNames)

RemoveDuplicateAltNames removes duplicate items in altNames.

func TryLoadCertChainFromDisk

func TryLoadCertChainFromDisk(rootCert string) (*x509.Certificate, []*x509.Certificate, error)

TryLoadCertChainFromDisk tries to load the cert chain from the disk

func TryLoadKeyFromDisk

func TryLoadKeyFromDisk(rootKey string) (crypto.Signer, error)

TryLoadKeyFromDisk tries to load the key from the disk and validates that it is valid

func ValidateCertPeriod

func ValidateCertPeriod(cert *x509.Certificate, offset time.Duration) error

ValidateCertPeriod checks if the certificate is valid relative to the current time (+/- offset)

func VerifyCertChain

func VerifyCertChain(cert *x509.Certificate, intermediates []*x509.Certificate, root *x509.Certificate) error

VerifyCertChain verifies that a certificate has a valid chain of intermediate CAs back to the root CA

func WriteCert

func WriteCert(outCert string, cert *x509.Certificate, policy string) error

WriteCert stores the given certificate at the given location

func WriteKey

func WriteKey(outKey string, key crypto.Signer, policy string) error

WriteKey stores the given key at the given location

Types

type ExecOptions

type ExecOptions struct {
	// the defined Args for module
	Args runtime.RawExtension
	// which Host to execute
	Host string
	// the variable module need
	variable.Variable
	// the task to be executed
	Task kubekeyv1alpha1.Task
	// the pipeline to be executed
	Pipeline kubekeyv1.Pipeline
}

type ModuleExecFunc

type ModuleExecFunc func(ctx context.Context, options ExecOptions) (stdout string, stderr string)

func FindModule

func FindModule(moduleName string) ModuleExecFunc

Jump to

Keyboard shortcuts

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