dbModel

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: EPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityRecord

type ActivityRecord struct {
	ID                uint64 `gorm:"primarykey"`
	Level             string `gorm:"not null"`
	Code              *string
	Message           *string
	IpAddress         *string
	OperatorAccountId *uint
	TargetAccountId   *uint
	Username          *string
	MappingId         *uint64
	CreatedAt         time.Time `gorm:"not null"`
}

func NewActivityRecord

func NewActivityRecord(
	id uint64,
	level string,
	code, message, ipAddress *string,
	operatorAccountId, targetAccountId *uint,
	username *string,
	mappingId *uint64,
) ActivityRecord

func (ActivityRecord) TableName

func (ActivityRecord) TableName() string

func (ActivityRecord) ToEntity

func (model ActivityRecord) ToEntity() (recordEntity entity.ActivityRecord, err error)

type InstalledService

type InstalledService struct {
	Name              string `gorm:"primarykey;not null"`
	Nature            string `gorm:"not null"`
	Type              string `gorm:"not null"`
	Version           string `gorm:"not null"`
	StartCmd          string `gorm:"not null"`
	Envs              *string
	PortBindings      *string
	StopCmdSteps      *string
	PreStartCmdSteps  *string
	PostStartCmdSteps *string
	PreStopCmdSteps   *string
	PostStopCmdSteps  *string
	ExecUser          *string
	WorkingDirectory  *string
	StartupFile       *string
	AutoStart         *bool
	AutoRestart       *bool
	TimeoutStartSecs  *uint
	MaxStartRetries   *uint
	LogOutputPath     *string
	LogErrorPath      *string
	CreatedAt         time.Time `gorm:"not null"`
	UpdatedAt         time.Time `gorm:"not null"`
}

func NewInstalledService

func NewInstalledService(
	name, nature, serviceType, version, startCmd string,
	envs []valueObject.ServiceEnv, portBindings []valueObject.PortBinding,
	stopSteps, preStartSteps, postStartSteps, preStopSteps, postStopSteps []valueObject.UnixCommand,
	execUser, workingDirectory, startupFile *string, autoStart, autoRestart *bool,
	timeoutStartSecs, maxStartRetries *uint, logOutputPath, logErrorPath *string,
) InstalledService

func (InstalledService) InitialEntries

func (InstalledService) InitialEntries() (entries []interface{}, err error)

func (InstalledService) JoinCmdSteps

func (InstalledService) JoinCmdSteps(cmdSteps []valueObject.UnixCommand) string

func (InstalledService) JoinEnvs

func (InstalledService) JoinEnvs(envs []valueObject.ServiceEnv) string

func (InstalledService) JoinPortBindings

func (InstalledService) JoinPortBindings(portBindings []valueObject.PortBinding) string

func (InstalledService) SplitCmdSteps

func (InstalledService) SplitCmdSteps(cmdStepsStr string) []valueObject.UnixCommand

func (InstalledService) SplitEnvs

func (InstalledService) SplitEnvs(envsStr string) []valueObject.ServiceEnv

func (InstalledService) SplitPortBindings

func (InstalledService) SplitPortBindings(portBindingsStr string) []valueObject.PortBinding

func (InstalledService) TableName

func (InstalledService) TableName() string

func (InstalledService) ToEntity

func (model InstalledService) ToEntity() (serviceEntity entity.InstalledService, err error)

type Mapping

type Mapping struct {
	ID                         uint   `gorm:"primarykey"`
	Hostname                   string `gorm:"not null"`
	Path                       string `gorm:"not null"`
	MatchPattern               string `gorm:"not null"`
	TargetType                 string `gorm:"not null"`
	TargetValue                *string
	TargetHttpResponseCode     *string
	VirtualHostHostname        string `gorm:"not null"`
	MarketplaceInstalledItemId *uint
	CreatedAt                  time.Time `gorm:"not null"`
	UpdatedAt                  time.Time `gorm:"not null"`
}

func NewMapping

func NewMapping(
	id uint,
	hostname string,
	path string,
	matchPattern string,
	targetType string,
	targetValue *string,
	targetHttpResponseCode *string,
	vhostName string,
) Mapping

func (Mapping) TableName

func (Mapping) TableName() string

func (Mapping) ToEntity

func (model Mapping) ToEntity() (entity.Mapping, error)

func (Mapping) ToModel

func (Mapping) ToModel(mappingEntity entity.Mapping) Mapping

type MarketplaceInstalledItem

type MarketplaceInstalledItem struct {
	ID               uint   `gorm:"primarykey"`
	Name             string `gorm:"not null"`
	Hostname         string `gorm:"not null"`
	Type             string `gorm:"not null"`
	UrlPath          string `gorm:"not null"`
	InstallDirectory string `gorm:"not null"`
	InstallUuid      string `gorm:"not null"`
	Services         string
	Mappings         []Mapping
	AvatarUrl        string    `gorm:"not null"`
	Slug             string    `gorm:"not null"`
	CreatedAt        time.Time `gorm:"not null"`
	UpdatedAt        time.Time `gorm:"not null"`
}

func (MarketplaceInstalledItem) TableName

func (MarketplaceInstalledItem) TableName() string

func (MarketplaceInstalledItem) ToEntity

type ScheduledTask

type ScheduledTask struct {
	ID          uint64 `gorm:"primarykey"`
	Name        string `gorm:"not null"`
	Status      string `gorm:"not null,index"`
	Command     string `gorm:"not null"`
	Tags        []ScheduledTaskTag
	TimeoutSecs *uint16
	RunAt       *time.Time
	Output      *string
	Error       *string
	StartedAt   *time.Time
	FinishedAt  *time.Time
	ElapsedSecs *uint32
	CreatedAt   time.Time `gorm:"not null"`
	UpdatedAt   time.Time `gorm:"not null"`
}

func NewScheduledTask

func NewScheduledTask(
	id uint64,
	name, status, command string,
	tags []ScheduledTaskTag,
	timeoutSecs *uint16,
	runAt *time.Time,
	output, err *string,
	startedAt, finishedAt *time.Time,
	elapsedSecs *uint32,
) ScheduledTask

func (ScheduledTask) TableName

func (ScheduledTask) TableName() string

func (ScheduledTask) ToEntity

func (model ScheduledTask) ToEntity() (taskEntity entity.ScheduledTask, err error)

type ScheduledTaskTag

type ScheduledTaskTag struct {
	ID              uint64 `gorm:"primarykey"`
	Tag             string `gorm:"not null"`
	ScheduledTaskID uint64 `gorm:"not null"`
}

func (ScheduledTaskTag) TableName

func (ScheduledTaskTag) TableName() string

type VirtualHost

type VirtualHost struct {
	Hostname       string `gorm:"primarykey;not null"`
	Type           string `gorm:"not null"`
	RootDirectory  string `gorm:"not null"`
	ParentHostname *string
	Mappings       []Mapping
	CreatedAt      time.Time `gorm:"not null"`
	UpdatedAt      time.Time `gorm:"not null"`
}

func (VirtualHost) InitialEntries

func (model VirtualHost) InitialEntries() (entries []interface{}, err error)

func (VirtualHost) ToEntity

func (model VirtualHost) ToEntity() (vhost entity.VirtualHost, err error)

func (VirtualHost) ToModel

func (VirtualHost) ToModel(
	entity entity.VirtualHost,
	mappings []entity.Mapping,
) VirtualHost

Jump to

Keyboard shortcuts

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