Documentation ¶
Index ¶
- Constants
- Variables
- type App
- type Circuit
- type Config
- type ConsumerFile
- type ContextKey
- type Endpoint
- type EndpointFile
- type EnvironmentVariable
- type GatewayManager
- type LogEntry
- type LogStatus
- type PluginConfig
- type PluginInstance
- type Plugins
- type Registry
- type RegistryManager
- type ServiceFile
- type ServiceFileData
- type ServiceManager
- type ServicePatch
- type SyncNamespace
- type Version
Constants ¶
View Source
const ( ServiceTypeNamespace = "namespace-service" ServiceTypeWorkflow = "workflow-service" )
View Source
const MagicalGatewayNamespace = "gateway"
Variables ¶
View Source
var ErrNotFound = errors.New("ErrNotFound")
Functions ¶
This section is empty.
Types ¶
type App ¶ added in v0.8.1
type App struct { Version *Version Config *Config ServiceManager ServiceManager RegistryManager RegistryManager GatewayManager GatewayManager SyncNamespace SyncNamespace }
type Circuit ¶ added in v0.8.5
type Circuit struct {
// contains filtered or unexported fields
}
nolint: containedctx
func NewCircuit ¶ added in v0.8.5
type Config ¶ added in v0.8.1
type Config struct { DirektivNamespace string `env:"DIREKTIV_NAMESPACE"` LogFormat string `env:"DIREKTIV_LOG_FORMAT"` LogDebug bool `env:"DIREKTIV_DEBUG"` ApiV1Port int `env:"DIREKTIV_API_V1_PORT" envDefault:"6665"` ApiV2Port int `env:"DIREKTIV_API_V2_PORT" envDefault:"6667"` GrpcPort int `env:"DIREKTIV_GRPC_PORT" envDefault:"6666"` 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"` EnableEventing bool `env:"DIREKTIV_ENABLE_EVENTING"` EnableDocker bool `env:"DIREKITV_ENABLE_DOCKER"` 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"` }
nolint:revive,stylecheck
func (*Config) GetFunctionsReconcileInterval ¶ added in v0.8.1
func (*Config) GetFunctionsTimeout ¶ added in v0.8.1
type ConsumerFile ¶ added in v0.8.1
type ConsumerFile struct { DirektivAPI string `json:"-" yaml:"direktiv_api"` Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` APIKey string `json:"api_key" yaml:"api_key"` Tags []string `json:"tags" yaml:"tags"` Groups []string `json:"groups" yaml:"groups"` }
func ParseConsumerFile ¶ added in v0.8.1
func ParseConsumerFile(data []byte) (*ConsumerFile, error)
type ContextKey ¶ added in v0.8.4
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 ¶ added in v0.8.1
type Endpoint struct { Namespace string `json:"-"` FilePath string `json:"file_path,omitempty"` Path string `json:"path,omitempty"` ServerPath string `json:"server_path"` Methods []string `json:"methods"` AllowAnonymous bool `json:"allow_anonymous"` Timeout int `json:"timeout"` AuthPluginInstances []PluginInstance `json:"-"` InboundPluginInstances []PluginInstance `json:"-"` TargetPluginInstance PluginInstance `json:"-"` OutboundPluginInstances []PluginInstance `json:"-"` Errors []string `json:"errors"` Warnings []string `json:"warnings"` Plugins Plugins `json:"plugins"` }
type EndpointFile ¶ added in v0.8.1
type EndpointFile struct { DirektivAPI string `json:"-" yaml:"direktiv_api"` Methods []string `json:"methods" yaml:"methods"` Path string `json:"path" yaml:"path"` AllowAnonymous bool `json:"allow_anonymous" yaml:"allow_anonymous"` Plugins Plugins `json:"plugins" yaml:"plugins"` Timeout int `json:"timeout" yaml:"timeout"` }
func ParseEndpointFile ¶ added in v0.8.1
func ParseEndpointFile(data []byte) (*EndpointFile, error)
type EnvironmentVariable ¶ added in v0.8.1
type GatewayManager ¶ added in v0.8.1
type PluginConfig ¶ added in v0.8.1
type PluginInstance ¶ added in v0.8.1
type PluginInstance interface { ExecutePlugin(c *ConsumerFile, w http.ResponseWriter, r *http.Request) bool Config() interface{} Type() string }
type Plugins ¶ added in v0.8.1
type Plugins struct { Auth []PluginConfig `json:"auth,omitempty" yaml:"auth"` Inbound []PluginConfig `json:"inbound,omitempty" yaml:"inbound"` Target *PluginConfig `json:"target,omitempty" yaml:"target"` Outbound []PluginConfig `json:"outbound,omitempty" yaml:"outbound"` }
type RegistryManager ¶ added in v0.8.1
type ServiceFile ¶ added in v0.8.3
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 ¶ added in v0.8.3
func ParseServiceFile(data []byte) (*ServiceFile, error)
type ServiceFileData ¶ added in v0.8.3
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 ¶ added in v0.8.3
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 ¶ added in v0.8.3
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 ¶ added in v0.8.1
type ServiceManager interface { Start(circuit *Circuit) 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 ¶ added in v0.8.1
type SyncNamespace ¶ added in v0.8.5
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.