modules

package
v4.0.0-alpha.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// StdoutSuccess message for common module
	StdoutSuccess = "success"
	StdoutSkip    = "skip"

	// StdoutTrue for bool module
	StdoutTrue = "True"
	// StdoutFalse for bool module
	StdoutFalse = "False"
)

message for stdout

Variables

View Source
var ConnKey = struct{}{}

ConnKey for connector which store in context

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)

ModuleAssert deal "assert" module

func ModuleCommand

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

ModuleCommand deal "command" module.

func ModuleCopy

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

ModuleCopy deal "copy" module

func ModuleDebug

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

ModuleDebug deal "debug" module

func ModuleFetch

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

ModuleFetch deal fetch module

func ModuleGenCert

func ModuleGenCert(ctx context.Context, options ExecOptions) (string, 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) (string, string)

ModuleImage deal "image" module

func ModuleSetFact

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

ModuleSetFact deal "set_fact" module

func ModuleTemplate

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

ModuleTemplate deal "template" module

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

RegisterModule register module

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 kkcorev1alpha1.Task
	// the pipeline to be executed
	Pipeline kkcorev1.Pipeline
}

ExecOptions for module

type ModuleExecFunc

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

ModuleExecFunc exec module

func FindModule

func FindModule(moduleName string) ModuleExecFunc

FindModule by module name which has register.

Jump to

Keyboard shortcuts

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