service

package
v0.0.0-...-ab49fd9 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNoSuchImage = fbError.Error("no such image found")
)
View Source
const IngestBacktestTopic = "service.IngestBacktest"
View Source
const InstanceRunningTopic = "service.InstanceRunning"
View Source
const InstanceStartedTopic = "service.InstanceStarted"
View Source
const ServiceCreatedTopic = "service.ServiceCreated"
View Source
const StartInstanceTopic = "service.StartInstance"
View Source
const StopInstanceTopic = "service.StopInstance"

Variables

This section is empty.

Functions

func NewServiceModule

func NewServiceModule(log *zap.Logger, config *config.Config, services storage.ServiceStorage,
	instances storage.InstanceStorage, container Container, stream stream.Stream, lc fx.Lifecycle) error

func NewStorage

func NewStorage(connection *pgxpool.Pool) (storage.ServiceStorage, storage.InstanceStorage, error)

func Routes

func Routes(route *gin.RouterGroup, log *zap.Logger, config *config.Config, services storage.ServiceStorage,
	instances storage.InstanceStorage,
	container Container, stream stream.Stream) (routes, error)

Types

type Container

type Container interface {
	Start(ctx context.Context, config *config.Config, serviceName, image string) (string, error)
	SaveImage(ctx context.Context, containerID, name string) error
	Stop(ctx context.Context, containerID string, remove bool) error
}

func NewContainer

func NewContainer(log *zap.Logger) (Container, error)

type ContainerStatus

type ContainerStatus struct {
	ID  string
	Err error
}

type IngestBacktestPayload

type IngestBacktestPayload struct {
	Service string               `json:"service_name"`
	Config  storage.IngestConfig `json:"config"`
}

type InitialResponse

type InitialResponse struct {
	Type    string `json:"type"`
	Version string `json:"version"`
}

type InstanceRunningPayload

type InstanceRunningPayload struct {
	Service   string `json:"service_name"`
	ID        string `json:"ID"`
	Execution string `json:"execution"`
}

type ServiceCreatedPayload

type ServiceCreatedPayload struct {
	Name string `json:"name"`
}

type StartInstancePayload

type StartInstancePayload struct {
	Service   string `json:"service_name"`
	Execution string `json:"execution"`
}

type StopInstancePayload

type StopInstancePayload struct {
	ID     string `json:"ID"`
	Remove bool   `json:"remove"`
}

Directories

Path Synopsis
backtest
internal

Jump to

Keyboard shortcuts

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