driver

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DriverType     model.DriverType
	ConfigFilePath string
	IsInCluster    bool
	ProxyPort      uint32
	PrometheusAddr string
	ClusterName    string
}

Config describes the configuration required by the driver module

type Interface

type Interface interface {
	CreateProject(ctx context.Context, project *model.Project) error
	DeleteProject(ctx context.Context, projectID string) error
	ApplyService(ctx context.Context, service *model.Service) error
	GetServices(ctx context.Context, projectID string) ([]*model.Service, error)
	GetServiceStatus(ctx context.Context, projectID string) ([]*model.ServiceStatus, error)
	DeleteService(ctx context.Context, projectID, serviceID, version string) error
	ScaleUp(ctx context.Context, projectID, serviceID, version string) error
	WaitForService(ctx context.Context, service *model.Service) error
	Type() model.DriverType
	GetLogs(ctx context.Context, projectID string, info *model.LogRequest) (io.ReadCloser, error)

	// Service routes
	ApplyServiceRoutes(ctx context.Context, projectID, serviceID string, routes model.Routes) error
	GetServiceRoutes(ctx context.Context, projectID string) (map[string]model.Routes, error)

	// Service role
	ApplyServiceRole(ctx context.Context, role *model.Role) error
	GetServiceRole(ctx context.Context, projectID string) ([]*model.Role, error)
	DeleteServiceRole(ctx context.Context, projectID, serviceID, id string) error

	// Secret methods!
	CreateSecret(ctx context.Context, projectID string, secretObj *model.Secret) error
	ListSecrets(ctx context.Context, projectID string) ([]*model.Secret, error)
	DeleteSecret(ctx context.Context, projectID, secretName string) error
	SetKey(ctx context.Context, projectID, secretName, secretKey string, secretObj *model.SecretValue) error
	DeleteKey(ctx context.Context, projectID, secretName, secretKey string) error
	SetFileSecretRootPath(ctx context.Context, projectID string, secretName, rootPath string) error
}

Interface is the interface of the modules which interact with the deployment targets

type Module

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

Module holds config of driver package

func New

func New(auth *auth.Module, c *Config, hook model.ServiceCallMetricHook) (*Module, error)

New creates a new instance of the driver module

func (*Module) ApplyService

func (m *Module) ApplyService(ctx context.Context, service *model.Service) error

ApplyService applies service

func (*Module) ApplyServiceRole

func (m *Module) ApplyServiceRole(ctx context.Context, role *model.Role) error

ApplyServiceRole applies service role

func (*Module) ApplyServiceRoutes

func (m *Module) ApplyServiceRoutes(ctx context.Context, projectID, serviceID string, routes model.Routes) error

ApplyServiceRoutes applies service routes

func (*Module) CreateProject

func (m *Module) CreateProject(ctx context.Context, project *model.Project) error

CreateProject creates project

func (*Module) CreateSecret

func (m *Module) CreateSecret(ctx context.Context, projectID string, secretObj *model.Secret) error

CreateSecret create's secret

func (*Module) DeleteKey

func (m *Module) DeleteKey(ctx context.Context, projectID, secretName, secretKey string) error

DeleteKey delete's key of secret

func (*Module) DeleteProject

func (m *Module) DeleteProject(ctx context.Context, projectID string) error

DeleteProject deletes project

func (*Module) DeleteSecret

func (m *Module) DeleteSecret(ctx context.Context, projectID, secretName string) error

DeleteSecret delete's secret

func (*Module) DeleteService

func (m *Module) DeleteService(ctx context.Context, projectID, serviceID, version string) error

DeleteService delete's service

func (*Module) DeleteServiceRole

func (m *Module) DeleteServiceRole(ctx context.Context, projectID, serviceID, id string) error

DeleteServiceRole delete's service role

func (*Module) GetLogs

func (m *Module) GetLogs(ctx context.Context, projectID string, info *model.LogRequest) (io.ReadCloser, error)

GetLogs get logs of specified service

func (*Module) GetServiceRole

func (m *Module) GetServiceRole(ctx context.Context, projectID string) ([]*model.Role, error)

GetServiceRole get's service role

func (*Module) GetServiceRoutes

func (m *Module) GetServiceRoutes(ctx context.Context, projectID string) (map[string]model.Routes, error)

GetServiceRoutes get's service routes

func (*Module) GetServiceStatus

func (m *Module) GetServiceStatus(ctx context.Context, projectID string) ([]*model.ServiceStatus, error)

GetServiceStatus gets services status

func (*Module) GetServices

func (m *Module) GetServices(ctx context.Context, projectID string) ([]*model.Service, error)

GetServices gets services

func (*Module) ListSecrets

func (m *Module) ListSecrets(ctx context.Context, projectID string) ([]*model.Secret, error)

ListSecrets list's secrets

func (*Module) ScaleUp

func (m *Module) ScaleUp(ctx context.Context, projectID, serviceID, version string) error

ScaleUp scales a service up from 0 replicas

func (*Module) SetFileSecretRootPath

func (m *Module) SetFileSecretRootPath(ctx context.Context, projectID string, secretName, rootPath string) error

SetFileSecretRootPath set's file secret root path

func (*Module) SetKey

func (m *Module) SetKey(ctx context.Context, projectID, secretName, secretKey string, secretObj *model.SecretValue) error

SetKey set's key for secret

func (*Module) Type

func (m *Module) Type() model.DriverType

Type gets driver type

func (*Module) WaitForService

func (m *Module) WaitForService(ctx context.Context, service *model.Service) error

WaitForService waits for service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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