common

package
v0.0.0-...-9d4b2c1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSslProfileBasePath = "${SSL_PROFILE_BASE_PATH}"
)

Variables

View Source
var (
	//go:embed startsh-container.template
	StartScriptContainerTemplate string

	//go:embed stopsh-container.template
	StopScriptContainerTemplate string
)
View Source
var (
	//go:embed systemd_container_service.template
	SystemdContainerServiceTemplate string
	//go:embed systemd_service.template
	SystemdServiceTemplate string
)

Functions

func BackupNamespace

func BackupNamespace(namespace string) ([]byte, error)

func CleanupNamespaceForReload

func CleanupNamespaceForReload(namespace string) error

func CopySiteState

func CopySiteState(siteState *api.SiteState) *api.SiteState

func CreateRouterAccess

func CreateRouterAccess(siteState *api.SiteState) error

func GetNamespacesFound

func GetNamespacesFound(s *api.SiteState) []string

func IsLingeringEnabled

func IsLingeringEnabled(user string) bool

func LoadIntoSiteState

func LoadIntoSiteState(reader *bufio.Reader, siteState *api.SiteState) error

func LoadRouterConfig

func LoadRouterConfig(namespace string) (*qdr.RouterConfig, error)

func NewLogger

func NewLogger() *slog.Logger

func RedeemClaims

func RedeemClaims(siteState *api.SiteState) error

func RestoreNamespaceData

func RestoreNamespaceData(data []byte) error

func ValidateName

func ValidateName(name string) error

Types

type CommandExecutor

type CommandExecutor func(name string, arg ...string) *exec.Cmd

type FileSystemConfigurationRenderer

type FileSystemConfigurationRenderer struct {
	// SslProfileBasePath path where configuration will be read from in runtime
	SslProfileBasePath string
	RouterConfig       qdr.RouterConfig
	Platform           string
	Bundle             bool
	// contains filtered or unexported fields
}

func NewFileSystemConfigurationRenderer

func NewFileSystemConfigurationRenderer(outputPath string) *FileSystemConfigurationRenderer

func (*FileSystemConfigurationRenderer) GetInputPath

func (c *FileSystemConfigurationRenderer) GetInputPath(siteState *api.SiteState, dir InputPathType) string

func (*FileSystemConfigurationRenderer) GetOutputPath

func (c *FileSystemConfigurationRenderer) GetOutputPath(siteState *api.SiteState) string

func (*FileSystemConfigurationRenderer) MarshalSiteStates

func (c *FileSystemConfigurationRenderer) MarshalSiteStates(loadedSiteState, runtimeSiteState *api.SiteState) error

func (*FileSystemConfigurationRenderer) Render

func (c *FileSystemConfigurationRenderer) Render(siteState *api.SiteState) error

Render simply renders the given site state as configuration files.

type FileSystemSiteStateLoader

type FileSystemSiteStateLoader struct {
	Path   string
	Bundle bool
}

func (*FileSystemSiteStateLoader) Load

type InputPathType

type InputPathType string
const (
	InputPathResources InputPathType = "resources"
	InputPathCerts     InputPathType = "certs"
	InputPathIssuers   InputPathType = "issuers"
)

type LinkDecoder

type LinkDecoder struct {
	// contains filtered or unexported fields
}

type NamespacePlatformLoader

type NamespacePlatformLoader struct {
	PathProvider api.InternalPathProvider
	Platform     string `yaml:"platform"`
}

func (*NamespacePlatformLoader) GetPathProvider

func (s *NamespacePlatformLoader) GetPathProvider() api.InternalPathProvider

func (*NamespacePlatformLoader) Load

func (s *NamespacePlatformLoader) Load(namespace string) (string, error)

type SiteStateValidator

type SiteStateValidator struct{}

func (*SiteStateValidator) Validate

func (s *SiteStateValidator) Validate(siteState *api.SiteState) error

Validate provides a common validation for non-kubernetes sites which do not benefit from the Kubernetes API. The goal is not to validate the site state against the spec (CRD), but to a more basic level, like to ensure that mandatory fields for each resource are populated and users will be able to operate the non-k8s site.

type StartupScript

type StartupScript interface {
	Create() error
	Remove()
	GetPath() string
	GetStartFileName() string
	GetStopFileName() string
}

func GetStartupScripts

func GetStartupScripts(args StartupScriptsArgs, pathProvider api.InternalPathProvider) (StartupScript, error)

type StartupScriptsArgs

type StartupScriptsArgs struct {
	Namespace string
	SiteId    string
	Platform  types.Platform
	Bundle    bool
}

type SystemdService

type SystemdService interface {
	GetServiceName() string
	Create() error
	Remove() error
	GetServiceFile() string
}

func NewSystemdServiceInfo

func NewSystemdServiceInfo(siteState *api.SiteState, platform string) (SystemdService, error)

Jump to

Keyboard shortcuts

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