core

package
v0.0.0-...-bb536ff Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSync

func InitSync(core *Core, scheduler chrono.TaskScheduler)

Types

type ApiKeys

type ApiKeys interface {
	GetApiKeys(auth middleware.Authentication) ([]openapi.ApiKey, error)
	GetUsernameByApiKey(apiKey string) (string, error)
	CreateApiKey(ctx context.Context, key openapi.ApiKey, auth middleware.Authentication) (*openapi.ApiKey, error)
	DeleteApiKey(ctx context.Context, apiKey string, auth middleware.Authentication) error
}

func InitApiKeys

func InitApiKeys(storage *storage.Storage) ApiKeys

type ContainerRegistries

type ContainerRegistries interface {
	GetProjectContainerRegistries(project string, auth middleware.Authentication) ([]openapi.ContainerRegistry, error)
	AddContainerRegistry(ctx context.Context, project string, registry openapi.ContainerRegistry, auth middleware.Authentication) (openapi.ContainerRegistry, error)
	DeleteContainerRegistry(ctx context.Context, project string, id int, auth middleware.Authentication) error
	// contains filtered or unexported methods
}

func InitContainerRegistries

func InitContainerRegistries(projects Projects, storage *storage.Storage, clientset *kubernetes.Clientset) ContainerRegistries

type Core

type Core struct {
	Projects        Projects
	Services        Services
	ManagedServices ManagedServices
	MongoDbMgmt     MongoDbMgmt
	Registries      ContainerRegistries
	Tokens          Tokens
	ApiKeys         ApiKeys
}

func New

func New(
	storage *storage.Storage,
	rdb *redis.Client,
	clientset *kubernetes.Clientset,
	cmClient *certManagerClientset.Clientset,
	taskScheduler chrono.TaskScheduler,
	cfg *viper.Viper,
) *Core

type ManagedServices

type ManagedServices interface {
	GetProjectManagedServices(project string, auth middleware.Authentication) ([]openapi.ManagedService, error)
	CreateManagedService(ctx context.Context, service openapi.ManagedService, auth middleware.Authentication) (*openapi.ManagedService, error)
	GetManagedService(id int, auth middleware.Authentication) (*openapi.ManagedService, error)
	DeleteManagedService(ctx context.Context, id int, auth middleware.Authentication) error
	GetManagedServiceStatus(ctx context.Context, id int, auth middleware.Authentication) (*openapi.ServiceStatus, error)
	// contains filtered or unexported methods
}

func InitManagedServices

func InitManagedServices(
	projects Projects,
	storage *storage.Storage,
	clientset *kubernetes.Clientset,
) ManagedServices

type MongoDbMgmt

type MongoDbMgmt interface {
	GetMongoDbUsers(ctx context.Context, serviceId int, auth middleware.Authentication) ([]openapi.MongoDbUser, error)
	GetMongoDbUser(ctx context.Context, serviceId int, mongoDbUsername string, auth middleware.Authentication) (openapi.MongoDbUser, error)
	CreateMongoDbUser(ctx context.Context, serviceId int, mongoDbUser openapi.MongoDbUser, auth middleware.Authentication) (openapi.MongoDbUser, error)
	UpdateMongoDbUser(ctx context.Context, serviceId int, mongoDbUser openapi.MongoDbUser, authentication middleware.Authentication) (openapi.MongoDbUser, error)
	DeleteMongoDbUser(ctx context.Context, serviceId int, mongoDbUsername string, auth middleware.Authentication) error
}

func InitMongoDbMgmt

func InitMongoDbMgmt(
	managedServices ManagedServices,
	storage *storage.Storage,
	clientset *kubernetes.Clientset,
) MongoDbMgmt

type Projects

type Projects interface {
	FindAll(limit int, offset int) ([]openapi.Project, error)
	CreateProject(ctx context.Context, project openapi.Project, auth middleware.Authentication) (*openapi.Project, error)
	GetProject(id string, auth middleware.Authentication) (*openapi.Project, error)
	GetProjectInfo(id string, auth middleware.Authentication) (*openapi.ProjectInfo, error)
	UpdateProject(project openapi.Project, auth middleware.Authentication) error
	DeleteProject(ctx context.Context, id string, auth middleware.Authentication) error
	GetUserProjects(auth middleware.Authentication) ([]openapi.Project, error)
	GetParticipants(id string, auth middleware.Authentication) ([]string, error)
	AddParticipant(id string, username string, auth middleware.Authentication) error
	RemoveParticipant(id string, username string, auth middleware.Authentication) error
	JoinProject(ctx context.Context, code string, auth middleware.Authentication) (*openapi.Project, error)
	RegenerateInviteCode(ctx context.Context, id string, auth middleware.Authentication) (string, error)
	GetSecrets(projectId string, auth middleware.Authentication) ([]openapi.Secret, error)
	CreateSecret(ctx context.Context, projectId string, secretValue openapi.SecretValue, auth middleware.Authentication) (*openapi.Secret, error)
	GetSecretValue(projectId string, name string, auth middleware.Authentication) (*openapi.SecretValue, error)
	DeleteSecret(ctx context.Context, projectId string, name string, auth middleware.Authentication) error
	// contains filtered or unexported methods
}

func InitProjects

func InitProjects(
	storage *storage.Storage,
	clientset *kubernetes.Clientset,
	cmClient *certManagerClientset.Clientset,
	cfg *viper.Viper,
	core promise.Promise[Core],
) Projects

type Services

type Services interface {
	GetProjectServices(project string, auth middleware.Authentication) ([]openapi.Service, error)
	CreateService(ctx context.Context, service openapi.Service, auth middleware.Authentication) (*openapi.Service, error)
	GetService(id int, auth middleware.Authentication) (*openapi.Service, error)
	UpdateService(ctx context.Context, service openapi.Service, auth middleware.Authentication) (*openapi.Service, error)
	DeleteService(ctx context.Context, id int, auth middleware.Authentication) error
	GetServiceStatus(ctx context.Context, id int, auth middleware.Authentication) (*openapi.ServiceStatus, error)
	RestartService(ctx context.Context, id int, auth middleware.Authentication) error
	StreamServiceLogs(ctx context.Context, serviceId int, replica int, auth middleware.Authentication) (io.Reader, error)
	// contains filtered or unexported methods
}

func InitServices

func InitServices(
	projects Projects,
	storage *storage.Storage,
	clientset *kubernetes.Clientset,
	cfg *viper.Viper,
) Services

type Tokens

type Tokens interface {
	CreateTempToken(ctx context.Context, auth middleware.Authentication) (string, error)
}

func InitTokens

func InitTokens(rdb *redis.Client) Tokens

Jump to

Keyboard shortcuts

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