Documentation ¶
Index ¶
- Constants
- Variables
- type App
- type Circuit
- type Config
- type Consumer
- type ConsumerFile
- type ContextKey
- type Endpoint
- type EndpointFile
- type EnvironmentVariable
- type GatewayManager
- type LogEntry
- type LogStatus
- type Plugin
- type PluginConfig
- type PluginsConfig
- type Registry
- type RegistryManager
- type ServiceFile
- type ServiceFileData
- type ServiceManager
- type ServicePatch
- type SyncNamespace
- type Version
Constants ¶
View Source
const ( ServiceTypeSystem = "system-service" ServiceTypeNamespace = "namespace-service" ServiceTypeWorkflow = "workflow-service" )
View Source
const SystemNamespace = "system"
Variables ¶
View Source
var ErrNotFound = errors.New("ErrNotFound")
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { Version *Version Config *Config ServiceManager ServiceManager RegistryManager RegistryManager GatewayManager GatewayManager SyncNamespace SyncNamespace }
type Circuit ¶
type Circuit struct {
// contains filtered or unexported fields
}
nolint: containedctx
type Config ¶
type Config struct { DirektivNamespace string `env:"DIREKTIV_NAMESPACE"` LogDebug bool `env:"DIREKTIV_DEBUG"` ApiPort int `env:"DIREKTIV_API_PORT" envDefault:"6665"` ApiKey string `env:"DIREKTIV_API_KEY"` SecretKey string `env:"DIREKTIV_SECRET_KEY,notEmpty"` DB string `env:"DIREKTIV_DB,notEmpty"` FunctionsTimeout int `env:"DIREKTIV_FUNCTIONS_TIMEOUT" envDefault:"7200"` Prometheus string `env:"DIREKTIV_PROMETHEUS_BACKEND"` OpenTelemetry string `env:"DIREKTIV_OPEN_TELEMETRY_BACKEND"` DisableServices bool `env:"DIREKTIV_DISABLE_SERVICES" envDefault:"false"` KnativeServiceAccount string `env:"DIREKTIV_KNATIVE_SERVICE_ACCOUNT"` KnativeNamespace string `env:"DIREKTIV_KNATIVE_NAMESPACE"` KnativeIngressClass string `env:"DIREKTIV_KNATIVE_INGRESS_CLASS"` KnativeSidecar string `env:"DIREKTIV_KNATIVE_SIDECAR"` KnativeMaxScale int `env:"DIREKTIV_KNATIVE_MAX_SCALE" envDefault:"5"` KnativeNetShape string `env:"DIREKTIV_KNATIVE_NET_SHAPE"` KnativeSizeMemorySmall int `env:"DIREKTIV_KNATIVE_SIZE_MEMORY_SMALL" envDefault:"512"` KnativeSizeMemoryMedium int `env:"DIREKTIV_KNATIVE_SIZE_MEMORY_MEDIUM" envDefault:"1024"` KnativeSizeMemoryLarge int `env:"DIREKTIV_KNATIVE_SIZE_MEMORY_LARGE" envDefault:"2048"` KnativeSizeCPUSmall string `env:"DIREKTIV_KNATIVE_SIZE_CPU_SMALL" envDefault:"250m"` KnativeSizeCPUMedium string `env:"DIREKTIV_KNATIVE_SIZE_CPU_MEDIUM" envDefault:"500m"` KnativeSizeCPULarge string `env:"DIREKTIV_KNATIVE_SIZE_CPU_LARGE" envDefault:"1"` KnativeSizeDiskSmall int `env:"DIREKTIV_KNATIVE_SIZE_DISK_SMALL" envDefault:"256"` KnativeSizeDiskMedium int `env:"DIREKTIV_KNATIVE_SIZE_DISK_MEDIUM" envDefault:"1024"` KnativeSizeDiskLarge int `env:"DIREKTIV_KNATIVE_SIZE_DISK_LARGE" envDefault:"4096"` KnativeProxyNo string `env:"DIREKTIV_KNATIVE_PROXY_NO"` KnativeProxyHTTP string `env:"DIREKTIV_KNATIVE_PROXY_HTTP"` KnativeProxyHTTPS string `env:"DIREKTIV_KNATIVE_PROXY_HTTPS"` FunctionsReconcileInterval int `env:"DIREKTIV_FUNCTIONS_RECONCILE_INTERVAL" envDefault:"1"` IsEnterprise bool `env:"DIREKTIV_IS_ENTERPRISE" envDefault:"false"` }
nolint:revive,stylecheck
func (*Config) GetFunctionsReconcileInterval ¶
func (*Config) GetFunctionsTimeout ¶
type Consumer ¶
type Consumer struct { ConsumerFile Namespace string FilePath string Errors []string }
type ConsumerFile ¶
type ContextKey ¶
type ContextKey string
const ( // LogTrackKey is used for tracking related log entries, facilitating the organization of logs in sequences or chains. LogTrackKey ContextKey = "track" // LogTagsKey allows for adding structural metadata to log entries, for categorization based on their origin and context. LogTagsKey ContextKey = "tags" )
type Endpoint ¶
type Endpoint struct { EndpointFile Namespace string FilePath string Errors []string }
type EndpointFile ¶
type EnvironmentVariable ¶
type GatewayManager ¶
type Plugin ¶
type Plugin interface { // NewInstance method creates new plugin instance NewInstance(config PluginConfig) (Plugin, error) Execute(w http.ResponseWriter, r *http.Request) *http.Request Type() string }
type PluginConfig ¶
type PluginsConfig ¶
type PluginsConfig struct { Auth []PluginConfig `yaml:"auth"` Inbound []PluginConfig `yaml:"inbound"` Target PluginConfig `yaml:"target"` Outbound []PluginConfig `yaml:"outbound"` }
type RegistryManager ¶
type ServiceFile ¶
type ServiceFile struct { DirektivAPI string `yaml:"direktiv_api"` Image string `json:"image" yaml:"image"` Cmd string `json:"cmd" yaml:"cmd"` Size string `json:"size" yaml:"size"` Scale int `json:"scale" yaml:"scale"` Envs []EnvironmentVariable `json:"envs" yaml:"envs"` Patches []ServicePatch `json:"patches" yaml:"patches"` }
func ParseServiceFile ¶
func ParseServiceFile(data []byte) (*ServiceFile, error)
type ServiceFileData ¶
type ServiceFileData struct { // identification fields: ID string `json:"id"` Typ string `json:"type"` Namespace string `json:"namespace"` FilePath string `json:"filePath"` Name string `json:"name"` // data fields: ServiceFile // status fields: Error *string `json:"error"` Conditions any `json:"conditions"` }
ServiceFileData extends ServiceFile with identifications and status fields.
func (*ServiceFileData) GetID ¶
func (c *ServiceFileData) GetID() string
GetID calculates a unique id string based on identification fields. This id helps in comparison different lists of objects.
func (*ServiceFileData) GetValueHash ¶
func (c *ServiceFileData) GetValueHash() string
GetValueHash calculates a unique hash string based on the settings fields. This hash helps in comparing different lists of objects.
type ServiceManager ¶
type ServiceManager interface { Run(circuit *Circuit) error SetServices(list []*ServiceFileData) GeAll(namespace string) ([]*ServiceFileData, error) GetPods(namespace string, serviceID string) (any, error) StreamLogs(namespace string, serviceID string, podID string) (io.ReadCloser, error) Rebuild(namespace string, serviceID string) error }
type ServicePatch ¶
type SyncNamespace ¶
TODO: Fix this temp type. SyncNamespace is a temporary type until we fix mirroring logic.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.