Documentation ¶
Index ¶
- func AddAuxfileToNginxConfig(confFile string, cfg *proto.NginxConfig, newAuxFile string, ...) (*proto.NginxConfig, error)
- func ConvertBackOffSettings(backOffSettings *proto.Backoff) backoff.BackoffSettings
- 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 GetAppProtectPolicyAndSecurityLogFilesWithIgnoreDirectives(cfg *proto.NginxConfig, ignoreDirectives []string) ([]string, []string)
- func GetErrorAndAccessLogs(confFile string) (*proto.ErrorLogs, *proto.AccessLogs, error)
- func GetErrorAndAccessLogsWithIgnoreDirectives(confFile string, ignoreDirectives []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 GetNginxConfigWithIgnoreDirectives(confFile, nginxId, systemId string, allowedDirectories map[string]struct{}, ...) (*proto.NginxConfig, error)
- func GetNginxPlusApiUrl(confFile string, ignoreDirectives []string) (nginxPlusApiUrl string, err error)
- func GetStatusApiInfo(confFile string) (statusApi string, err error)deprecated
- func GetStatusApiInfoWithIgnoreDirectives(confFile string, ignoreDirectives []string) (statusApi string, err error)deprecated
- func GetStubStatusApiUrl(confFile string, ignoreDirectives []string) (stubStatusApiUrl 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 ConvertBackOffSettings ¶ added in v2.27.0
func ConvertBackOffSettings(backOffSettings *proto.Backoff) backoff.BackoffSettings
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)
to ignore directives use GetAppProtectPolicyAndSecurityLogFilesWithIgnoreDirectives()
func GetAppProtectPolicyAndSecurityLogFilesWithIgnoreDirectives ¶ added in v2.27.0
func GetAppProtectPolicyAndSecurityLogFilesWithIgnoreDirectives(cfg *proto.NginxConfig, ignoreDirectives []string) ([]string, []string)
func GetErrorAndAccessLogs ¶
to ignore directives use GetErrorAndAccessLogsWithIgnoreDirectives()
func GetErrorAndAccessLogsWithIgnoreDirectives ¶ added in v2.27.0
func GetErrorLogs ¶
func GetNginxConfig ¶
func GetNginxConfig( confFile, nginxId, systemId string, allowedDirectories map[string]struct{}, ) (*proto.NginxConfig, error)
to ignore directives use GetNginxConfigWithIgnoreDirectives()
func GetNginxConfigFiles ¶
func GetNginxConfigFiles(config *proto.NginxConfig) (confFiles, auxFiles []*proto.File, err error)
func GetNginxConfigWithIgnoreDirectives ¶ added in v2.27.0
func GetNginxConfigWithIgnoreDirectives( confFile, nginxId, systemId string, allowedDirectories map[string]struct{}, ignoreDirectives []string, ) (*proto.NginxConfig, error)
GetNginxConfigWithIgnoreDirectives 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 GetNginxPlusApiUrl ¶ added in v2.28.0
func GetStatusApiInfo
deprecated
func GetStatusApiInfoWithIgnoreDirectives
deprecated
added in
v2.27.0
func GetStubStatusApiUrl ¶ added in v2.28.0
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)
to ignore directives use NewConfigApplyWithIgnoreDirectives()
func NewConfigApplyWithIgnoreDirectives ¶ added in v2.27.0
func NewConfigApplyWithIgnoreDirectives( confFile string, allowedDirectories map[string]struct{}, ignoreDirectives []string, ) (*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
}