controller

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func New

func New(config config.Config, db Database, deploymentClient DeploymentClient, kafkaAdmin KafkaAdmin) *Controller

func (*Controller) CountInstances

func (this *Controller) CountInstances(userId string, search string, includeGenerated bool) (count int64, err error, errCode int)

func (*Controller) CreateInstance

func (this *Controller) CreateInstance(instance model.Instance, jwt auth.Token) (result model.Instance, err error, code int)

func (*Controller) DeleteInstance

func (this *Controller) DeleteInstance(id string, userId string) (err error, errCode int)

func (*Controller) EnsureAllInstancesDeployed

func (this *Controller) EnsureAllInstancesDeployed() (err error)

func (*Controller) ListInstances

func (this *Controller) ListInstances(userId string, limit int64, offset int64, sort string, asc bool, search string, includeGenerated bool) (results []model.Instance, err error, errCode int)

func (*Controller) ReadInstance

func (this *Controller) ReadInstance(id string, userId string) (result model.Instance, err error, errCode int)

func (*Controller) SetInstance

func (this *Controller) SetInstance(instance model.Instance, jwt auth.Token) (err error, code int)

type Database

type Database interface {
	ListInstances(ctx context.Context, limit int64, offset int64, sort string, owner string, asc bool, search string, includeGenerated bool) (result []model.Instance, err error)
	GetInstance(ctx context.Context, id string, owner string) (instance model.Instance, exists bool, err error)
	SetInstance(ctx context.Context, instance model.Instance, owner string) error
	RemoveInstance(ctx context.Context, id string, owner string) error
	CountInstances(ctx context.Context, owner string, search string, includeGenerated bool) (count int64, err error)
}

type DeploymentClient

type DeploymentClient interface {
	CreateContainer(name string, image string, env map[string]string, restart bool, userid string, importTypeId string) (id string, err error)
	UpdateContainer(id string, name string, image string, env map[string]string, restart bool, userid string, importTypeId string) (newId string, err error)
	RemoveContainer(id string) (err error)
	ContainerExists(id string) (exists bool, err error)
}

type Driver

type Driver interface {
	CreateInstance(instance *model.Instance, env map[string]string) (serviceId string, err error)
	DeleteInstance(id string) (err error)
}

type KafkaAdmin

type KafkaAdmin interface {
	CreateTopic(name string) (err error)
	DeleteTopic(name string) (err error)
}

Jump to

Keyboard shortcuts

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