Documentation ¶
Index ¶
- func AddAuxfileToNginxConfig(confFile string, cfg *proto.NginxConfig, newAuxFile string, ...) (*proto.NginxConfig, error)
- func CrossplaneConfigTraverse(root *crossplane.Config, callback CrossplaneTraverseCallback) error
- func CrossplaneConfigTraverseStr(root *crossplane.Config, callback CrossplaneTraverseCallbackStr) string
- func GetAccessLogs(accessLogs *proto.AccessLogs) []string
- func GetAppProtectPolicyAndSecurityLogFiles(cfg *proto.NginxConfig) ([]string, []string)
- func GetErrorAndAccessLogs(confFile string) (*proto.ErrorLogs, *proto.AccessLogs, error)
- func GetErrorLogs(errorLogs *proto.ErrorLogs) []string
- func GetNginxConfig(confFile, nginxId, systemId string, allowedDirectories map[string]struct{}) (*proto.NginxConfig, error)
- func GetNginxConfigFiles(config *proto.NginxConfig) (confFiles, auxFiles []*proto.File, err error)
- func GetStatusApiInfo(confFile string) (statusApi string, err error)
- func LoadCertificate(certPath string) (*x509.Certificate, error)
- func LoadCertificates(certPath, keyPath string) (*tls.Certificate, *x509.CertPool, error)
- type ConfigApply
- func (b *ConfigApply) Complete() error
- func (b *ConfigApply) GetExisting() map[string]struct{}
- func (b *ConfigApply) GetNotExistDirs() map[string]struct{}
- func (b *ConfigApply) GetNotExists() map[string]struct{}
- func (b *ConfigApply) MarkAndSave(fullPath string) error
- func (b *ConfigApply) RemoveFromNotExists(fullPath string)
- func (b *ConfigApply) Rollback(cause error) error
- type CrossplaneTraverseCallback
- type CrossplaneTraverseCallbackStr
- type DirectoryMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAuxfileToNginxConfig ¶
func AddAuxfileToNginxConfig( confFile string, cfg *proto.NginxConfig, newAuxFile string, allowedDirectories map[string]struct{}, okIfFileNotExist bool, ) (*proto.NginxConfig, error)
AddAuxfileToNginxConfig adds the specified newAuxFile to the Nginx Config cfg
func CrossplaneConfigTraverse ¶
func CrossplaneConfigTraverse(root *crossplane.Config, callback CrossplaneTraverseCallback) error
func CrossplaneConfigTraverseStr ¶
func CrossplaneConfigTraverseStr(root *crossplane.Config, callback CrossplaneTraverseCallbackStr) string
func GetAccessLogs ¶
func GetAccessLogs(accessLogs *proto.AccessLogs) []string
func GetAppProtectPolicyAndSecurityLogFiles ¶ added in v2.22.0
func GetAppProtectPolicyAndSecurityLogFiles(cfg *proto.NginxConfig) ([]string, []string)
func GetErrorAndAccessLogs ¶
func GetErrorLogs ¶
func GetNginxConfig ¶
func GetNginxConfig( confFile, nginxId, systemId string, allowedDirectories map[string]struct{}, ) (*proto.NginxConfig, error)
GetNginxConfig parse the configFile into proto.NginxConfig payload, using the provided nginxID, and systemID for ConfigDescriptor in the NginxConfig. The allowedDirectories is used to allowlist the directories we include in the aux payload.
func GetNginxConfigFiles ¶
func GetNginxConfigFiles(config *proto.NginxConfig) (confFiles, auxFiles []*proto.File, err error)
func GetStatusApiInfo ¶
func LoadCertificate ¶
func LoadCertificate(certPath string) (*x509.Certificate, error)
func LoadCertificates ¶
Types ¶
type ConfigApply ¶
type ConfigApply struct {
// contains filtered or unexported fields
}
ConfigApply facilitates synchronizing the current config against incoming config_apply request. By keeping track of the current files, mark them off as they are getting applied, and delete any leftovers that's not in the incoming apply payload.
func NewConfigApply ¶
func NewConfigApply( confFile string, allowedDirectories map[string]struct{}, ) (*ConfigApply, error)
func (*ConfigApply) Complete ¶
func (b *ConfigApply) Complete() error
Complete deletes any leftover files in the existing list, return error if failed to do so
func (*ConfigApply) GetExisting ¶
func (b *ConfigApply) GetExisting() map[string]struct{}
func (*ConfigApply) GetNotExistDirs ¶ added in v2.20.0
func (b *ConfigApply) GetNotExistDirs() map[string]struct{}
func (*ConfigApply) GetNotExists ¶
func (b *ConfigApply) GetNotExists() map[string]struct{}
func (*ConfigApply) MarkAndSave ¶
func (b *ConfigApply) MarkAndSave(fullPath string) error
MarkAndSave marks the provided fullPath, and save the content of the file in the provided fullPath
func (*ConfigApply) RemoveFromNotExists ¶
func (b *ConfigApply) RemoveFromNotExists(fullPath string)
func (*ConfigApply) Rollback ¶
func (b *ConfigApply) Rollback(cause error) error
Rollback dumps the saved file content, and delete the notExists file. Best effort, will log error and continue if file operation failed during rollback.
type CrossplaneTraverseCallbackStr ¶
type CrossplaneTraverseCallbackStr = func(parent *crossplane.Directive, current *crossplane.Directive) string
type DirectoryMap ¶
type DirectoryMap struct {
// contains filtered or unexported fields
}