Documentation
¶
Index ¶
- Constants
- func FileDeserializer(filePath string) (outputMap map[string]any, err error)
- func NewCypherSecretKey() (string, error)
- func ReadServerPrivateIpAddress() (ipAddress tkValueObject.IpAddress, err error)
- func ReadServerPublicIpAddress() (ipAddress tkValueObject.IpAddress, err error)
- func StringDeserializer(serializedString string, serializationFormat string) (outputMap map[string]any, err error)
- func TrustedIpsReader() (trustedIpAddresses []tkValueObject.IpAddress, err error)
- type Cypher
- type DnsLookup
- type FileClerk
- func (clerk FileClerk) CompressDir(sourcePath string, compressionFormatPtr *string) (compressedFilePath string, err error)
- func (clerk FileClerk) CompressFile(sourcePath string, compressionFormatPtr *string) (compressedFilePath string, err error)
- func (clerk FileClerk) CopyDir(sourcePath, targetPath string) error
- func (clerk FileClerk) CopyFile(sourcePath, targetPath string) error
- func (clerk FileClerk) CreateDir(dirPath string) error
- func (clerk FileClerk) CreateFile(filePath string) error
- func (clerk FileClerk) CreateSymlink(sourcePath, targetPath string, shouldOverwrite bool) error
- func (clerk FileClerk) DecompressDir(sourcePath string, targetPathPtr *string, shouldKeepSourceFilePtr *bool) (decompressedDirPath string, err error)
- func (clerk FileClerk) DecompressFile(sourcePath string, targetPathPtr *string, shouldKeepSourceFilePtr *bool) (decompressedFilePath string, err error)
- func (clerk FileClerk) DeleteDir(dirPath string) error
- func (clerk FileClerk) DeleteFile(filePath string) error
- func (clerk FileClerk) DeleteFileContent(filePath string) error
- func (FileClerk) FileExists(filePath string) bool
- func (clerk FileClerk) IsDir(filePath string) bool
- func (clerk FileClerk) IsFile(filePath string) bool
- func (FileClerk) IsSymlink(sourcePath string) bool
- func (clerk FileClerk) IsSymlinkTo(sourcePath string, targetPath string) bool
- func (clerk FileClerk) MoveDir(sourcePath, targetPath string) error
- func (clerk FileClerk) MoveFile(sourcePath, targetPath string) error
- func (clerk FileClerk) ReadFileContent(filePath string, maxContentSizeBytesPtr *int64) (string, error)
- func (FileClerk) RemoveSymlink(symlinkPath string) error
- func (clerk FileClerk) RenameFile(sourcePath, targetPath string) error
- func (clerk FileClerk) TruncateFileContent(filePath string) error
- func (clerk FileClerk) UpdateFileContent(filePath, newContent string, shouldOverwrite bool) error
- func (clerk FileClerk) UpdateFileOwnership(filePath string, userId, groupId int) error
- func (clerk FileClerk) UpdateFilePermissions(filePath string, permissionsPtr *int) error
- type ReadThrough
- type Shell
- type ShellError
- type ShellEscape
- type ShellSettings
- type Synthesizer
- func (synth *Synthesizer) CharsetPresenceGuarantor(originalString []byte, charset string) []byte
- func (synth *Synthesizer) MailAddressFactory(username *string) string
- func (synth *Synthesizer) PasswordFactory(desiredLength int, shouldIncludeSymbols bool) string
- func (synth *Synthesizer) SelfSignedCertificatePairFactory(commonName *tkValueObject.Fqdn, altNames []tkValueObject.Fqdn) (certPair tls.Certificate, err error)
- func (synth *Synthesizer) SelfSignedCertificatePairPemFactory(commonName *tkValueObject.Fqdn, altNames []tkValueObject.Fqdn) (certPem string, keyPem string, err error)
- func (synth *Synthesizer) UsernameFactory() string
Constants ¶
const ( SerializationFormatJson = "json" SerializationFormatYaml = "yaml" )
const ( ReadThroughCertPairCertPathEnvVarName string = "CERTIFICATE_PAIR_CERT_PATH" ReadThroughCertPairKeyPathEnvVarName string = "CERTIFICATE_PAIR_KEY_PATH" ReadThroughPkiDirEnvVarName string = "PKI_DIR" )
const ( CharsetLowercaseLetters string = "abcdefghijklmnopqrstuvwxyz" CharsetUppercaseLetters string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" CharsetNumbers string = "0123456789" CharsetSymbols string = "!@#$%^&*()_+" )
const CypherNewSecretKeyLength = 32
const (
TrustedIpsEnvVarName string = "TRUSTED_IPS"
)
Variables ¶
This section is empty.
Functions ¶
func FileDeserializer ¶ added in v0.0.2
func NewCypherSecretKey ¶ added in v0.1.7
NewCypherSecretKey generates a cryptographically secure random 32-byte secret key, encodes it in base64 for safe storage and transmission, and returns it as a string. This key is suitable for AES-GCM encryption and should be kept confidential.
func ReadServerPrivateIpAddress ¶ added in v0.0.6
func ReadServerPrivateIpAddress() (ipAddress tkValueObject.IpAddress, err error)
func ReadServerPublicIpAddress ¶ added in v0.0.6
func ReadServerPublicIpAddress() (ipAddress tkValueObject.IpAddress, err error)
func StringDeserializer ¶ added in v0.0.2
func TrustedIpsReader ¶ added in v0.1.1
func TrustedIpsReader() (trustedIpAddresses []tkValueObject.IpAddress, err error)
Types ¶
type Cypher ¶ added in v0.1.7
type Cypher struct {
// contains filtered or unexported fields
}
func NewCypher ¶ added in v0.1.7
NewCypher creates a new Cypher instance with the provided base64-encoded secret key. The key must be a valid base64 string that decodes to exactly 16, 24, or 32 bytes for AES encryption. Use NewCypherSecretKey to generate a suitable key if needed. Returns an error if the key is invalid, providing fail-fast validation.
type DnsLookup ¶ added in v0.1.8
type DnsLookup struct {
// contains filtered or unexported fields
}
func NewDnsLookup ¶ added in v0.1.8
func NewDnsLookup( hostname tkValueObject.UnixHostname, recordType *tkValueObject.DnsRecordType, ) *DnsLookup
type FileClerk ¶ added in v0.0.7
type FileClerk struct{}
func (FileClerk) CompressDir ¶ added in v0.0.7
func (FileClerk) CompressFile ¶ added in v0.0.7
func (FileClerk) CreateFile ¶ added in v0.0.7
func (FileClerk) CreateSymlink ¶ added in v0.0.7
func (FileClerk) DecompressDir ¶ added in v0.0.7
func (FileClerk) DecompressFile ¶ added in v0.0.7
func (FileClerk) DeleteFile ¶ added in v0.0.7
func (FileClerk) DeleteFileContent ¶ added in v0.0.7
func (FileClerk) FileExists ¶ added in v0.0.7
func (FileClerk) IsSymlinkTo ¶ added in v0.0.7
func (FileClerk) ReadFileContent ¶ added in v0.0.7
func (FileClerk) RemoveSymlink ¶ added in v0.0.7
func (FileClerk) RenameFile ¶ added in v0.0.7
func (FileClerk) TruncateFileContent ¶ added in v0.0.7
func (FileClerk) UpdateFileContent ¶ added in v0.0.7
func (FileClerk) UpdateFileOwnership ¶ added in v0.0.7
type ReadThrough ¶ added in v0.1.0
type ReadThrough struct {
}
Provides methods for reading information that when not found, are generated on the fly.
func (*ReadThrough) CertPairFilePathsReader ¶ added in v0.1.0
func (rt *ReadThrough) CertPairFilePathsReader() ( certPath tkValueObject.UnixAbsoluteFilePath, keyPath tkValueObject.UnixAbsoluteFilePath, err error, )
Attempts to retrieve the certificate pair file paths from the environment variables "CERTIFICATE_PAIR_CERT_PATH" and "CERTIFICATE_PAIR_KEY_PATH", otherwise generates a self-signed certificate pair on local 'pki' directory (or the directory specified by the environment variable "PKI_DIR") and returns the absolute paths to the generated files.
type Shell ¶ added in v0.0.6
type Shell struct {
// contains filtered or unexported fields
}
func NewShell ¶ added in v0.0.6
func NewShell(settings ShellSettings) Shell
type ShellError ¶ added in v0.0.6
func (*ShellError) Error ¶ added in v0.0.6
func (e *ShellError) Error() string
type ShellEscape ¶ added in v0.0.7
type ShellEscape struct {
}
func (ShellEscape) Quote ¶ added in v0.0.7
func (ShellEscape) Quote(inputStr string) string
func (ShellEscape) StripUnsafe ¶ added in v0.0.7
func (ShellEscape) StripUnsafe(inputStr string) string
type ShellSettings ¶ added in v0.0.6
type Synthesizer ¶
type Synthesizer struct{}
func (*Synthesizer) CharsetPresenceGuarantor ¶
func (synth *Synthesizer) CharsetPresenceGuarantor( originalString []byte, charset string, ) []byte
func (*Synthesizer) MailAddressFactory ¶
func (synth *Synthesizer) MailAddressFactory(username *string) string
func (*Synthesizer) PasswordFactory ¶
func (synth *Synthesizer) PasswordFactory( desiredLength int, shouldIncludeSymbols bool, ) string
func (*Synthesizer) SelfSignedCertificatePairFactory ¶ added in v0.1.0
func (synth *Synthesizer) SelfSignedCertificatePairFactory( commonName *tkValueObject.Fqdn, altNames []tkValueObject.Fqdn, ) (certPair tls.Certificate, err error)
func (*Synthesizer) SelfSignedCertificatePairPemFactory ¶ added in v0.1.0
func (synth *Synthesizer) SelfSignedCertificatePairPemFactory( commonName *tkValueObject.Fqdn, altNames []tkValueObject.Fqdn, ) (certPem string, keyPem string, err error)
func (*Synthesizer) UsernameFactory ¶
func (synth *Synthesizer) UsernameFactory() string