deployment

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const AuthenticationKey = "authentication"

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployment

type Deployment struct {
	Id                      string     `db:"id" json:"id,omitempty"`
	OwnerID                 string     `db:"owner_id" json:"ownerID,omitempty"`
	SinkID                  string     `db:"sink_id" json:"sinkID,omitempty"`
	Backend                 string     `db:"backend" json:"backend,omitempty"`
	Config                  []byte     `db:"config" json:"config,omitempty"`
	LastStatus              string     `db:"last_status" json:"lastStatus,omitempty"`
	LastStatusUpdate        *time.Time `db:"last_status_update" json:"lastStatusUpdate"`
	LastErrorMessage        string     `db:"last_error_message" json:"lastErrorMessage,omitempty"`
	LastErrorTime           *time.Time `db:"last_error_time" json:"lastErrorTime"`
	CollectorName           string     `db:"collector_name" json:"collectorName,omitempty"`
	LastCollectorDeployTime *time.Time `db:"last_collector_deploy_time" json:"lastCollectorDeployTime"`
	LastCollectorStopTime   *time.Time `db:"last_collector_stop_time" json:"lastCollectorStopTime"`
}

func NewDeployment

func NewDeployment(ownerID string, sinkID string, config types.Metadata, backend string) Deployment

func (*Deployment) GetConfig

func (d *Deployment) GetConfig() types.Metadata

func (*Deployment) Merge

func (d *Deployment) Merge(other Deployment) error

func (*Deployment) SetConfig

func (d *Deployment) SetConfig(config types.Metadata) error

type Repository

type Repository interface {
	FetchAll(ctx context.Context) ([]Deployment, error)
	Add(ctx context.Context, deployment *Deployment) (*Deployment, error)
	Update(ctx context.Context, deployment *Deployment) (*Deployment, error)
	UpdateStatus(ctx context.Context, ownerID string, sinkId string, status string, errorMessage string) error
	Remove(ctx context.Context, ownerId string, sinkId string) error
	FindByOwnerAndSink(ctx context.Context, ownerId string, sinkId string) (*Deployment, error)
	FindByCollectorName(ctx context.Context, collectorName string) (*Deployment, error)
}

func NewRepositoryService

func NewRepositoryService(db *sqlx.DB, logger *zap.Logger) Repository

type Service

type Service interface {
	// CreateDeployment to be used to create the deployment when there is a sink.create
	CreateDeployment(ctx context.Context, deployment *Deployment) error
	// GetDeployment to be used to get the deployment information for creating the collector or monitoring the collector
	GetDeployment(ctx context.Context, ownerID string, sinkId string) (*Deployment, string, error)
	// UpdateDeployment to be used to update the deployment when there is a sink.update
	UpdateDeployment(ctx context.Context, deployment *Deployment) error
	// UpdateStatus to be used to update the status of the sink, when there is an error or when the sink is running
	UpdateStatus(ctx context.Context, ownerID string, sinkId string, status string, errorMessage string) error
	// RemoveDeployment to be used to remove the deployment when there is a sink.delete
	RemoveDeployment(ctx context.Context, ownerID string, sinkId string) error
	// GetDeploymentByCollectorName to be used to get the deployment information for creating the collector or monitoring the collector
	GetDeploymentByCollectorName(ctx context.Context, collectorName string) (*Deployment, error)
	// NotifyCollector add collector information to deployment
	NotifyCollector(ctx context.Context, ownerID string, sinkId string, operation string, status string, errorMessage string) (string, error)
}

func NewDeploymentService

func NewDeploymentService(logger *zap.Logger, repository Repository, kafkaUrl string, encryptionKey string,
	maestroProducer producer.Producer, kubecontrol kubecontrol.Service) Service

Jump to

Keyboard shortcuts

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