Help us shape the future of Go! Take the 2026 Go Developer Survey

module

package
v0.4.28 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 24 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionResponse

type ActionResponse struct {
	Success bool `json:"success"`
}

type Module

type Module struct {
	Id        int       `sql:"id,pk"`
	Name      string    `sql:"name, notnull"`
	Version   string    `sql:"version, notnull"`
	Status    string    `sql:"status,notnull"`
	UpdatedOn time.Time `sql:"updated_on"`
	// contains filtered or unexported fields
}

type ModuleActionAuditLog

type ModuleActionAuditLog struct {
	Id         int       `sql:"id,pk"`
	ModuleName string    `sql:"module_name, notnull"`
	Action     string    `sql:"action,notnull"`
	Version    string    `sql:"version,notnull"`
	CreatedOn  time.Time `sql:"created_on,notnull"`
	CreatedBy  int32     `sql:"created_by,notnull"`
	// contains filtered or unexported fields
}

type ModuleActionAuditLogRepository

type ModuleActionAuditLogRepository interface {
	Save(moduleActionAuditLog *ModuleActionAuditLog) error
}

type ModuleActionAuditLogRepositoryImpl

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

func NewModuleActionAuditLogRepositoryImpl

func NewModuleActionAuditLogRepositoryImpl(dbConnection *pg.DB) *ModuleActionAuditLogRepositoryImpl

func (ModuleActionAuditLogRepositoryImpl) Save

func (impl ModuleActionAuditLogRepositoryImpl) Save(moduleActionAuditLog *ModuleActionAuditLog) error

type ModuleActionRequestDto

type ModuleActionRequestDto struct {
	Action  string `json:"action,notnull" validate:"oneof=install"`
	Version string `json:"version,notnull"`
}

type ModuleCacheService

type ModuleCacheService interface {
}

type ModuleCacheServiceImpl

type ModuleCacheServiceImpl struct {
	K8sUtil *util.K8sUtil
	// contains filtered or unexported fields
}

func NewModuleCacheServiceImpl

func NewModuleCacheServiceImpl(logger *zap.SugaredLogger, K8sUtil *util.K8sUtil, moduleEnvConfig *ModuleEnvConfig, serverEnvConfig *serverEnvConfig.ServerEnvConfig,
	serverDataStore *serverDataStore.ServerDataStore, moduleRepository ModuleRepository) *ModuleCacheServiceImpl

type ModuleCronService

type ModuleCronService interface {
}

type ModuleCronServiceImpl

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

func NewModuleCronServiceImpl

func NewModuleCronServiceImpl(logger *zap.SugaredLogger, moduleEnvConfig *ModuleEnvConfig, moduleRepository ModuleRepository, serverEnvConfig *serverEnvConfig.ServerEnvConfig) (*ModuleCronServiceImpl, error)

func (*ModuleCronServiceImpl) HandleModuleTimeoutStatus

func (impl *ModuleCronServiceImpl) HandleModuleTimeoutStatus()

check modules from DB. if status if installing for 1 hour, mark it as timeout

type ModuleEnvConfig

type ModuleEnvConfig struct {
	ModuleTimeoutStatusHandlingCronDurationInMin int `env:"MODULE_TIMEOUT_STATUS_HANDLING_CRON_DURATION_MIN" envDefault:"5"` // default 5 mins
}

func ParseModuleEnvConfig

func ParseModuleEnvConfig() (*ModuleEnvConfig, error)

type ModuleInfoDto

type ModuleInfoDto struct {
	Name   string `json:"name,notnull"`
	Status string `json:"status,notnull" validate:"oneof=notInstalled installed installing installFailed timeout"`
}

type ModuleRepository

type ModuleRepository interface {
	Save(module *Module) error
	FindOne(name string) (*Module, error)
	Update(module *Module) error
	FindAll() ([]Module, error)
}

type ModuleRepositoryImpl

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

func NewModuleRepositoryImpl

func NewModuleRepositoryImpl(dbConnection *pg.DB) *ModuleRepositoryImpl

func (ModuleRepositoryImpl) FindAll

func (impl ModuleRepositoryImpl) FindAll() ([]Module, error)

func (ModuleRepositoryImpl) FindOne

func (impl ModuleRepositoryImpl) FindOne(name string) (*Module, error)

func (ModuleRepositoryImpl) Save

func (impl ModuleRepositoryImpl) Save(module *Module) error

func (ModuleRepositoryImpl) Update

func (impl ModuleRepositoryImpl) Update(module *Module) error

type ModuleService

type ModuleService interface {
	GetModuleInfo(name string) (*ModuleInfoDto, error)
	HandleModuleAction(userId int32, moduleName string, moduleActionRequest *ModuleActionRequestDto) (*ActionResponse, error)
}

type ModuleServiceImpl

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

func NewModuleServiceImpl

func NewModuleServiceImpl(logger *zap.SugaredLogger, serverEnvConfig *serverEnvConfig.ServerEnvConfig, moduleRepository ModuleRepository,
	moduleActionAuditLogRepository ModuleActionAuditLogRepository, helmAppService client.HelmAppService, serverCacheService server.ServerCacheService, moduleCacheService ModuleCacheService, moduleCronService ModuleCronService) *ModuleServiceImpl

func (ModuleServiceImpl) GetModuleInfo

func (impl ModuleServiceImpl) GetModuleInfo(name string) (*ModuleInfoDto, error)

func (ModuleServiceImpl) HandleModuleAction

func (impl ModuleServiceImpl) HandleModuleAction(userId int32, moduleName string, moduleActionRequest *ModuleActionRequestDto) (*ActionResponse, error)

type ModuleStatus

type ModuleStatus = string
const (
	ModuleStatusNotInstalled  ModuleStatus = "notInstalled"
	ModuleStatusInstalled     ModuleStatus = "installed"
	ModuleStatusInstalling    ModuleStatus = "installing"
	ModuleStatusInstallFailed ModuleStatus = "installFailed"
	ModuleStatusTimeout       ModuleStatus = "timeout"
)

Jump to

Keyboard shortcuts

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