Documentation ¶
Index ¶
- func BuildEventBroker(ctx context.Context, logger *slog.Logger, cfg EventsBrokerConfig) (core.Broker, error)
- func BuildEvents(ctx context.Context, logger *slog.Logger, config EventsConfig) (core.Broker, error)
- func BuildPrettySlogHandler(w io.Writer, level slog.Level) slog.Handler
- func BuildResources(ctx context.Context, broker core.Broker, logger *slog.Logger, ...) (core.ResourceDB, error)
- func BuildResourcesObserver(ctx context.Context, broker core.Broker, logger *slog.Logger, ...) (resources.Observer, error)
- func BuildResourcesStorage(ctx context.Context, config ResourcesStorageConfig) (core.ResourceDB, error)
- func BuildServiceCore(ctx context.Context, defaultName string, logger *slog.Logger, ...) (service.Core, error)
- func BuildServiceLogger(handler slog.Handler, service string) *slog.Logger
- func BuildSpecifications(ctx context.Context, cfg SpecificationsConfig) (*specification.Manager, error)
- func BuildSystem(ctx context.Context, logger *slog.Logger, config SystemConfig) (*core.System, error)
- func BuildTasks(ctx context.Context, logger *slog.Logger, config TasksConfig) (core.TaskDB, error)
- func BuildTasksStorage(ctx context.Context, logger *slog.Logger, config TasksStorageConfig) (core.TaskDB, error)
- func ParseEnvVariableHookFunc() mapstructure.DecodeHookFunc
- func ToDurationHookFunc() mapstructure.DecodeHookFunc
- type Config
- type CoreConfig
- type Deployment
- func BuildDiscoveryDeployment(ctx context.Context, sys *core.System, logger *slog.Logger, ...) (Deployment[*discovery.Poller], error)
- func BuildHttpApiDeployment(ctx context.Context, sys *core.System, ...) (Deployment[*HttpApiService], error)
- func BuildProcessorDeployment(ctx context.Context, sys *core.System, exe executor.Executor, ...) (Deployment[*executor.Service], error)
- func BuildSchedulerDeployment(ctx context.Context, sys *core.System, logger *slog.Logger, ...) (Deployment[*dependencies.Service], error)
- func BuildStatusDeployment(ctx context.Context, sys *core.System, logger *slog.Logger, ...) (Deployment[*status.Service], error)
- type DiscoveryHubConfig
- type DiscoveryServiceConfig
- type DynamicConfig
- type EventsBrokerConfig
- type EventsConfig
- type HttpApiService
- type HttpApiServiceConfig
- type ProcessorServiceConfig
- type ResourcesConfig
- type ResourcesObserverConfig
- type ResourcesStorageConfig
- type SchedulerDependenciesConfig
- type SchedulerResolverConfig
- type SchedulerResourceResolverConfig
- type SchedulerResourceResolverStorageConfig
- type SchedulerServiceConfig
- type SchedulerTaskToGroupConfig
- type ServiceConfig
- type ServiceDiscoveryConfig
- type ServicesConfig
- type SpecificationsConfig
- type SpecificationsStorageConfig
- type StatusServiceConfig
- type SystemConfig
- type TasksConfig
- type TasksStorageConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildEventBroker ¶
func BuildEvents ¶
func BuildPrettySlogHandler ¶
func BuildResources ¶
func BuildResources(ctx context.Context, broker core.Broker, logger *slog.Logger, config ResourcesConfig) (core.ResourceDB, error)
func BuildResourcesObserver ¶
func BuildResourcesStorage ¶
func BuildResourcesStorage(ctx context.Context, config ResourcesStorageConfig) (core.ResourceDB, error)
func BuildServiceCore ¶
func BuildServiceLogger ¶
func BuildSpecifications ¶
func BuildSpecifications(ctx context.Context, cfg SpecificationsConfig) (*specification.Manager, error)
func BuildSystem ¶
func BuildTasks ¶
func BuildTasksStorage ¶
func ParseEnvVariableHookFunc ¶
func ParseEnvVariableHookFunc() mapstructure.DecodeHookFunc
func ToDurationHookFunc ¶
func ToDurationHookFunc() mapstructure.DecodeHookFunc
Types ¶
type Config ¶
type Config struct { Core CoreConfig `yaml:"core,omitempty" json:"core,omitempty"` Services ServicesConfig `yaml:"services,omitempty" json:"services,omitempty"` }
type CoreConfig ¶
type CoreConfig struct { System SystemConfig `yaml:"system,omitempty" json:"system,omitempty"` Specifications SpecificationsConfig `yaml:"specifications,omitempty" json:"specifications,omitempty"` }
type Deployment ¶
type Deployment[S service.Service] struct { Service S Middlewares []service.Middleware }
func BuildHttpApiDeployment ¶
func BuildHttpApiDeployment(ctx context.Context, sys *core.System, specificationManager *specification.Manager, logger *slog.Logger, cfg HttpApiServiceConfig) (Deployment[*HttpApiService], error)
func BuildSchedulerDeployment ¶
func BuildSchedulerDeployment(ctx context.Context, sys *core.System, logger *slog.Logger, cfg SchedulerServiceConfig) (Deployment[*dependencies.Service], error)
func BuildStatusDeployment ¶
type DiscoveryHubConfig ¶
type DiscoveryServiceConfig ¶
type DiscoveryServiceConfig struct { ServiceConfig ServiceConfig `yaml:"$,omitempty" json:"$,omitempty"` PollingInterval time.Duration `yaml:"polling_interval,omitempty" json:"polling_interval,omitempty"` Hub DiscoveryHubConfig `yaml:"hub,omitempty" json:"hub,omitempty"` }
type DynamicConfig ¶
func (DynamicConfig) Bind ¶
func (config DynamicConfig) Bind(to any) error
func (DynamicConfig) Kind ¶
func (config DynamicConfig) Kind() string
type EventsBrokerConfig ¶
type EventsConfig ¶
type EventsConfig struct {
Broker EventsBrokerConfig `yaml:"broker,omitempty" json:"broker,omitempty"`
}
type HttpApiService ¶
type HttpApiServiceConfig ¶
type HttpApiServiceConfig struct { ServiceConfig ServiceConfig `yaml:"$,omitempty" json:"$,omitempty"` Port int `yaml:"port,omitempty" json:"port,omitempty"` LoggerEnabled bool `yaml:"logger_enabled,omitempty" json:"logger_enabled,omitempty"` }
type ProcessorServiceConfig ¶
type ProcessorServiceConfig struct { ServiceConfig ServiceConfig `yaml:"$,omitempty" json:"$,omitempty"` Kind string `yaml:"kind,omitempty" json:"kind,omitempty"` }
type ResourcesConfig ¶
type ResourcesConfig struct { Storage ResourcesStorageConfig `yaml:"storage,omitempty" json:"storage,omitempty"` Observers []ResourcesObserverConfig `yaml:"observers,omitempty" json:"observers,omitempty"` }
type ResourcesObserverConfig ¶
type ResourcesObserverConfig struct { Kind string `yaml:"kind,omitempty" json:"kind,omitempty"` Options DynamicConfig `yaml:"options,omitempty" json:"options,omitempty"` }
type ResourcesStorageConfig ¶
type SchedulerDependenciesConfig ¶
type SchedulerDependenciesConfig struct { Poller struct { Interval time.Duration `yaml:"interval,omitempty" json:"interval,omitempty"` BatchSize int `yaml:"batch_size,omitempty" json:"batch_size,omitempty"` } `yaml:"poller,omitempty" json:"poller,omitempty"` Postgres struct { URI string `yaml:"uri,omitempty" json:"uri,omitempty"` Options map[string]any `yaml:"options,omitempty" json:"options,omitempty"` } `yaml:"postgres,omitempty" json:"postgres,omitempty"` }
type SchedulerResolverConfig ¶
type SchedulerResolverConfig struct { Kind string `yaml:"kind,omitempty" json:"kind,omitempty"` Data DynamicConfig `yaml:"data,omitempty" json:"data,omitempty"` }
type SchedulerResourceResolverConfig ¶
type SchedulerResourceResolverConfig struct { Storage SchedulerResourceResolverStorageConfig `yaml:"storage,omitempty" json:"storage,omitempty"` Poller struct { Limit int `yaml:"limit,omitempty" json:"limit,omitempty"` Interval time.Duration `yaml:"interval,omitempty" json:"interval,omitempty"` } `yaml:"poller,omitempty" json:"poller,omitempty"` }
type SchedulerServiceConfig ¶
type SchedulerServiceConfig struct { ServiceConfig ServiceConfig `yaml:"$,omitempty" json:"$,omitempty"` TaskToGroup SchedulerTaskToGroupConfig `yaml:"task_to_group,omitempty" json:"task_to_group,omitempty"` Dependencies SchedulerDependenciesConfig `yaml:"dependencies,omitempty" json:"dependencies,omitempty"` Resolvers []SchedulerResolverConfig `yaml:"resolvers,omitempty" json:"resolvers,omitempty"` }
type ServiceConfig ¶
type ServiceConfig struct { ID string `yaml:"id,omitempty" json:"id,omitempty"` Name string `yaml:"name,omitempty" json:"name,omitempty"` Discovery ServiceDiscoveryConfig `yaml:"discovery,omitempty" json:"discovery,omitempty"` }
type ServiceDiscoveryConfig ¶
type ServicesConfig ¶
type ServicesConfig struct { HttpApi HttpApiServiceConfig `yaml:"http_api,omitempty" json:"http_api,omitempty"` Scheduler SchedulerServiceConfig `yaml:"scheduler,omitempty" json:"scheduler,omitempty"` Status StatusServiceConfig `yaml:"status,omitempty" json:"status,omitempty"` Processor ProcessorServiceConfig `yaml:"processor,omitempty" json:"processor,omitempty"` Discovery DiscoveryServiceConfig `yaml:"discovery,omitempty" json:"discovery,omitempty"` }
type SpecificationsConfig ¶
type SpecificationsConfig struct {
Storage SpecificationsStorageConfig `yaml:"storage,omitempty" json:"storage,omitempty"`
}
type StatusServiceConfig ¶
type StatusServiceConfig struct {
ServiceConfig ServiceConfig `yaml:"$,omitempty" json:"$,omitempty"`
}
type SystemConfig ¶
type SystemConfig struct { Tasks TasksConfig `yaml:"tasks,omitempty" json:"tasks,omitempty"` Resources ResourcesConfig `yaml:"resources,omitempty" json:"resources,omitempty"` Events EventsConfig `yaml:"events,omitempty" json:"events,omitempty"` }
type TasksConfig ¶
type TasksConfig struct {
Storage TasksStorageConfig `yaml:"storage,omitempty" json:"storage,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.